Gateway CLI
Gateway, OpenClaw का WebSocket सर्वर है (चैनल, नोड्स, सत्र, हुक्स)। इस पृष्ठ के सबकमांडopenclaw gateway … के अंतर्गत आते हैं।
संबंधित दस्तावेज़:
Gateway चलाएँ
एक स्थानीय Gateway प्रक्रिया चलाएँ:- By default, the Gateway refuses to start unless
gateway.mode=localis set in~/.openclaw/openclaw.json. Use--allow-unconfiguredfor ad-hoc/dev runs. - प्रमाणीकरण के बिना loopback से आगे बाइंड करना अवरुद्ध है (सुरक्षा गार्डरेल)।
SIGUSR1अधिकृत होने पर इन-प्रोसेस रीस्टार्ट ट्रिगर करता है (commands.restartसक्षम करें या gateway tool/config apply/update का उपयोग करें)।SIGINT/SIGTERMhandlers stop the gateway process, but they don’t restore any custom terminal state. If you wrap the CLI with a TUI or raw-mode input, restore the terminal before exit.
विकल्प
--port <port>: WebSocket पोर्ट (डिफ़ॉल्ट config/env से आता है; सामान्यतः18789)।--bind <loopback|lan|tailnet|auto|custom>: listener बाइंड मोड।--auth <token|password>: auth मोड ओवरराइड।--token <token>: टोकन ओवरराइड (प्रक्रिया के लिएOPENCLAW_GATEWAY_TOKENभी सेट करता है)।--password <password>: पासवर्ड ओवरराइड (प्रक्रिया के लिएOPENCLAW_GATEWAY_PASSWORDभी सेट करता है)।--tailscale <off|serve|funnel>: Tailscale के माध्यम से Gateway को एक्सपोज़ करें।--tailscale-reset-on-exit: शटडाउन पर Tailscale serve/funnel विन्यास रीसेट करें।--allow-unconfigured: config मेंgateway.mode=localके बिना Gateway शुरू करने की अनुमति दें।--dev: यदि अनुपस्थित हो तो dev config + workspace बनाएँ (BOOTSTRAP.md को छोड़ता है)।--reset: dev config + credentials + sessions + workspace रीसेट करें (--devआवश्यक)।--force: शुरू करने से पहले चयनित पोर्ट पर किसी भी मौजूदा listener को समाप्त करें।--verbose: विस्तृत लॉग्स।--claude-cli-logs: कंसोल में केवल claude-cli लॉग्स दिखाएँ (और उसका stdout/stderr सक्षम करें)।--ws-log <auto|full|compact>: websocket लॉग शैली (डिफ़ॉल्टauto)।--compact:--ws-log compactके लिए उपनाम।--raw-stream: कच्चे मॉडल स्ट्रीम इवेंट्स को jsonl में लॉग करें।--raw-stream-path <path>: raw stream jsonl पथ।
चल रहे Gateway से क्वेरी करें
सभी क्वेरी कमांड WebSocket RPC का उपयोग करते हैं। आउटपुट मोड:- डिफ़ॉल्ट: मानव-पठनीय (TTY में रंगीन)।
--json: मशीन-पठनीय JSON (कोई स्टाइलिंग/स्पिनर नहीं)।--no-color(याNO_COLOR=1): मानव लेआउट रखते हुए ANSI अक्षम करें।
--url <url>: Gateway WebSocket URL।--token <token>: Gateway टोकन।--password <password>: Gateway पासवर्ड।--timeout <ms>: टाइमआउट/बजट (कमांड के अनुसार भिन्न)।--expect-final: “final” प्रतिक्रिया की प्रतीक्षा करें (agent कॉल्स)।
--url, the CLI does not fall back to config or environment credentials.
Pass --token or --password explicitly. Missing explicit credentials is an error.
gateway health
gateway status
gateway status Gateway सेवा (launchd/systemd/schtasks) के साथ एक वैकल्पिक RPC प्रोब दिखाता है।
--url <url>: प्रोब URL ओवरराइड करें।--token <token>: प्रोब के लिए टोकन प्रमाणीकरण।--password <password>: प्रोब के लिए पासवर्ड प्रमाणीकरण।--timeout <ms>: प्रोब टाइमआउट (डिफ़ॉल्ट10000)।--no-probe: RPC प्रोब छोड़ें (केवल सेवा दृश्य)।--deep: सिस्टम-स्तरीय सेवाओं को भी स्कैन करें।
gateway probe
gateway probe is the “debug everything” command. It always probes:
- आपका कॉन्फ़िगर किया गया रिमोट Gateway (यदि सेट हो), और
- localhost (loopback) भले ही रिमोट कॉन्फ़िगर हो।
SSH के माध्यम से दूरस्थ (Mac ऐप समानता)
macOS ऐप का “Remote over SSH” मोड एक स्थानीय पोर्ट-फ़ॉरवर्ड का उपयोग करता है ताकि रिमोट Gateway (जो केवल loopback पर बाइंड हो सकता है)ws://127.0.0.1:<port> पर पहुँच योग्य बन जाए।
CLI समकक्ष:
--ssh <target>:user@hostयाuser@host:port(पोर्ट डिफ़ॉल्ट22)।--ssh-identity <path>: identity फ़ाइल।--ssh-auto: खोजे गए पहले Gateway होस्ट को SSH लक्ष्य के रूप में चुनें (केवल LAN/WAB)।
gateway.remote.sshTargetgateway.remote.sshIdentity
gateway call <method>
लो-लेवल RPC सहायक।
Gateway सेवा प्रबंधित करें
gateway install--port,--runtime,--token,--force,--jsonका समर्थन करता है।- लाइफ़साइकल कमांड्स स्क्रिप्टिंग के लिए
--jsonस्वीकार करते हैं।
Gateways खोजें (Bonjour)
gateway discover Gateway बीकन्स (_openclaw-gw._tcp) के लिए स्कैन करता है।
- मल्टीकास्ट DNS-SD:
local. - यूनिकास्ट DNS-SD (Wide-Area Bonjour): एक डोमेन चुनें (उदाहरण:
openclaw.internal.) और split DNS + एक DNS सर्वर सेट करें; देखें /gateway/bonjour
role(Gateway भूमिका संकेत)transport(ट्रांसपोर्ट संकेत, जैसेgateway)gatewayPort(WebSocket पोर्ट, सामान्यतः18789)sshPort(SSH पोर्ट; यदि मौजूद न हो तो डिफ़ॉल्ट22)tailnetDns(MagicDNS होस्टनाम, उपलब्ध होने पर)gatewayTls/gatewayTlsSha256(TLS सक्षम + सर्टिफ़िकेट फ़िंगरप्रिंट)cliPath(रिमोट इंस्टॉलेशन्स के लिए वैकल्पिक संकेत)
gateway discover
--timeout <ms>: प्रति-कमांड टाइमआउट (browse/resolve); डिफ़ॉल्ट2000।--json: मशीन-पठनीय आउटपुट (स्टाइलिंग/स्पिनर भी अक्षम करता है)।