> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/ja/zhi-pin/rome-cli.md).

# Rome CLI + MCP

Romeの開発者向けCLIとMCPサーバー — 現実に即したチェーン情報、適切なビルドパターン、そして人間またはAIエージェント向けのRome固有の操作（資金供給、デプロイ、検証）。

`rome` ビルダー — 人間でも AI エージェントでも — を、Rome 上での構築ライフサイクル全体にわたって導きます: 根拠づけられたチェーン情報、適切なパターン、コントラクト呼び出し、資金投入のオンランプ、デプロイ/送信、クロス VM 診断、そして両レーン対応の動作ゲート。1つの能力コア、2つの整合した表面 — CLI (`rome <command>`) と  [MCP](https://modelcontextprotocol.io) サーバー (`rome mcp`) — これにより、エージェントと人間が同じメンタルモデルを共有します。

## インストール

リポジトリ優先（npm 公開は保留中）:

```bash
# 1回限り、インストール不要:
npx github:rome-protocol/rome-cli#v0.11.0 facts chain hadrian

# 永続的なインストール — clone + link:
git clone --branch v0.11.0 https://github.com/rome-protocol/rome-cli
cd rome-cli && npm install && npm install -g .
```

通常の `npm install -g github:rome-protocol/rome-cli` は **ではなく** 現在は動作しません — npm は、そのパッケージの git 依存関係を、それぞれ独自の node\_modules を持たないまま準備します（[rome-cli#25](https://github.com/rome-protocol/rome-cli/issues/25)）。上で示したように npx の1回限り版か clone + link を使い、タグを固定してください: npx は最初に取得したコピーを保持するため、タグ未固定の `npx github:rome-protocol/rome-cli` は古いバージョンを実行し続ける可能性がありますが、タグを固定すると常にそのバージョンが取得されます。

## 1つのコアに対する2つのレイヤー

**読み取り — grounding + 診断。** 鍵は不要。CLI と MCP サーバーの両方で。

| コマンド                                                     | 返す内容                                                                                         |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `rome facts chain·tokens·contracts·gas·balance·programs` | レジストリ + RPC からのライブなチェーン情報 — ID、アドレス、セレクタの幻覚はなし                                               |
| `rome cookbook patterns·cpi-recipe·errors`               | どのサンプルが目的に合うか · エージェントが誤りがちな CPI のアカウントルール · Rome の失敗を原因 + 修正にデコード                           |
| `rome call <chain> <addr> <sig> [args]`                  | コントラクトを読み取る（`eth_call`） — 複数値の引数は1つの引数内でカンマ区切り: `"0xOwner…,0xSpender…"`                      |
| `rome doctor <chain>`                                    | 事前確認 — チェーンは稼働中？ RPC に到達可能？ プログラムは設定済み？ ウォレットは資金あり？                                          |
| `rome tx <chain> <hash>`                                 | トランザクションを診断 — EVM の receipt + Solana の決済トランザクション + Via リンク（Rome には `debug_traceTransaction`) |
| `rome preset foundry\|hardhat <chain>`                   | ツールチェーン + その癖に合わせた、すぐ使える Rome ネットワーク設定                                                       |

**アクション — オンチェーンで署名します。** CLI 専用、鍵は環境変数から、 **決して** MCP 上では行いません。

| コマンド                                                                       | 何をするか                                                                                                                                                                                                  |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `rome deploy <chain> <artifact>`                                           | コンパイル済みコントラクトをデプロイし、Rome 特有のガスの癖を処理します                                                                                                                                                                 |
| `rome send <chain> <addr> <sig>`                                           | 正しい Rome の書き込み経路を通じてコントラクトに書き込みます                                                                                                                                                                      |
| `rome fund <chain> --from <src> --amount <usdc>`                           | USDC → Rome ガス（CCTP）をブリッジ — 「home から」のオンランプ                                                                                                                                                            |
| `rome bridge <chain> --from <src> --amount <usdc> [--intent gas\|wrapper]` | USDC をブリッジ **で** してガスまたは wUSDC にする                                                                                                                                                                     |
| `rome bridge <chain> --to <dest> --amount <usdc>`                          | wUSDC をブリッジ **で出す** — Rome 上でバーンし、受け取りは移動先で行います（Rome は inbound をスポンサーし、outbound の請求はしません）                                                                                                              |
| `rome activate <chain>`                                                    | 最初のブリッジアウトの前に1回限りの PDA 資金提供が必要 **最初のブリッジアウト** （inbound は摩擦なし — 何も不要）                                                                                                                                   |
| `rome verify <chain> [--path …]`                                           | パス対応の **動作ゲート**、入口ごとに1つ: `solidity` — 同じコントラクトが EVM レーンで応答します *および* Solana レーン · `solana-program` — EVM レーンの呼び出しが CPI 経由であなたの Solana プログラムを駆動します · `ホームチェーン発` — ブリッジで入る → Rome 上で動かす → ブリッジで出る、往復が証明済み |

## AI エージェントに組み込む（MCP）

何も実行したりホストしたりする必要はありません — あなたの MCP クライアントが `rome mcp` （stdio サーバー）を必要に応じて起動します。1回登録するだけです:

```json
{ "mcpServers": { "rome": { "command": "npx", "args": ["-y", "github:rome-protocol/rome-cli#v0.11.0", "mcp"] } } }
```

（clone + link インストールの場合、 `{ "command": "rome", "args": ["mcp"] }` でも動作します — npx 形式は事前インストール不要なだけです。）

その後、エージェントは次のようなツールを呼び出します `facts_chain`, `cookbook_cpi_recipe`, `doctor`, `tx`、そして `preset` — ライブのレジストリ + RPC に基づいているため、アドレスやセレクタの推測をやめます。MCP の表面は **読み取り専用で、鍵を保持しません** — どのエージェントにも安全に接続でき、署名や送金を行うことは決してありません。署名アクションは CLI 側に残り、鍵は環境変数経由で渡します。

## エージェントの grounding ループ

1. `rome cookbook patterns <作っているもの>` → どのサンプルリポジトリ + アーキテクチャか
2. `rome facts chain <chain>` → RPC、program id、ガストークン（ハードコードなし）
3. …その正確な値を使ってコードを書く…
4. `rome verify <chain> --path <your way in>` → どの経路で来ても、動作することを証明

## 詳細を見る

* リポジトリ + 完全ガイド: [`rome-protocol/rome-cli`](https://github.com/rome-protocol/rome-cli)
* [エコシステムとリポジトリ](/ja/hajimeni/ecosystem.md) · [デュアルレーンアプリを構築する](/ja/gaido/dual-lane-app.md) · [ホームチェーンから: 別のチェーンから Rome に到達する](/ja/gaido/from-home.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/ja/zhi-pin/rome-cli.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
