تثبيت CLI واستخدامه
يتيح لك AgentGIF CLI رفع وتسجيل والبحث وإدارة تسجيلات الطرفية من طرفيتك. متاح بـ 5 لغات — اختر اللغة التي تناسب بيئتك.
التثبيت
يُنشر CLI في جميع سجلات الحزم الرئيسية. كل تطبيق يوفر نفس الأوامر الأساسية.
| اللغة | أمر التثبيت | السجل |
|---|---|---|
| Python | pip install agentgif | PyPI |
| Node.js | npm install -g @agentgif/cli | npm |
| Go | go install github.com/agentgif/cli@latest | pkg.go.dev |
| Rust | cargo install agentgif | crates.io |
| Ruby | gem install agentgif | RubyGems |
التحقق من التثبيت:
agentgif --version
agentgif --help
المصادقة
قبل رفع أو إدارة التسجيلات، صادِق مع حساب GitHub الخاص بك:
agentgif login
يفتح هذا متصفحك لـ GitHub OAuth. بعد التفويض، يخزن CLI مفتاح API محلياً في ~/.config/agentgif/config.json.
بدلاً من ذلك، اضبط مفتاح API مباشرةً:
agentgif login --api-key YOUR_API_KEY
Get your API key from Settings → API Key.
تحقق من حالة المصادقة:
agentgif whoami
# → @yourname (authenticated)
رفع
ارفع تسجيلاً مع بيانات وصفية:
agentgif upload demo.gif \
--title "Docker Compose Up" \
--command "docker compose up -d" \
--tags docker,compose,containers \
--description "Starting services with Docker Compose"
خيارات الرفع
| الراية | الوصف |
|---|---|
--title | عنوان التسجيل (مطلوب) |
--command | الأمر الموضَّح |
--tags | وسوم مفصولة بفواصل |
--description | نص الوصف |
--cast | مسار ملف cast من asciinema v2 |
--shell | الشل المستخدم (bash، zsh، fish) |
--visibility | public (الافتراضي) أو unlisted |
--open | فتح صفحة التسجيل في المتصفح بعد الرفع |
الرفع مع ملف Cast
إرفاق ملف cast يُفعّل الطبقة القابلة للقراءة آلياً لوكلاء الذكاء الاصطناعي:
agentgif upload demo.gif --cast demo.cast --title "Git Rebase" --tags git
التسجيل باستخدام VHS
The Python CLI can record terminal sessions directly using VHS (must be installed separately).
# Record from a VHS tape file
agentgif record demo.tape --theme dracula
# Record and immediately upload
agentgif record demo.tape --upload --title "My Demo" --tags demo
خيارات التسجيل
| الراية | الوصف |
|---|---|
--theme | Terminal theme (see themes) |
--output | مسار ملف المخرجات (الافتراضي: نفس اسم الـ tape بامتداد .gif) |
--upload | الرفع فوراً بعد التسجيل |
--title | العنوان للرفع التلقائي |
--tags | الوسوم للرفع التلقائي |
VHS must be installed separately: brew install vhs (macOS) or see the recording guide.
البحث
البحث في جميع التسجيلات العامة:
agentgif search "docker compose"
تُظهر المخرجات معرف التسجيل والعنوان والأمر وعدد المشاهدات في جدول منسّق.
مرشحات البحث
# Filter by tag
agentgif search "build" --tag docker
# Filter by shell
agentgif search "alias" --shell zsh
# Sort by views instead of relevance
agentgif search "git" --sort views
إدارة التسجيلات
قائمة تسجيلاتك
agentgif list
agentgif list --limit 50
عرض تفاصيل التسجيل
agentgif info xK9mQ2pL
تعديل تسجيل
agentgif edit xK9mQ2pL --title "New Title" --tags git,rebase
حذف تسجيل
agentgif delete xK9mQ2pL
# → Are you sure? (y/N)
الإعداد
يخزن CLI الإعداد في ~/.config/agentgif/config.json:
{
"api_key": "ag_xxxxxxxxxxxx",
"api_url": "https://agentgif.com/api/v1",
"default_theme": "catppuccin-mocha",
"default_shell": "zsh",
"auto_open": false
}
متغيرات البيئة
تتجاوز متغيرات البيئة إعدادات ملف الإعداد:
| المتغير | الوصف |
|---|---|
AGENTGIF_API_KEY | مفتاح API (يتجاوز الإعداد) |
AGENTGIF_API_URL | الرابط الأساسي لـ API |
AGENTGIF_THEME | ثيم VHS الافتراضي |
مفيد في خطوط CI/CD:
AGENTGIF_API_KEY=${{ secrets.AGENTGIF_KEY }} agentgif upload dist/demo.gif --title "CI Build"