انتقل إلى المحتوى

التطبيقات

Cosvexa CLI

وكيل البرمجة في الطرفية: التثبيت، وتسجيل الدخول، والأوامر، وأوضاع الموافقة، ومراجعة Council، والاستخدام في CI.

التثبيت وتسجيل الدخول

يتطلب Node.js 20 أو أحدث.

bash
npm i -g https://cosvexa.ai/downloads/cosvexa-cli-0.1.0.tgz
cosvexa --version

cosvexa login --browser   # device code, approve in your browser
cosvexa login             # or paste an API key that starts with cvx_
cosvexa status

توجد الإعدادات في %APPDATA%\cosvexa\config.json على Windows و~/.config/cosvexa/config.json على macOS وLinux. ومتغيرات البيئة COSVEXA_API_KEY وCOSVEXA_MODEL وCOSVEXA_BASE_URL مدعومة أيضًا.

الاستخدام الأساسي

bash
cd my-project
cosvexa "make the failing date test pass"   # one task
cosvexa                                      # interactive session
cosvexa -c "now add tests"                   # continue the last session
cosvexa sessions                             # list sessions
cosvexa init                                 # draft COSVEXA.md project instructions
cosvexa models                               # models you can use

النموذج والجهد

  • يختار -m claude-sonnet-5-5 نموذجًا محددًا وتكون له الأولوية دائمًا.
  • يحدد --effort low|medium|high (أو /effort) مقدار تفكير النموذج المحدد قبل أن يجيب؛ ولا يغيّر النموذج أبدًا. والنماذج التي ليس لها إعداد لمستوى التفكير تتجاهله.

الأمان

  • يحدد --mode ask|auto-edit|plan|full-auto وضع الموافقة (Shift+Tab في الجلسة التفاعلية). ويحتاج full-auto أيضًا إلى --yolo.
  • يسمح --read-only بأدوات القراءة والسرد والبحث فقط.
  • يستعيد /undo الملف الذي غيّره الوكيل آخر مرة. والأوامر الخطرة تطلب الموافقة في كل وضع، وكذلك مع --yes.

مراجعة الكود وCouncil

bash
cosvexa review                  # review local changes
cosvexa review --base main      # review the diff against main
cosvexa "add input validation" --council
cosvexa --team "refactor the payments module"

تعرض مهام Council والفريق تقديرًا للحد الأعلى للتكلفة أولًا وتطلب تأكيدك.

السكربتات وCI

bash
cosvexa -p "summarise the open TODOs"
cosvexa -p --yes "fix the lint errors" --json

رموز الخروج: 0 تم، و1 خطأ، و2 استخدام خاطئ، و3 توقف عند حد الخطوات أو المخرجات.

الأوامر التفاعلية

/model، /mode، /undo، /compact، /context، /init، /review، /team، /cost، /clear، /exit. أضف أوامرك الخاصة كملفات .cosvexa/commands/<name>.md؛ ويُرفق @path ملفًا. ويُلخَّص السياق تلقائيًا عند امتلائه بنسبة 80%.

MCP وOpenCode

يدير cosvexa mcp خوادم MCP (ويعطّلها --no-mcp). ويهيّئ cosvexa opencode أداة OpenCode مع Cosvexa مزوّدًا (شغّل npm i -g opencode-ai أولًا).