mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-07 16:09:30 +00:00
feat: adopt directory-based docs versioning with Edge channel
Switch docs.crewai.com from navigation-only versioning (every version selector entry rendered the same docs/<lang>/* source files) to Mintlify's directory-based versioning so each version selector entry renders its own snapshot. Add an "Edge" channel under docs/edge/<lang>/* that always reflects main HEAD for unreleased work, eliminating pre-release leakage onto frozen release labels. External links to canonical /<lang>/* URLs are preserved via wildcard redirects that always land on the current default version. Layout: - docs/edge/<lang>/* rolling source (you edit here) - docs/edge/enterprise-api.*.yaml - docs/v<X.Y.Z>/<lang>/* frozen, immutable snapshots - docs/v<X.Y.Z>/enterprise-api.*.yaml - docs/images/ shared, append-only - docs/docs.json nav + redirects URLs follow the Mintlify-idiomatic shape: /edge/<lang>/<page> for Edge, /v<X.Y.Z>/<lang>/<page> for every frozen snapshot. The wildcard redirects /<lang>/:slug* -> /<default>/<lang>/:slug* keep stale links working, and every freeze rewrites them (plus all per-section/per-page redirects) so destinations always resolve to the current default without depending on a second redirect hop. Release flow integration (devtools release): - New module crewai_devtools.docs_versioning.freeze() materialises docs/v<X.Y.Z>/ from docs/edge/, rewrites openapi: refs inside the snapshot, inserts the version into every language block in docs.json, and refreshes all redirect destinations. - _update_docs_and_create_pr() in cli.py now calls that freeze during Phase 2 of devtools release. Edge changelogs are updated first (so the snapshot freeze picks them up), then the snapshot is staged alongside docs.json, branched as docs/freeze-v<X.Y.Z>, and the PR is titled [docs-freeze] docs: snapshot and changelog for v<X.Y.Z> — the title prefix the new CI guard reads. - The PR still gates tag, GitHub release, PyPI publish, and the enterprise release as before; no new PRs are added. - Pre-releases (1.X.YaN, 1.X.YbN, ...) skip the snapshot — they ride Edge — and the docs PR title omits the [docs-freeze] prefix. - docs_check (AI-generated docs scaffolding) writes to docs/edge/<lang>/* so newly-generated unreleased docs land in Edge and never accidentally touch a frozen snapshot. Migration scripts (one-shot): - scripts/docs/freeze_historical_versions.py reconstructs all 16 historical snapshots (v1.10.0 .. v1.14.7) from git tags via git archive | tar, rewriting openapi: MDX refs so each snapshot reads its own enterprise-api YAML rather than the live one. - scripts/docs/prefix_version_paths.py one-shot-migrates docs.json: rewrites every page path in 16 versioned blocks to point under docs/v<X.Y.Z>/, inserts a new Edge entry per language, tags v1.14.7 as Latest (default), prunes pages whose target file doesn't exist in the snapshot (e.g. docs/ar/ didn't exist before v1.12.0), and writes the wildcard + per-section redirects. - scripts/docs/freeze_current_edge.py is now a thin CLI wrapper around docs_versioning.freeze for manual one-off freezes (e.g. retroactively snapshotting a forgotten release). CI guards (.github/workflows/docs-snapshots.yml): - Frozen snapshots under docs/v[0-9]*/ are immutable; only PRs whose title contains [docs-freeze] (i.e. release-cut PRs generated by devtools release or the manual wrapper) may modify them. - Images under docs/images/ are append-only since snapshots share a single image directory. Deleting or renaming an image breaks every historical snapshot that still references it. Restored docs/images/crewai-otel-export.png from PR #3673; it was deleted in PR #4908 but v1.10.0 / v1.10.1 snapshots still reference it. Restoring instead of editing the snapshots preserves historical rendering fidelity and validates the new append-only rule retroactively. Tests: - lib/devtools/tests/test_docs_versioning.py covers the freeze: file copy, openapi rewrite, version insertion, default demotion, redirect upserts, per-section redirect rewriting, idempotency, and invalid inputs. Verified locally with mintlify broken-links: 0 broken links across the full site (Edge + 16 frozen versions, 4 locales). AGENTS.md (repo root) is the contributor guide for the new model; RELEASING.md is the release-cut runbook; README's Contribution section links to both. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
302
docs/edge/ar/concepts/cli.mdx
Normal file
302
docs/edge/ar/concepts/cli.mdx
Normal file
@@ -0,0 +1,302 @@
|
||||
---
|
||||
title: واجهة سطر الأوامر
|
||||
description: تعرّف على كيفية استخدام واجهة سطر أوامر CrewAI للتفاعل مع CrewAI.
|
||||
icon: terminal
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Warning>
|
||||
منذ الإصدار 0.140.0، بدأ CrewAI AMP عملية نقل مزود تسجيل الدخول.
|
||||
لذلك، تم تحديث تدفق المصادقة عبر CLI. المستخدمون الذين يسجلون الدخول
|
||||
باستخدام Google، أو الذين أنشأوا حساباتهم بعد 3 يوليو 2025 لن يتمكنوا
|
||||
من تسجيل الدخول مع الإصدارات القديمة من مكتبة `crewai`.
|
||||
</Warning>
|
||||
|
||||
## نظرة عامة
|
||||
|
||||
توفر واجهة سطر أوامر CrewAI مجموعة من الأوامر للتفاعل مع CrewAI، مما يتيح لك إنشاء وتدريب وتشغيل وإدارة الأطقم والتدفقات.
|
||||
|
||||
## التثبيت
|
||||
|
||||
لاستخدام واجهة سطر أوامر CrewAI، تأكد من تثبيت CrewAI:
|
||||
|
||||
```shell Terminal
|
||||
pip install crewai
|
||||
```
|
||||
|
||||
## الاستخدام الأساسي
|
||||
|
||||
الهيكل الأساسي لأمر CrewAI CLI هو:
|
||||
|
||||
```shell Terminal
|
||||
crewai [COMMAND] [OPTIONS] [ARGUMENTS]
|
||||
```
|
||||
|
||||
## الأوامر المتاحة
|
||||
|
||||
### 1. إنشاء
|
||||
|
||||
إنشاء طاقم أو تدفق جديد.
|
||||
|
||||
```shell Terminal
|
||||
crewai create [OPTIONS] TYPE NAME
|
||||
```
|
||||
|
||||
- `TYPE`: اختر بين "crew" أو "flow"
|
||||
- `NAME`: اسم الطاقم أو التدفق
|
||||
|
||||
مثال:
|
||||
|
||||
```shell Terminal
|
||||
crewai create crew my_new_crew
|
||||
crewai create flow my_new_flow
|
||||
```
|
||||
|
||||
افتراضيًا، ينشئ `crewai create crew` مشروعًا JSON-first يحتوي على `crew.jsonc` و `agents/*.jsonc`. استخدم `crewai create crew my_new_crew --classic` فقط إذا أردت البنية القديمة Python/YAML مع `crew.py` و `config/agents.yaml` و `config/tasks.yaml`.
|
||||
|
||||
### 2. الإصدار
|
||||
|
||||
عرض الإصدار المثبت من CrewAI.
|
||||
|
||||
```shell Terminal
|
||||
crewai version [OPTIONS]
|
||||
```
|
||||
|
||||
- `--tools`: (اختياري) عرض الإصدار المثبت من أدوات CrewAI
|
||||
|
||||
### 3. التدريب
|
||||
|
||||
تدريب الطاقم لعدد محدد من التكرارات.
|
||||
|
||||
```shell Terminal
|
||||
crewai train [OPTIONS]
|
||||
```
|
||||
|
||||
- `-n, --n_iterations INTEGER`: عدد تكرارات التدريب (افتراضي: 5)
|
||||
- `-f, --filename TEXT`: مسار ملف مخصص للتدريب (افتراضي: "trained_agents_data.pkl")
|
||||
|
||||
### 4. الإعادة
|
||||
|
||||
إعادة تنفيذ الطاقم من مهمة محددة.
|
||||
|
||||
```shell Terminal
|
||||
crewai replay [OPTIONS]
|
||||
```
|
||||
|
||||
- `-t, --task_id TEXT`: إعادة تنفيذ الطاقم من معرّف المهمة هذا، بما في ذلك جميع المهام اللاحقة
|
||||
|
||||
### 5. سجل مخرجات المهام
|
||||
|
||||
استرجاع أحدث مخرجات مهام crew.kickoff().
|
||||
|
||||
```shell Terminal
|
||||
crewai log-tasks-outputs
|
||||
```
|
||||
|
||||
### 6. إعادة تعيين الذاكرة
|
||||
|
||||
إعادة تعيين ذاكرة الطاقم (طويلة، قصيرة، الكيانات، أحدث مخرجات التشغيل).
|
||||
|
||||
```shell Terminal
|
||||
crewai reset-memories [OPTIONS]
|
||||
```
|
||||
|
||||
- `-l, --long`: إعادة تعيين الذاكرة طويلة المدى
|
||||
- `-s, --short`: إعادة تعيين الذاكرة قصيرة المدى
|
||||
- `-e, --entities`: إعادة تعيين ذاكرة الكيانات
|
||||
- `-k, --kickoff-outputs`: إعادة تعيين أحدث مخرجات التشغيل
|
||||
- `-kn, --knowledge`: إعادة تعيين تخزين المعرفة
|
||||
- `-akn, --agent-knowledge`: إعادة تعيين تخزين معرفة الوكيل
|
||||
- `-a, --all`: إعادة تعيين جميع الذاكرات
|
||||
|
||||
### 7. الاختبار
|
||||
|
||||
اختبار الطاقم وتقييم النتائج.
|
||||
|
||||
```shell Terminal
|
||||
crewai test [OPTIONS]
|
||||
```
|
||||
|
||||
- `-n, --n_iterations INTEGER`: عدد تكرارات الاختبار (افتراضي: 3)
|
||||
- `-m, --model TEXT`: نموذج LLM لتشغيل الاختبارات (افتراضي: "gpt-4o-mini")
|
||||
|
||||
### 8. التشغيل
|
||||
|
||||
تشغيل الطاقم أو التدفق.
|
||||
|
||||
```shell Terminal
|
||||
crewai run
|
||||
```
|
||||
|
||||
<Note>
|
||||
بدءًا من الإصدار 0.103.0، يمكن استخدام أمر `crewai run` لتشغيل
|
||||
كل من الأطقم القياسية والتدفقات. للتدفقات، يكتشف تلقائيًا النوع
|
||||
من pyproject.toml ويشغّل الأمر المناسب. هذه هي الطريقة الموصى بها
|
||||
لتشغيل كل من الأطقم والتدفقات.
|
||||
</Note>
|
||||
|
||||
### 9. الدردشة
|
||||
|
||||
بدءًا من الإصدار `0.98.0`، عند تشغيل أمر `crewai chat`، تبدأ جلسة تفاعلية مع طاقمك. سيرشدك المساعد الذكي بطلب المدخلات اللازمة لتنفيذ الطاقم. بمجرد توفير جميع المدخلات، سينفذ الطاقم مهامه.
|
||||
|
||||
```shell Terminal
|
||||
crewai chat
|
||||
```
|
||||
|
||||
<Note>
|
||||
مهم: عيّن خاصية `chat_llm` في تعريف الـ crew لتفعيل هذا الأمر.
|
||||
|
||||
للـ crews بنمط JSON-first، أضفها إلى `crew.jsonc`:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"name": "My Crew",
|
||||
"agents": ["researcher"],
|
||||
"tasks": [],
|
||||
"chat_llm": "openai/gpt-4o"
|
||||
}
|
||||
```
|
||||
|
||||
للـ crews الكلاسيكية Python/YAML، عيّنها في `crew.py`:
|
||||
|
||||
```python
|
||||
@crew
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=self.agents,
|
||||
tasks=self.tasks,
|
||||
process=Process.sequential,
|
||||
verbose=True,
|
||||
chat_llm="gpt-4o",
|
||||
)
|
||||
```
|
||||
</Note>
|
||||
|
||||
### 10. النشر
|
||||
|
||||
نشر الطاقم أو التدفق إلى [CrewAI AMP](https://app.crewai.com).
|
||||
|
||||
- **المصادقة**: تحتاج لتكون مصادقًا للنشر إلى CrewAI AMP.
|
||||
|
||||
```shell Terminal
|
||||
crewai login
|
||||
```
|
||||
|
||||
- **إنشاء نشر**:
|
||||
```shell Terminal
|
||||
crewai deploy create
|
||||
```
|
||||
|
||||
- **نشر الطاقم**:
|
||||
```shell Terminal
|
||||
crewai deploy push
|
||||
```
|
||||
|
||||
- **حالة النشر**:
|
||||
```shell Terminal
|
||||
crewai deploy status
|
||||
```
|
||||
|
||||
- **سجلات النشر**:
|
||||
```shell Terminal
|
||||
crewai deploy logs
|
||||
```
|
||||
|
||||
- **عرض النشرات**:
|
||||
```shell Terminal
|
||||
crewai deploy list
|
||||
```
|
||||
|
||||
- **حذف النشر**:
|
||||
```shell Terminal
|
||||
crewai deploy remove
|
||||
```
|
||||
|
||||
### 11. إدارة المؤسسة
|
||||
|
||||
إدارة مؤسسات CrewAI AMP.
|
||||
|
||||
```shell Terminal
|
||||
crewai org [COMMAND] [OPTIONS]
|
||||
```
|
||||
|
||||
- `list`: عرض جميع المؤسسات
|
||||
- `current`: عرض المؤسسة النشطة حاليًا
|
||||
- `switch`: التبديل إلى مؤسسة محددة
|
||||
|
||||
### 12. تسجيل الدخول
|
||||
|
||||
المصادقة مع CrewAI AMP باستخدام تدفق رمز الجهاز الآمن.
|
||||
|
||||
```shell Terminal
|
||||
crewai login
|
||||
```
|
||||
|
||||
### 13. إدارة التهيئة
|
||||
|
||||
إدارة إعدادات تهيئة CLI لـ CrewAI.
|
||||
|
||||
```shell Terminal
|
||||
crewai config [COMMAND] [OPTIONS]
|
||||
```
|
||||
|
||||
- `list`: عرض جميع معاملات التهيئة
|
||||
- `set`: تعيين معامل تهيئة
|
||||
- `reset`: إعادة تعيين جميع المعاملات إلى القيم الافتراضية
|
||||
|
||||
### 14. إدارة التتبع
|
||||
|
||||
إدارة تفضيلات جمع التتبع لعمليات الطاقم والتدفق.
|
||||
|
||||
```shell Terminal
|
||||
crewai traces [COMMAND]
|
||||
```
|
||||
|
||||
- `enable`: تفعيل جمع التتبع
|
||||
- `disable`: تعطيل جمع التتبع
|
||||
- `status`: عرض حالة جمع التتبع الحالية
|
||||
|
||||
#### كيف يعمل التتبع
|
||||
|
||||
يتم التحكم في جمع التتبع بفحص ثلاثة إعدادات بترتيب الأولوية:
|
||||
|
||||
1. **علامة صريحة في الكود** (الأولوية الأعلى):
|
||||
```python
|
||||
crew = Crew(agents=[...], tasks=[...], tracing=True) # تفعيل دائمًا
|
||||
crew = Crew(agents=[...], tasks=[...], tracing=False) # تعطيل دائمًا
|
||||
crew = Crew(agents=[...], tasks=[...]) # فحص الأولويات الأدنى
|
||||
```
|
||||
|
||||
2. **متغير البيئة** (الأولوية الثانية):
|
||||
```env
|
||||
CREWAI_TRACING_ENABLED=true
|
||||
```
|
||||
|
||||
3. **تفضيل المستخدم** (الأولوية الأدنى):
|
||||
```shell Terminal
|
||||
crewai traces enable
|
||||
```
|
||||
|
||||
<Note>
|
||||
**لتفعيل التتبع**، استخدم أيًا من هذه الطرق:
|
||||
- عيّن `tracing=True` في كود الطاقم/التدفق، أو
|
||||
- أضف `CREWAI_TRACING_ENABLED=true` إلى ملف `.env`، أو
|
||||
- شغّل `crewai traces enable`
|
||||
|
||||
**لتعطيل التتبع**، استخدم أيًا من هذه الطرق:
|
||||
- عيّن `tracing=False` في كود الطاقم/التدفق، أو
|
||||
- أزل أو عيّن `false` لمتغير `CREWAI_TRACING_ENABLED`، أو
|
||||
- شغّل `crewai traces disable`
|
||||
</Note>
|
||||
|
||||
<Tip>
|
||||
يتعامل CrewAI CLI مع المصادقة لمستودع الأدوات تلقائيًا عند
|
||||
إضافة حزم إلى مشروعك. فقط أضف `crewai` قبل أي أمر `uv`
|
||||
لاستخدامه. مثلًا `crewai uv add requests`.
|
||||
</Tip>
|
||||
|
||||
<Note>
|
||||
تُخزن إعدادات التهيئة في `~/.config/crewai/settings.json`. بعض
|
||||
الإعدادات مثل اسم المؤسسة ومعرّفها للقراءة فقط وتُدار من خلال
|
||||
أوامر المصادقة والمؤسسة.
|
||||
</Note>
|
||||
Reference in New Issue
Block a user