CLI commands
अनुमान CLI
openclaw infer प्रदाता-समर्थित inference workflows के लिए canonical headless surface है।
यह जानबूझकर capability families को expose करता है, raw gateway RPC names या 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 के लिए stable
--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 रूप से सामान्य 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 |
मौजूदा file से शुरू करते समय image edit का उपयोग करें |
| image file या URL का वर्णन करें | 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 का समर्थन करता है |
| video file का वर्णन करें | 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 बनाएं | 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 सामान्य media-fetch SSRF policy का उपयोग करते हैं।image describeके लिए, explicit--modelउस provider/model को सीधे चलाता है। model catalog या provider config में model 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 होती हैं।
- सामान्य local path के लिए gateway चल रहा होना आवश्यक नहीं है।
- Local
model runएक lean one-shot provider completion है। यह configured agent model और auth resolve करता है, लेकिन chat-agent turn शुरू नहीं करता, tools load नहीं करता, या bundled MCP servers नहीं खोलता। model run --fileimage files स्वीकार करता है, उनका MIME type detect करता है, और selected model को supplied prompt के साथ भेजता है। 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 का उपयोग करता है;adaptiveऔरmaxजैसे provider-specific levels को सबसे नज़दीकी portable simple-completion level पर map किया जाता है।
Model
provider-backed 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 --jsonनोट्स:
- 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: 0को reject करता है; 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 को बनाए रखता है और single user message में image content सीधे attach करता है। PNG, JPEG, और WebP जैसी common image files तब काम करती हैं जब उनका MIME typeimage/*के रूप में detect हो; unsupported या unrecognized files provider call किए जाने से पहले fail हो जाती हैं। - जब आप selected multimodal text model को सीधे test करना चाहते हैं, तो
model run --fileसबसे अच्छा है। जब आप 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 कर दिए जाते हैं।- जब provider कोई text output return नहीं करता, तो Local
model runnon-zero exit करता है, इसलिए unreachable local providers और empty completions successful probes जैसे नहीं दिखते। - जब आपको model input raw रखते हुए Gateway routing, agent-runtime setup, या Gateway-managed provider state test करना हो, तो
model run --gatewayका उपयोग करें। जब आपको 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का उपयोग करें। -
संदर्भ-छवि संपादनों पर ज्योमेट्री संकेतों का समर्थन करने वाले providers/models के लिए
image editके साथ--size,--aspect-ratio, या--resolutionका उपयोग करें। -
पारदर्शी-पृष्ठभूमि वाले OpenAI PNG आउटपुट के लिए
--model openai/gpt-image-1.5के साथ--output-format png --background transparentका उपयोग करें;--openai-backgroundOpenAI-विशिष्ट alias के रूप में उपलब्ध रहता है। जो providers पृष्ठभूमि समर्थन घोषित नहीं करते, वे संकेत को अनदेखे override के रूप में रिपोर्ट करते हैं। -
OpenAI सहित, छवि गुणवत्ता संकेतों का समर्थन करने वाले providers के लिए
--quality low|medium|high|autoका उपयोग करें। OpenAI provider-विशिष्ट moderation संकेत के लिए--openai-moderation low|autoभी स्वीकार करता है। -
कौन-से bundled image providers खोजे जा सकते हैं, configured हैं, selected हैं, और प्रत्येक provider कौन-सी generation/edit क्षमताएं उजागर करता है, यह सत्यापित करने के लिए
image providers --jsonका उपयोग करें। -
image generation बदलावों के लिए सबसे संकीर्ण live CLI smoke के रूप में
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 response
ok,provider,model,attempts, और लिखे गए आउटपुट पथ रिपोर्ट करता है। जब--outputसेट हो, तो अंतिम extension provider के लौटाए गए MIME type का अनुसरण कर सकता है। -
image describeऔरimage describe-manyके लिए, vision model को OCR, तुलना, UI निरीक्षण, या संक्षिप्त captioning जैसे task-विशिष्ट निर्देश देने के लिए--promptका उपयोग करें। -
धीमे local vision models या cold Ollama starts के साथ
--timeout-msका उपयोग करें। -
image describeके लिए,--modelएक image-capable<provider/model>होना चाहिए। -
local Ollama vision models के लिए, पहले model pull करें और
OLLAMA_API_KEYको किसी भी placeholder value पर सेट करें, उदाहरण के लिएollama-local। Ollama देखें।
ऑडियो
फ़ाइल transcription के लिए 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फ़ाइल transcription के लिए है, realtime session management के लिए नहीं।--model<provider/model>होना चाहिए।
TTS
speech synthesis और TTS provider state के लिए 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 statusdefault रूप से gateway पर जाता है क्योंकि यह gateway-managed TTS state को दर्शाता है।- TTS व्यवहार का निरीक्षण और configuration करने के लिए
tts providers,tts voices, औरtts set-providerका उपयोग करें।
वीडियो
generation और description के लिए 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-generation runtime को forward करता है।video describeके लिए--model<provider/model>होना चाहिए।
वेब
search और fetch workflows के लिए 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नोट्स:
- उपलब्ध, configured, और selected providers का निरीक्षण करने के लिए
web providersका उपयोग करें।
एम्बेडिंग
vector creation और embedding provider inspection के लिए 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 commands साझा envelope के अंतर्गत JSON output normalize करते हैं:
{ "ok": true, "capability": "image.generate", "transport": "local", "provider": "openai", "model": "gpt-image-2", "attempts": [], "outputs": []}Top-level fields स्थिर हैं:
okcapabilitytransportprovidermodelattemptsoutputserror
generated media commands के लिए, outputs में OpenClaw द्वारा लिखी गई files शामिल होती हैं। automation के लिए human-readable stdout parse करने के बजाय उस array में path, mimeType, size, और कोई भी media-specific dimensions उपयोग करें।
सामान्य चूकें
# 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 ...का alias है।