Agent coordination
Agent भेजें
openclaw agent कमांड लाइन से एक ही एजेंट टर्न चलाता है, जिसके लिए
इनबाउंड चैट संदेश की आवश्यकता नहीं होती। इसे स्क्रिप्टेड वर्कफ़्लो, परीक्षण और
प्रोग्रामेटिक डिलीवरी के लिए उपयोग करें।
त्वरित शुरुआत
Run a simple agent turn
openclaw agent --agent main --message "What is the weather today?"यह संदेश को Gateway के माध्यम से भेजता है और उत्तर प्रिंट करता है।
Send a multiline prompt from a file
openclaw agent --agent ops --message-file ./task.mdयह एजेंट संदेश बॉडी के रूप में एक मान्य UTF-8 फ़ाइल पढ़ता है।
Target a specific agent or session
# Target a specific agentopenclaw agent --agent ops --message "Summarize logs" # Target a phone number (derives session key)openclaw agent --to +15555550123 --message "Status update" # Reuse an existing sessionopenclaw agent --session-id abc123 --message "Continue the task" # Target an exact session keyopenclaw agent --session-key agent:ops:incident-42 --message "Summarize status"Deliver the reply to a channel
# Deliver to WhatsApp (default channel)openclaw agent --to +15555550123 --message "Report ready" --deliver # Deliver to Slackopenclaw agent --agent ops --message "Generate report" \ --deliver --reply-channel slack --reply-to "#reports"फ़्लैग
| फ़्लैग | विवरण |
|---|---|
--message \<text\> |
भेजने के लिए इनलाइन संदेश |
--message-file \<path\> |
एक मान्य UTF-8 फ़ाइल से संदेश पढ़ें |
--to \<dest\> |
किसी लक्ष्य (फ़ोन, चैट id) से सेशन कुंजी प्राप्त करें |
--session-key \<key\> |
स्पष्ट सेशन कुंजी का उपयोग करें |
--agent \<id\> |
कॉन्फ़िगर किए गए एजेंट को लक्षित करें (उसके main सेशन का उपयोग करता है) |
--session-id \<id\> |
id द्वारा मौजूदा सेशन का पुनः उपयोग करें |
--local |
स्थानीय एम्बेडेड रनटाइम बाध्य करें (Gateway छोड़ें) |
--deliver |
उत्तर को चैट चैनल पर भेजें |
--channel \<name\> |
डिलीवरी चैनल (whatsapp, telegram, discord, slack, आदि) |
--reply-to \<target\> |
डिलीवरी लक्ष्य ओवरराइड |
--reply-channel \<name\> |
डिलीवरी चैनल ओवरराइड |
--reply-account \<id\> |
डिलीवरी अकाउंट id ओवरराइड |
--thinking \<level\> |
चुने गए मॉडल प्रोफ़ाइल के लिए थिंकिंग स्तर सेट करें |
--verbose \<on|full|off\> |
वर्बोज़ स्तर सेट करें |
--timeout \<seconds\> |
एजेंट टाइमआउट ओवरराइड करें |
--json |
संरचित JSON आउटपुट करें |
व्यवहार
- डिफ़ॉल्ट रूप से, CLI Gateway के माध्यम से जाता है। वर्तमान मशीन पर
एम्बेडेड रनटाइम को बाध्य करने के लिए
--localजोड़ें। --messageया--message-fileमें से ठीक एक पास करें। फ़ाइल संदेश वैकल्पिक UTF-8 BOM हटाने के बाद मल्टीलाइन सामग्री को संरक्षित रखते हैं।- यदि Gateway उपलब्ध नहीं है, तो CLI स्थानीय एम्बेडेड रन पर फॉलबैक करता है।
- सेशन चयन:
--toसेशन कुंजी प्राप्त करता है (समूह/चैनल लक्ष्य आइसोलेशन संरक्षित रखते हैं; डायरेक्ट चैटmainमें समाहित हो जाती हैं)। --session-keyएक स्पष्ट कुंजी चुनता है। एजेंट-प्रीफ़िक्स वाली कुंजियों कोagent:<agent-id>:<session-key>का उपयोग करना होगा, और दोनों दिए जाने पर--agentको उस एजेंट id से मेल खाना चाहिए। बेयर नॉन-सेंटिनल कुंजियाँ दिए जाने पर--agentके स्कोप में होती हैं; उदाहरण के लिए,--agent ops --session-key incident-42कोagent:ops:incident-42पर रूट करता है।--agentके बिना, बेयर नॉन-सेंटिनल कुंजियाँ कॉन्फ़िगर किए गए डिफ़ॉल्ट एजेंट के स्कोप में होती हैं। लिटरलglobalऔरunknownकेवल तब अनस्कोप्ड रहते हैं जब कोई--agentनहीं दिया गया हो; उस स्थिति में, एम्बेडेड फॉलबैक और स्टोर ओनरशिप कॉन्फ़िगर किए गए डिफ़ॉल्ट एजेंट का उपयोग करते हैं।- थिंकिंग और वर्बोज़ फ़्लैग सेशन स्टोर में बने रहते हैं।
- आउटपुट: डिफ़ॉल्ट रूप से सादा टेक्स्ट, या संरचित पेलोड + मेटाडेटा के लिए
--json। --json --deliverके साथ, JSON में भेजे गए, दबाए गए, आंशिक और विफल भेजावों की डिलीवरी स्थिति शामिल होती है। देखें JSON डिलीवरी स्थिति।
उदाहरण
# Simple turn with JSON outputopenclaw agent --to +15555550123 --message "Trace logs" --verbose on --json # Turn with thinking levelopenclaw agent --session-id 1234 --message "Summarize inbox" --thinking medium # Multiline prompt from a fileopenclaw agent --agent ops --message-file ./task.md # Exact session keyopenclaw agent --session-key agent:ops:incident-42 --message "Summarize status" # Legacy key scoped to an agentopenclaw agent --agent ops --session-key incident-42 --message "Summarize status" # Deliver to a different channel than the sessionopenclaw agent --agent ops --message "Alert" --deliver --reply-channel telegram --reply-to "@admin"संबंधित
Was this useful?