> 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/ar/almntjat/rome-cli.md).

# Rome CLI + MCP

واجهة سطر أوامر المطوّر في Rome وخادم MCP — حقائق سلسلة موثّقة، ونمط البناء المناسب، والإجراءات الفريدة لـ Rome (تمويل، نشر، تحقق) لمستخدم بشري أو وكيل ذكاء اصطناعي.

`rome` يوفّر للبنّاء — إنسانًا كان أو وكيلَ ذكاءٍ اصطناعي — كامل دورة البناء على Rome: حقائق السلسلة المؤسَّسة، النمط المناسب، استدعاءات العقود، مسار التمويل الصاعد، النشر/الإرسال، التشخيص عبر الآلات الافتراضية، وبوابة تحقق تعمل على كلا المسارين. نواة قدرات واحدة، وواجهتان متناسقتان — سطر أوامر (`rome <command>`) و [MCP](https://modelcontextprotocol.io) خادم (`rome mcp`) — بحيث يتشارك الوكيل والإنسان نموذجًا ذهنيًا واحدًا.

## التثبيت

أولًا المستودع (النشر على npm قيد الانتظار):

```bash
# تشغيل لمرة واحدة، بلا تثبيت:
npx github:rome-protocol/rome-cli#v0.12.0 facts chain hadrian

# تثبيت دائم — استنساخ + ربط:
git clone --branch v0.12.0 https://github.com/rome-protocol/rome-cli
cd rome-cli && npm install && npm install -g .
```

أمر npm عادي `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 لمرة واحدة أو الاستنساخ + الربط، وثبّت وسمًا كما أعلاه: يحتفظ npx بالنسخة التي جلبها أولًا، لذا فإن نسخة غير مثبّتة من `npx github:rome-protocol/rome-cli` يمكن أن تظل تعمل بإصدار قديم، بينما يجلب الوسم المثبّت ذلك الإصدار دائمًا.

## طبقتان فوق نواة واحدة

**القراءات — التأصيل + التشخيص.** من دون مفاتيح؛ على كلٍّ من سطر الأوامر وخادم MCP.

| الأمر                                                    | ما الذي يعيده                                                                                              |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `rome facts chain·tokens·contracts·gas·balance·programs` | حقائق حية عن السلسلة من السجل + RPC — من دون معرّفات أو عناوين أو محددات مُختلَقة                          |
| `rome cookbook patterns·cpi-recipe·errors`               | أي مثال يناسب هدفك · قواعد حسابات CPI التي يخطئ فيها الوكلاء · فكّ شيفرة فشل Rome → السبب + الإصلاح        |
| `rome call <chain> <addr> <sig> [args]`                  | اقرأ عقدًا (`eth_call`) — الوسائط متعددة القيم تُكتب مفصولة بفواصل في وسيطة واحدة: `"0xOwner…,0xSpender…"` |
| `rome doctor <chain>`                                    | فحص تمهيدي — هل السلسلة حيّة؟ هل يمكن الوصول إلى RPC؟ هل البرنامج مُهيَّأ؟ هل المحفظة ممولة؟               |
| `rome tx <chain> <hash>`                                 | شخّص معاملة — إيصال EVM + معاملات التسوية على Solana + رابط Via (ليس لدى Rome `debug_traceTransaction`)    |
| `rome preset foundry\|hardhat <chain>`                   | إعداد شبكة Rome جاهز لسلسلة أدواتك + الخصائص الخاصة                                                        |

**الإجراءات — التوقيع على السلسلة.** على سطر الأوامر فقط، والمفتاح من البيئة، **مطلقًا** على 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 يدعم التدفق الوارد، لا المطالبة الصادرة)                                                                                                                                                                                            |
| `rome activate <chain>`                                                    | تمويل PDA اختياري؛ والجسر إلى الخارج لا يحتاجه، لأن عقد الجسر (RomeBridgeWithdraw v12 وما بعده) يدفع إيجار الرسالة ويحتسبه ضمن الغاز                                                                                                                                                                      |
| `rome verify <chain> [--path …]`                                           | الـ **بوابة التحقق الواعية بالمسار**، واحدة لكل طريق دخول: `solidity` — يجيب العقد نفسه على مسار EVM *و* مسار Solana · `solana-program` — استدعاء على مسار EVM يشغّل برنامج Solana لديك عبر CPI · `من السلسلة الأصلية` — اجسر إلى الداخل → نفّذ على Rome → اجسر إلى الخارج، وقد ثبُتت رحلة الذهاب والإياب |

## اربطه بوكيل ذكاء اصطناعي (MCP)

أنت لا تشغّل أو تستضيف أي شيء — عميل MCP الخاص بك يُشغِّل `rome mcp` (خادم stdio) عند الطلب. سجّله مرة واحدة:

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

(مع تثبيت الاستنساخ + الربط، `{ "command": "rome", "args": ["mcp"] }` يعمل أيضًا — صيغة npx لا تحتاج إلى أي تثبيت مسبق.)

ثم يستدعي الوكيل أدوات مثل `facts_chain`, `cookbook_cpi_recipe`, `doctor`, `tx`، و `preset` — مؤسَّسًا على السجل الحي + RPC، فيتوقف عن التخمين بشأن العناوين والمحددات. واجهة MCP هي **للقراءة فقط ولا تحتوي على مفاتيح** — آمنة للربط بأي وكيل؛ إذ لا يمكنها أبدًا التوقيع أو نقل الأموال. وتبقى إجراءات التوقيع على سطر الأوامر، مع تزويد المفتاح عبر البيئة.

## حلقة تأصيل الوكيل

1. `rome cookbook patterns <ما أبنيه>` → أي مستودع مثال + أي بنية
2. `rome facts chain <chain>` → RPC، معرّف البرنامج، رمز الغاز (من دون ترميز ثابت)
3. …اكتب الشفرة وفق تلك القيم بالضبط…
4. `rome verify <chain> --path <your way in>` → أثبت أنه يعمل، أيًّا كان المسار الذي دخلت منه

## تعرّف المزيد

* المستودع + الأدلة الكاملة: [`rome-protocol/rome-cli`](https://github.com/rome-protocol/rome-cli)
* [المنظومة والمستودعات](https://docs.rome.builders/ar/albda-1/ecosystem.md) · [أنشئ تطبيقًا ثنائي المسار](https://docs.rome.builders/ar/adlh-almtw-ryn/dual-lane-app.md) · [من المنزل: الوصول إلى Rome من سلسلة أخرى](https://docs.rome.builders/ar/adlh-almtw-ryn/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/ar/almntjat/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.
