CLI commands
अनुमान CLI
openclaw infer प्रदाता-समर्थित inference workflows के लिए canonical headless surface है।
यह जानबूझकर capability families को उजागर करता है, raw gateway RPC नामों को नहीं और raw agent tool ids को भी नहीं।
infer को skill में बदलें
इसे किसी agent में copy और paste करें:
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-आधारित skill चाहिए कि:
- सामान्य user intents को सही infer subcommand से map करे
- जिन workflows को यह cover करता है उनके लिए कुछ canonical infer examples शामिल करे
- examples और suggestions में
openclaw infer ...को प्राथमिकता दे - skill body के भीतर पूरे infer surface को फिर से document करने से बचे
सामान्य infer-केंद्रित skill coverage:
openclaw infer model runopenclaw infer image generateopenclaw infer audio transcribeopenclaw infer tts convertopenclaw infer web searchopenclaw infer embedding create
infer का उपयोग क्यों करें
openclaw infer OpenClaw के भीतर प्रदाता-समर्थित inference tasks के लिए एक consistent CLI प्रदान करता है।
लाभ:
- हर backend के लिए one-off wrappers wire up करने के बजाय OpenClaw में पहले से configured providers और models का उपयोग करें।
- model, image, audio transcription, TTS, video, web, और embedding workflows को एक command tree के अंतर्गत रखें।
- scripts, automation, और agent-driven workflows के लिए स्थिर
--jsonoutput shape का उपयोग करें। - जब task मूल रूप से "run inference" हो, तो first-party OpenClaw surface को प्राथमिकता दें।
- अधिकांश infer commands के लिए gateway की आवश्यकता के बिना सामान्य local path का उपयोग करें।
end-to-end provider checks के लिए, lower-level provider tests green होने के बाद openclaw infer ... को प्राथमिकता दें। provider request किए जाने से पहले यह shipped CLI, config loading, default-agent resolution, bundled plugin activation, और shared capability runtime को exercise करता है।
Command tree
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सामान्य tasks
यह table सामान्य inference tasks को संबंधित infer command से map करती है।
| Task | Command | Notes |
|---|---|---|
| text/model prompt चलाएँ | openclaw infer model run --prompt "..." --json |
default रूप से normal local path का उपयोग करता है |
| images पर model prompt चलाएँ | openclaw infer model run --prompt "Describe this" --file ./image.png --model provider/model |
multiple image inputs के लिए --file दोहराएँ |
| image generate करें | openclaw infer image generate --prompt "..." --json |
existing file से शुरू करते समय image edit का उपयोग करें |
| image file या URL describe करें | openclaw infer image describe --file ./image.png --prompt "..." --json |
--model image-capable <provider/model> होना चाहिए |
| audio transcribe करें | openclaw infer audio transcribe --file ./memo.m4a --json |
--model <provider/model> होना चाहिए |
| speech synthesize करें | openclaw infer tts convert --text "..." --output ./speech.mp3 --json |
tts status gateway-oriented है |
| video generate करें | openclaw infer video generate --prompt "..." --json |
--resolution जैसे provider hints support करता है |
| video file describe करें | openclaw infer video describe --file ./clip.mp4 --json |
--model <provider/model> होना चाहिए |
| web search करें | openclaw infer web search --query "..." --json |
|
| web page fetch करें | openclaw infer web fetch --url https://example.com --json |
|
| embeddings create करें | openclaw infer embedding create --text "..." --json |
व्यवहार
openclaw infer ...इन workflows के लिए primary CLI surface है।- जब output को किसी दूसरे command या script द्वारा consume किया जाएगा, तो
--jsonका उपयोग करें। - जब किसी specific backend की आवश्यकता हो, तो
--providerया--model provider/modelका उपयोग करें। - run को raw रखते हुए one-shot thinking/reasoning level (
off,minimal,low,medium,high,adaptive,xhigh, याmax) pass करने के लिएmodel run --thinking <level>का उपयोग करें। image describe,audio transcribe, औरvideo describeके लिए,--modelको<provider/model>form का उपयोग करना चाहिए।image describeके लिए,--filelocal paths और HTTP(S) image URLs स्वीकार करता है। Remote URLs normal media-fetch SSRF policy का उपयोग करते हैं।image describeके लिए, explicit--modelपहले उस provider/model को चलाता है, फिर model call fail होने पर configuredagents.defaults.imageModel.fallbacksआज़माता है। Input preparation errors, जैसे missing files या unsupported URLs, fallback attempts से पहले fail होते हैं। model को model catalog या provider config में image-capable होना चाहिए।codex/<model>bounded Codex app-server image-understanding turn चलाता है;openai/<model>API-key या ChatGPT/Codex OAuth auth में से किसी एक के साथ OpenAI provider path का उपयोग करता है।- Stateless execution commands default रूप से local होते हैं।
- Gateway-managed state commands default रूप से gateway होते हैं।
- normal local path को gateway running होने की आवश्यकता नहीं होती।
- Local
model runएक lean one-shot provider completion है। यह configured agent model और auth resolve करता है, लेकिन chat-agent turn शुरू नहीं करता, tools load नहीं करता, या bundled MCP servers open नहीं करता। model run --fileimage files स्वीकार करता है, उनका MIME type detect करता है, और उन्हें supplied prompt के साथ selected model को भेजता है। multiple images के लिए--fileदोहराएँ।model run --filenon-image inputs reject करता है। audio files के लिएinfer audio transcribeऔर video files के लिएinfer video describeका उपयोग करें।model run --gatewayGateway routing, saved auth, provider selection, और embedded runtime को exercise करता है, लेकिन फिर भी raw model probe के रूप में चलता है: यह supplied prompt और कोई भी image attachments भेजता है, बिना prior session transcript, bootstrap/AGENTS context, context-engine assembly, tools, या bundled MCP servers के।model run --gateway --model <provider/model>को trusted operator gateway credential की आवश्यकता होती है क्योंकि request Gateway से one-off provider/model override चलाने को कहती है।- Local
model run --thinkinglean provider-completion path का उपयोग करता है; provider-specific levels जैसेadaptiveऔरmaxको closest portable simple-completion level पर map किया जाता है।
Model
प्रदाता-समर्थित text inference और model/provider inspection के लिए model का उपयोग करें।
openclaw infer model run --prompt "Reply with exactly: smoke-ok" --jsonopenclaw infer model run --prompt "Summarize this changelog entry" --model openai/gpt-5.4 --jsonopenclaw infer model run --prompt "Describe this image in one sentence" --file ./photo.jpg --model google/gemini-2.5-flash --jsonopenclaw infer model run --prompt "Use more reasoning here" --thinking high --jsonopenclaw infer model providers --jsonopenclaw infer model inspect --name gpt-5.5 --jsonGateway शुरू किए बिना या full agent tool surface load किए बिना किसी specific provider को smoke-test करने के लिए full <provider/model> refs का उपयोग करें:
openclaw infer model run --local --model anthropic/claude-sonnet-4-6 --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model cerebras/zai-glm-4.7 --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model google/gemini-2.5-flash --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model groq/llama-3.1-8b-instant --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model mistral/mistral-medium-3-5 --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model mistral/mistral-small-latest --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model openai/gpt-5.5 --prompt "Reply with exactly: pong" --jsonopenclaw infer model run --local --model ollama/qwen2.5vl:7b --prompt "Describe this image." --file ./photo.jpg --jsonNotes:
- Local
model runprovider/model/auth health के लिए सबसे narrow CLI smoke है क्योंकि, non-Codex providers के लिए, यह selected model को केवल supplied prompt भेजता है। - Local
model run --model <provider/model>provider config में लिखे जाने से पहलेmodels list --allसे exact bundled static catalog rows का उपयोग कर सकता है। Provider auth अभी भी required है; missing credentials auth errors के रूप में fail होते हैं,Unknown modelके रूप में नहीं। - Mistral Medium 3.5 reasoning probes के लिए, temperature unset/default छोड़ें। Mistral
reasoning_effort="high"plustemperature: 0reject करता है; default temperature या0.7जैसे non-zero reasoning-mode value के साथmistral/mistral-medium-3-5का उपयोग करें। - Codex Responses local probes narrow exception हैं: OpenClaw minimal system instruction जोड़ता है ताकि transport अपने required
instructionsfield को populate कर सके, बिना full agent context, tools, memory, या session transcript जोड़े। - Local
model run --fileउस lean path को बनाए रखता है और image content को directly single user message से attach करता है। PNG, JPEG, और WebP जैसी common image files तब काम करती हैं जब उनका MIME typeimage/*के रूप में detect होता है; unsupported या unrecognized files provider को call किए जाने से पहले fail होती हैं। model run --fileतब best है जब आप selected multimodal text model को directly test करना चाहते हैं। जब आप OpenClaw की image-understanding provider selection और default image-model routing चाहते हैं, तोinfer image describeका उपयोग करें।- selected model को image input support करना चाहिए; text-only models provider layer पर request reject कर सकते हैं।
model run --promptमें non-whitespace text होना चाहिए; empty prompts local providers या Gateway को call किए जाने से पहले reject होते हैं।- Local
model runतब non-zero exit करता है जब provider कोई text output return नहीं करता, ताकि unreachable local providers और empty completions successful probes जैसे न दिखें। - Gateway routing, agent-runtime setup, या Gateway-managed provider state को test करने के लिए
model run --gatewayका उपयोग करें, जबकि model input raw रहे। जब आप full agent context, tools, memory, और session transcript चाहते हैं, तोopenclaw agentया chat surfaces का उपयोग करें। model auth login,model auth logout, औरmodel auth statussaved provider auth state manage करते हैं।
Image
generation, edit, और description के लिए image का उपयोग करें।
openclaw infer image generate --prompt "friendly lobster illustration" --jsonopenclaw infer image generate --prompt "cinematic product photo of headphones" --jsonopenclaw infer image generate --model openai/gpt-image-1.5 --output-format png --background transparent --prompt "simple red circle sticker on a transparent background" --jsonopenclaw infer image generate --model openai/gpt-image-2 --quality low --openai-moderation low --prompt "low-cost draft poster" --jsonopenclaw infer image generate --prompt "slow image backend" --timeout-ms 180000 --jsonopenclaw infer image edit --file ./logo.png --model openai/gpt-image-1.5 --output-format png --background transparent --prompt "keep the logo, remove the background" --jsonopenclaw infer image edit --file ./poster.png --prompt "make this a vertical story ad" --size 2160x3840 --aspect-ratio 9:16 --resolution 4K --jsonopenclaw infer image describe --file ./photo.jpg --jsonopenclaw infer image describe --file https://example.com/photo.png --jsonopenclaw infer image describe --file ./receipt.jpg --prompt "Extract the merchant, date, and total" --jsonopenclaw infer image describe-many --file ./before.png --file ./after.png --prompt "Compare the screenshots and list visible UI changes" --jsonopenclaw infer image describe --file ./ui-screenshot.png --model openai/gpt-5.4-mini --jsonopenclaw infer image describe --file ./photo.jpg --model ollama/qwen2.5vl:7b --prompt "Describe the image in one sentence" --timeout-ms 300000 --jsonटिप्पणियां:
-
मौजूदा इनपुट फाइलों से शुरू करते समय
image editका उपयोग करें। -
उन प्रदाताओं/मॉडलों के लिए
image editके साथ--size,--aspect-ratio, या--resolutionका उपयोग करें जो संदर्भ-इमेज संपादनों पर ज्योमेट्री संकेतों का समर्थन करते हैं। -
पारदर्शी-बैकग्राउंड OpenAI PNG आउटपुट के लिए
--model openai/gpt-image-1.5के साथ--output-format png --background transparentका उपयोग करें;--openai-backgroundOpenAI-विशिष्ट उपनाम के रूप में उपलब्ध रहता है। जो प्रदाता बैकग्राउंड समर्थन घोषित नहीं करते, वे संकेत को अनदेखे ओवरराइड के रूप में रिपोर्ट करते हैं। -
OpenAI सहित, इमेज गुणवत्ता संकेतों का समर्थन करने वाले प्रदाताओं के लिए
--quality low|medium|high|autoका उपयोग करें। OpenAI प्रदाता-विशिष्ट मॉडरेशन संकेत के लिए--openai-moderation low|autoभी स्वीकार करता है। -
कौन से बंडल किए गए इमेज प्रदाता खोजे जा सकते हैं, कॉन्फिगर किए गए हैं, चयनित हैं, और प्रत्येक प्रदाता कौन सी जनरेशन/एडिट क्षमताएं उजागर करता है, यह सत्यापित करने के लिए
image providers --jsonका उपयोग करें। -
इमेज जनरेशन परिवर्तनों के लिए सबसे संकीर्ण लाइव CLI स्मोक के रूप में
image generate --model <provider/model> --jsonका उपयोग करें। उदाहरण:bash openclaw infer image providers --jsonopenclaw 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 \ --jsonJSON प्रतिक्रिया
ok,provider,model,attempts, और लिखे गए आउटपुट पथों को रिपोर्ट करती है। जब--outputसेट हो, अंतिम एक्सटेंशन प्रदाता द्वारा लौटाए गए MIME प्रकार का अनुसरण कर सकता है। -
image describeऔरimage describe-manyके लिए, विज़न मॉडल को OCR, तुलना, UI निरीक्षण, या संक्षिप्त कैप्शनिंग जैसे कार्य-विशिष्ट निर्देश देने के लिए--promptका उपयोग करें। -
धीमे स्थानीय विज़न मॉडलों या ठंडे Ollama स्टार्ट के साथ
--timeout-msका उपयोग करें। -
image describeके लिए,--modelएक इमेज-सक्षम<provider/model>होना चाहिए। सेट होने पर, OpenClaw पहले उस स्पष्ट मॉडल को आजमाता है और फिर मॉडल कॉल विफल होने पर कॉन्फिगर किए गए इमेज-मॉडल फ़ॉलबैक आजमाता है। -
स्थानीय Ollama विज़न मॉडलों के लिए, पहले मॉडल पुल करें और
OLLAMA_API_KEYको किसी भी प्लेसहोल्डर मान पर सेट करें, उदाहरण के लिएollama-local। Ollama देखें।
ऑडियो
फाइल ट्रांसक्रिप्शन के लिए audio का उपयोग करें।
openclaw infer audio transcribe --file ./memo.m4a --jsonopenclaw infer audio transcribe --file ./team-sync.m4a --language en --prompt "Focus on names and action items" --jsonopenclaw 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 --jsonopenclaw infer tts convert --text "Your build is complete" --output ./build-complete.mp3 --jsonopenclaw infer tts providers --jsonopenclaw infer tts status --jsonटिप्पणियां:
tts statusडिफ़ॉल्ट रूप से Gateway पर जाता है क्योंकि यह Gateway-प्रबंधित TTS स्थिति को दर्शाता है।- TTS व्यवहार का निरीक्षण और कॉन्फिगरेशन करने के लिए
tts providers,tts voices, औरtts set-providerका उपयोग करें।
वीडियो
जनरेशन और विवरण के लिए video का उपयोग करें।
openclaw infer video generate --prompt "cinematic sunset over the ocean" --jsonopenclaw infer video generate --prompt "slow drone shot over a forest lake" --resolution 768P --duration 6 --jsonopenclaw infer video describe --file ./clip.mp4 --jsonopenclaw infer video describe --file ./clip.mp4 --model openai/gpt-5.4-mini --jsonटिप्पणियां:
video generate--size,--aspect-ratio,--resolution,--duration,--audio,--watermark, और--timeout-msस्वीकार करता है और उन्हें वीडियो-जनरेशन रनटाइम को अग्रेषित करता है।video describeके लिए--model<provider/model>होना चाहिए।
वेब
खोज और फ़ेच वर्कफ़्लो के लिए web का उपयोग करें।
openclaw infer web search --query "OpenClaw docs" --jsonopenclaw infer web search --query "OpenClaw infer web providers" --jsonopenclaw infer web fetch --url https://docs.openclaw.ai/cli/infer --jsonopenclaw infer web providers --jsonटिप्पणियां:
- उपलब्ध, कॉन्फिगर किए गए, और चयनित प्रदाताओं का निरीक्षण करने के लिए
web providersका उपयोग करें।
एम्बेडिंग
वेक्टर निर्माण और एम्बेडिंग प्रदाता निरीक्षण के लिए embedding का उपयोग करें।
openclaw infer embedding create --text "friendly lobster" --jsonopenclaw infer embedding create --text "customer support ticket: delayed shipment" --model openai/text-embedding-3-large --jsonopenclaw infer embedding providers --jsonJSON आउटपुट
Infer कमांड JSON आउटपुट को साझा एनवेलप के अंतर्गत सामान्यीकृत करते हैं:
{ "ok": true, "capability": "image.generate", "transport": "local", "provider": "openai", "model": "gpt-image-2", "attempts": [], "outputs": []}शीर्ष-स्तरीय फ़ील्ड स्थिर हैं:
okcapabilitytransportprovidermodelattemptsoutputserror
जनरेट किए गए मीडिया कमांडों के लिए, outputs में OpenClaw द्वारा लिखी गई फाइलें शामिल होती हैं। मानव-पठनीय stdout को पार्स करने के बजाय ऑटोमेशन के लिए उस ऐरे में path, mimeType, size, और किसी भी मीडिया-विशिष्ट आयामों का उपयोग करें।
सामान्य गलतियां
# Badopenclaw infer media image generate --prompt "friendly lobster" # Goodopenclaw infer image generate --prompt "friendly lobster"# Badopenclaw infer audio transcribe --file ./memo.m4a --model whisper-1 --json # Goodopenclaw infer audio transcribe --file ./memo.m4a --model openai/whisper-1 --jsonटिप्पणियां
openclaw capability ...,openclaw infer ...का उपनाम है।