CLI commands
واجهة CLI للاستدلال
openclaw infer هو السطح القياسي عديم الواجهة لسير عمل الاستدلال المدعوم بالمزودين.
وهو يعرض عمدا عائلات القدرات، وليس أسماء RPC الخام الخاصة بـ Gateway ولا معرّفات أدوات الوكيل الخام.
حوّل infer إلى مهارة
انسخ هذا والصقه في وكيل:
Read https://docs.openclaw.ai/cli/infer, then create a skill that routes my common workflows to `openclaw infer`.
Focus on model runs, image generation, video generation, audio transcription, TTS, web search, and embeddings.
ينبغي أن تقوم المهارة الجيدة المستندة إلى infer بما يلي:
- ربط نوايا المستخدم الشائعة بأمر infer الفرعي الصحيح
- تضمين بعض أمثلة infer القياسية لسير العمل التي تغطيها
- تفضيل
openclaw infer ...في الأمثلة والاقتراحات - تجنب إعادة توثيق سطح infer بالكامل داخل متن المهارة
تغطية المهارات المعتادة التي تركز على infer:
openclaw infer model runopenclaw infer image generateopenclaw infer audio transcribeopenclaw infer tts convertopenclaw infer web searchopenclaw infer embedding create
لماذا تستخدم infer
يوفر openclaw infer واجهة CLI واحدة ومتسقة لمهام الاستدلال المدعومة بالمزودين داخل OpenClaw.
الفوائد:
- استخدام المزودين والنماذج المكوّنة بالفعل في OpenClaw بدلا من إعداد أغلفة مخصصة لكل خلفية.
- إبقاء سير عمل النماذج والصور ونسخ الصوت وTTS والفيديو والويب والتضمينات ضمن شجرة أوامر واحدة.
- استخدام شكل مخرجات
--jsonثابت للسكربتات والأتمتة وسير العمل المدفوع بالوكلاء. - تفضيل سطح OpenClaw رسمي عندما تكون المهمة في جوهرها "تشغيل الاستدلال".
- استخدام المسار المحلي العادي دون الحاجة إلى Gateway لمعظم أوامر infer.
لعمليات التحقق الشاملة من المزودين، فضّل openclaw infer ... بعد نجاح اختبارات
المزودين ذات المستوى الأدنى. فهو يمرّن CLI المشحون، وتحميل الإعدادات،
وحل الوكيل الافتراضي، وتفعيل Plugin المضمّن، ووقت تشغيل القدرة المشتركة
قبل إرسال طلب المزود.
شجرة الأوامر
openclaw infer
list
inspect
model
run
list
inspect
providers
auth login
auth logout
auth status
image
generate
edit
describe
describe-many
providers
audio
transcribe
providers
tts
convert
voices
providers
status
enable
disable
set-provider
video
generate
describe
providers
web
search
fetch
providers
embedding
create
providers
المهام الشائعة
يربط هذا الجدول مهام الاستدلال الشائعة بأمر infer المقابل.
| المهمة | الأمر | ملاحظات |
|---|---|---|
| تشغيل مطالبة نص/نموذج | openclaw infer model run --prompt "..." --json |
يستخدم المسار المحلي العادي افتراضيا |
| تشغيل مطالبة نموذج على صور | openclaw infer model run --prompt "Describe this" --file ./image.png --model provider/model |
كرر --file لمدخلات صور متعددة |
| إنشاء صورة | openclaw infer image generate --prompt "..." --json |
استخدم image edit عند البدء من ملف موجود |
| وصف ملف صورة | openclaw infer image describe --file ./image.png --prompt "..." --json |
يجب أن يكون --model نموذجا قادرا على الصور بصيغة <provider/model> |
| نسخ صوت | openclaw infer audio transcribe --file ./memo.m4a --json |
يجب أن يكون --model بصيغة <provider/model> |
| توليد كلام | openclaw infer tts convert --text "..." --output ./speech.mp3 --json |
tts status موجّه إلى Gateway |
| إنشاء فيديو | openclaw infer video generate --prompt "..." --json |
يدعم تلميحات المزود مثل --resolution |
| وصف ملف فيديو | openclaw infer video describe --file ./clip.mp4 --json |
يجب أن يكون --model بصيغة <provider/model> |
| البحث في الويب | openclaw infer web search --query "..." --json |
|
| جلب صفحة ويب | openclaw infer web fetch --url https://example.com --json |
|
| إنشاء تضمينات | openclaw infer embedding create --text "..." --json |
السلوك
openclaw infer ...هو سطح CLI الأساسي لسير العمل هذه.- استخدم
--jsonعندما ستستهلك المخرجات بواسطة أمر أو سكربت آخر. - استخدم
--providerأو--model provider/modelعند الحاجة إلى خلفية محددة. - بالنسبة إلى
image describeوaudio transcribeوvideo describe، يجب أن يستخدم--modelالصيغة<provider/model>. - بالنسبة إلى
image describe، يشغّل--modelالصريح ذلك المزود/النموذج مباشرة. يجب أن يكون النموذج قادرا على الصور في كتالوج النماذج أو إعدادات المزود. يشغّلcodex/<model>دورة فهم صور محدودة عبر خادم تطبيق Codex؛ ويستخدمopenai-codex/<model>مسار مزود OpenAI Codex OAuth. - أوامر التنفيذ عديمة الحالة تكون محلية افتراضيا.
- أوامر الحالة المُدارة بواسطة Gateway تستخدم Gateway افتراضيا.
- لا يتطلب المسار المحلي العادي تشغيل Gateway.
model runالمحلي هو إكمال مزود لمرة واحدة وخفيف. فهو يحل نموذج الوكيل والمصادقة المكوّنين، لكنه لا يبدأ دورة وكيل دردشة، ولا يحمّل الأدوات، ولا يفتح خوادم MCP المضمّنة.- يقبل
model run --fileملفات الصور، ويكتشف نوع MIME الخاص بها، ويرسلها مع المطالبة المقدمة إلى النموذج المحدد. كرر--fileلصور متعددة. - يرفض
model run --fileالمدخلات غير الصورية. استخدمinfer audio transcribeلملفات الصوت وinfer video describeلملفات الفيديو. - يمرّن
model run --gatewayتوجيه Gateway والمصادقة المحفوظة واختيار المزود ووقت التشغيل المضمّن، لكنه ما يزال يعمل كمسبار نموذج خام: فهو يرسل المطالبة المقدمة وأي مرفقات صور دون نص جلسة سابق، أو سياق bootstrap/AGENTS، أو تجميع محرك السياق، أو أدوات، أو خوادم MCP مضمّنة. - يتطلب
model run --gateway --model <provider/model>اعتماد Gateway لمشغل موثوق لأن الطلب يطلب من Gateway تشغيل تجاوز مزود/نموذج لمرة واحدة.
النموذج
استخدم model للاستدلال النصي المدعوم بالمزودين وفحص النموذج/المزود.
openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json
openclaw infer model run --prompt "Summarize this changelog entry" --model openai/gpt-5.4 --json
openclaw infer model run --prompt "Describe this image in one sentence" --file ./photo.jpg --model google/gemini-2.5-flash --json
openclaw infer model providers --json
openclaw infer model inspect --name gpt-5.5 --json
استخدم مراجع <provider/model> الكاملة لاختبار smoke لمزود محدد دون
بدء Gateway أو تحميل سطح أدوات الوكيل الكامل:
openclaw infer model run --local --model anthropic/claude-sonnet-4-6 --prompt "Reply with exactly: pong" --json
openclaw infer model run --local --model cerebras/zai-glm-4.7 --prompt "Reply with exactly: pong" --json
openclaw infer model run --local --model google/gemini-2.5-flash --prompt "Reply with exactly: pong" --json
openclaw infer model run --local --model groq/llama-3.1-8b-instant --prompt "Reply with exactly: pong" --json
openclaw infer model run --local --model mistral/mistral-small-latest --prompt "Reply with exactly: pong" --json
openclaw infer model run --local --model openai/gpt-4.1 --prompt "Reply with exactly: pong" --json
openclaw infer model run --local --model ollama/qwen2.5vl:7b --prompt "Describe this image." --file ./photo.jpg --json
ملاحظات:
model runالمحلي هو أضيق اختبار smoke عبر CLI لصحة المزود/النموذج/المصادقة لأنه، بالنسبة إلى مزودي غير Codex، يرسل فقط المطالبة المقدمة إلى النموذج المحدد.- مسبارات
openai-codex/*المحلية هي الاستثناء الضيق: يضيف OpenClaw تعليمة نظامية دنيا كي يتمكن نقل Codex Responses من تعبئة حقلinstructionsالمطلوب، دون إضافة سياق وكيل كامل أو أدوات أو ذاكرة أو نص جلسة. - يحافظ
model run --fileالمحلي على ذلك المسار الخفيف ويرفق محتوى الصورة مباشرة برسالة المستخدم الواحدة. تعمل ملفات الصور الشائعة مثل PNG وJPEG وWebP عندما يُكتشف نوع MIME الخاص بها كـimage/*؛ وتفشل الملفات غير المدعومة أو غير المعروفة قبل استدعاء المزود. - يكون
model run --fileأفضل عندما تريد اختبار نموذج النص متعدد الوسائط المحدد مباشرة. استخدمinfer image describeعندما تريد اختيار مزود فهم الصور في OpenClaw وتوجيه نموذج الصور الافتراضي. - يجب أن يدعم النموذج المحدد إدخال الصور؛ قد ترفض النماذج النصية فقط الطلب على طبقة المزود.
- يجب أن يحتوي
model run --promptعلى نص غير فارغ؛ تُرفض المطالبات الفارغة قبل استدعاء المزودين المحليين أو Gateway. - يخرج
model runالمحلي بقيمة غير صفرية عندما لا يعيد المزود أي مخرجات نصية، بحيث لا تبدو المزودات المحلية غير القابلة للوصول والإكمالات الفارغة كمسبارات ناجحة. - استخدم
model run --gatewayعندما تحتاج إلى اختبار توجيه Gateway، أو إعداد وقت تشغيل الوكيل، أو حالة المزود المُدارة بواسطة Gateway مع إبقاء إدخال النموذج خاما. استخدمopenclaw agentأو أسطح الدردشة عندما تريد سياق الوكيل الكامل والأدوات والذاكرة ونص الجلسة. - تدير
model auth loginوmodel auth logoutوmodel auth statusحالة مصادقة المزود المحفوظة.
الصورة
استخدم image للإنشاء والتحرير والوصف.
openclaw infer image generate --prompt "friendly lobster illustration" --json
openclaw infer image generate --prompt "cinematic product photo of headphones" --json
openclaw infer image generate --model openai/gpt-image-1.5 --output-format png --background transparent --prompt "simple red circle sticker on a transparent background" --json
openclaw infer image generate --prompt "slow image backend" --timeout-ms 180000 --json
openclaw infer image edit --file ./logo.png --model openai/gpt-image-1.5 --output-format png --background transparent --prompt "keep the logo, remove the background" --json
openclaw infer image edit --file ./poster.png --prompt "make this a vertical story ad" --size 2160x3840 --aspect-ratio 9:16 --resolution 4K --json
openclaw infer image describe --file ./photo.jpg --json
openclaw infer image describe --file ./receipt.jpg --prompt "Extract the merchant, date, and total" --json
openclaw infer image describe-many --file ./before.png --file ./after.png --prompt "Compare the screenshots and list visible UI changes" --json
openclaw infer image describe --file ./ui-screenshot.png --model openai/gpt-4.1-mini --json
openclaw infer image describe --file ./photo.jpg --model ollama/qwen2.5vl:7b --prompt "Describe the image in one sentence" --timeout-ms 300000 --json
ملاحظات:
-
استخدم
image editعند البدء من ملفات إدخال موجودة. -
استخدم
--sizeأو--aspect-ratioأو--resolutionمعimage editمن أجل المزوّدين/النماذج التي تدعم تلميحات الهندسة في تعديلات الصور المرجعية. -
استخدم
--output-format png --background transparentمع--model openai/gpt-image-1.5لمخرجات PNG من OpenAI بخلفية شفافة؛ يظل--openai-backgroundمتاحًا كاسم بديل خاص بـ OpenAI. المزوّدون الذين لا يعلنون دعم الخلفية يبلّغون عن التلميح كتجاوز تم تجاهله. -
استخدم
image providers --jsonللتحقق من مزوّدي الصور المضمّنين الذين يمكن اكتشافهم، وتكوينهم، واختيارهم، وإمكانات الإنشاء/التحرير التي يعرضها كل مزوّد. -
استخدم
image generate --model <provider/model> --jsonكأضيق اختبار حي عبر CLI لتغييرات إنشاء الصور. مثال:openclaw infer image providers --json openclaw infer image generate \ --model google/gemini-3.1-flash-image-preview \ --prompt "Minimal flat test image: one blue square on a white background, no text." \ --output ./openclaw-infer-image-smoke.png \ --jsonيبلّغ رد JSON عن
okوproviderوmodelوattemptsومسارات المخرجات المكتوبة. عند ضبط--output، قد يتبع الامتداد النهائي نوع MIME الذي أعاده المزوّد. -
بالنسبة إلى
image describeوimage describe-many، استخدم--promptلإعطاء نموذج الرؤية تعليمات خاصة بالمهمة مثل OCR أو المقارنة أو فحص الواجهة أو إنشاء تسمية توضيحية موجزة. -
استخدم
--timeout-msمع نماذج الرؤية المحلية البطيئة أو بدايات Ollama الباردة. -
بالنسبة إلى
image describe، يجب أن يكون--modelنموذج<provider/model>يدعم الصور. -
بالنسبة إلى نماذج الرؤية المحلية في Ollama، اسحب النموذج أولًا واضبط
OLLAMA_API_KEYعلى أي قيمة عنصر نائب، على سبيل المثالollama-local. راجع Ollama.
الصوت
استخدم audio لتفريغ الملفات الصوتية.
openclaw infer audio transcribe --file ./memo.m4a --json
openclaw infer audio transcribe --file ./team-sync.m4a --language en --prompt "Focus on names and action items" --json
openclaw infer audio transcribe --file ./memo.m4a --model openai/whisper-1 --json
ملاحظات:
audio transcribeمخصص لتفريغ الملفات، وليس لإدارة الجلسات في الوقت الفعلي.- يجب أن يكون
--modelبصيغة<provider/model>.
TTS
استخدم tts لتركيب الكلام وحالة مزوّد TTS.
openclaw infer tts convert --text "hello from openclaw" --output ./hello.mp3 --json
openclaw infer tts convert --text "Your build is complete" --output ./build-complete.mp3 --json
openclaw infer tts providers --json
openclaw infer tts status --json
ملاحظات:
- القيمة الافتراضية لـ
tts statusهي Gateway لأنها تعكس حالة TTS التي يديرها Gateway. - استخدم
tts providersوtts voicesوtts set-providerلفحص سلوك TTS وتكوينه.
الفيديو
استخدم video للإنشاء والوصف.
openclaw infer video generate --prompt "cinematic sunset over the ocean" --json
openclaw infer video generate --prompt "slow drone shot over a forest lake" --resolution 768P --duration 6 --json
openclaw infer video describe --file ./clip.mp4 --json
openclaw infer video describe --file ./clip.mp4 --model openai/gpt-4.1-mini --json
ملاحظات:
- يقبل
video generateالخيارات--sizeو--aspect-ratioو--resolutionو--durationو--audioو--watermarkو--timeout-msويمررها إلى وقت تشغيل إنشاء الفيديو. - يجب أن يكون
--modelبصيغة<provider/model>لـvideo describe.
الويب
استخدم web لسير عمل البحث والجلب.
openclaw infer web search --query "OpenClaw docs" --json
openclaw infer web search --query "OpenClaw infer web providers" --json
openclaw infer web fetch --url https://docs.openclaw.ai/cli/infer --json
openclaw infer web providers --json
ملاحظات:
- استخدم
web providersلفحص المزوّدين المتاحين والمكوّنين والمحددين.
التضمين
استخدم embedding لإنشاء المتجهات وفحص مزوّد التضمين.
openclaw infer embedding create --text "friendly lobster" --json
openclaw infer embedding create --text "customer support ticket: delayed shipment" --model openai/text-embedding-3-large --json
openclaw infer embedding providers --json
مخرجات JSON
توحّد أوامر Infer مخرجات JSON ضمن غلاف مشترك:
{
"ok": true,
"capability": "image.generate",
"transport": "local",
"provider": "openai",
"model": "gpt-image-2",
"attempts": [],
"outputs": []
}
حقول المستوى الأعلى مستقرة:
okcapabilitytransportprovidermodelattemptsoutputserror
بالنسبة إلى أوامر الوسائط المُنشأة، يحتوي outputs على الملفات التي كتبها OpenClaw. استخدم
path وmimeType وsize وأي أبعاد خاصة بالوسائط في تلك المصفوفة
للأتمتة بدلًا من تحليل stdout المقروء بشريًا.
الأخطاء الشائعة
# Bad
openclaw infer media image generate --prompt "friendly lobster"
# Good
openclaw infer image generate --prompt "friendly lobster"
# Bad
openclaw infer audio transcribe --file ./memo.m4a --model whisper-1 --json
# Good
openclaw infer audio transcribe --file ./memo.m4a --model openai/whisper-1 --json
ملاحظات
openclaw capability ...هو اسم بديل لـopenclaw infer ....