> 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エージェント）を、build-on-Rome のライフサイクル全体へ導きます: 実データに基づくチェーン情報、適切なパターン、コントラクト呼び出し、資金の導入口、deploy/send、クロスVM診断、そして両レーンの動作ゲート。1つの機能コア、2つの揃った表面 —— CLI（`rome <command>`) と [MCP](https://modelcontextprotocol.io) サーバー（`rome mcp`）—— これにより、エージェントと人間が同じメンタルモデルを共有できます。

## インストール

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

```bash
# 単発実行、インストール不要:
npx github:rome-protocol/rome-cli#v0.12.0 facts chain hadrian

# 永続的なインストール — clone + link:
git clone --branch v0.12.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 の単発実行または 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 レシート + 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）— 「ホームから」のオンランプ                                                                                                                                                                            |
| `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>`                                                    | 任意の PDA への資金供給。ブリッジで外へ出す場合は不要です。ブリッジコントラクト（RomeBridgeWithdraw v12 以降）がメッセージの rent を支払い、ガスに請求するためです                                                                                                                   |
| `rome verify <chain> [--path …]`                                           | その **パス認識型の works-gate**、入口経路ごとに1つ: `solidity` — 同じコントラクトが EVM レーンで応答します *および* Solana レーン · `solana-program` — EVM レーンからの呼び出しが CPI 経由であなたの Solana プログラムを駆動します · `from-home` — ブリッジイン → Rome 上で処理 → ブリッジアウト、往復が証明されます |

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

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

```json
{ "mcpServers": { "rome": { "command": "npx", "args": ["-y", "github:rome-protocol/rome-cli#v0.12.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 <what I'm building>` → どのサンプルリポジトリ + アーキテクチャか
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)
* [エコシステム & リポジトリ](https://docs.rome.builders/ja/hajimeni-1/ecosystem.md) ・ [デュアルレーンアプリを作る](https://docs.rome.builders/ja/gaido/dual-lane-app.md) ・ [ホームから: 別のチェーンから Rome に到達する](https://docs.rome.builders/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.
