openclaw.json में non-interactive संपादनों के लिए config helpers: path के अनुसार values get/set/patch/unset/file/schema/validate करें और active config file print करें। configure wizard खोलने के लिए subcommand के बिना चलाएँ (openclaw configure जैसा ही)।
जब
OPENCLAW_NIX_MODE=1 होता है, OpenClaw openclaw.json को immutable मानता है। config get, config file, config schema, और config validate जैसे read-only commands फिर भी काम करते हैं, लेकिन config writers अस्वीकार कर देते हैं। एजेंट्स को इसके बजाय install के लिए Nix source edit करना चाहिए; first-party nix-openclaw distribution के लिए, nix-openclaw Quick Start उपयोग करें और values को programs.openclaw.config या instances.<name>.config के अंतर्गत set करें।Root options
जब आप
openclaw config को subcommand के बिना चलाते हैं, तब repeatable guided-setup section filter।workspace, model, web, gateway, daemon, channels, plugins, skills, health.
उदाहरण
config schema
openclaw.json के लिए generated JSON schema को stdout पर JSON के रूप में print करें।
What it includes
What it includes
- वर्तमान root config schema, और editor tooling के लिए root
$schemastring field। - Control UI द्वारा उपयोग किया गया field
titleऔरdescriptiondocs metadata। - Nested object, wildcard (
*), और array-item ([]) nodes, matching field documentation मौजूद होने पर वहीtitle/descriptionmetadata inherit करते हैं। - matching field documentation मौजूद होने पर
anyOf/oneOf/allOfbranches भी वही docs metadata inherit करती हैं। - जब runtime manifests load किए जा सकते हैं, तब best-effort live Plugin + channel schema metadata।
- वर्तमान config invalid होने पर भी clean fallback schema।
Related runtime RPC
Related runtime RPC
Paths
Paths dot या bracket notation का उपयोग करते हैं। Shell examples में bracket-notation paths को quote करें ताकि zsh जैसे shells, OpenClaw को path मिलने से पहले[0] को glob के रूप में expand न करें:
Values
जहाँ संभव हो, values को JSON5 के रूप में parse किया जाता है; अन्यथा उन्हें strings माना जाता है। बिना string fallback के standard JSON parsing require करने के लिए--strict-json उपयोग करें। --json, --strict-json के legacy alias के रूप में supported रहता है।
--strict-json enabled होता है, तो comments, trailing commas, या unquoted object keys जैसी JSON5-only syntax reject की जाती है। raw-string fallback के साथ JSON5 value parsing के लिए --strict-json omit करें।
config get <path> --json terminal-formatted text के बजाय raw value को JSON के रूप में print करता है।
Object assignment default रूप से target path को replace करता है। Protected map/list paths जो आम तौर पर user-added entries रखते हैं, जैसे
agents.defaults.models, models.providers, models.providers.<id>.models, plugins.entries, और auth.profiles, ऐसी replacements से इनकार करते हैं जो existing entries को remove कर देंगी, जब तक आप --replace pass न करें।--merge उपयोग करें:
--replace केवल तब उपयोग करें जब आप जानबूझकर provided value को complete target value बनाना चाहते हों।
config set modes
openclaw config set चार assignment styles support करता है:
- Value mode
- SecretRef builder mode
- Provider builder mode
- Batch mode
--batch-json/--batch-file) को source of truth के रूप में उपयोग करती है। --strict-json / --json batch parsing behavior नहीं बदलते।
config patch
जब आप कई path-based config set commands चलाने के बजाय config-shaped patch paste या pipe करना चाहते हों, तो config patch उपयोग करें। Input एक JSON5 object है। Objects recursively merge होते हैं, arrays और scalar values target value को replace करते हैं, और null target path delete करता है।
--replace-path <path> उपयोग करें:
--dry-run लिखे बिना schema और SecretRef resolvability checks चलाता है। Exec-backed SecretRefs dry-run के दौरान default रूप से skipped होते हैं; जब आप जानबूझकर dry-run से provider commands execute करवाना चाहते हों, तो --allow-exec जोड़ें।
JSON path/value mode SecretRefs और providers, दोनों के लिए supported रहता है:
Provider builder flags
Provider builder targets को path के रूप मेंsecrets.providers.<alias> उपयोग करना ही होगा।
Common flags
Common flags
--provider-source <env|file|exec>--provider-timeout-ms <ms>(file,exec)
Env provider (--provider-source env)
Env provider (--provider-source env)
--provider-allowlist <ENV_VAR>(repeatable)
File provider (--provider-source file)
File provider (--provider-source file)
--provider-path <path>(required)--provider-mode <singleValue|json>--provider-max-bytes <bytes>--provider-allow-insecure-path
Exec provider (--provider-source exec)
Exec provider (--provider-source exec)
--provider-command <path>(required)--provider-arg <arg>(repeatable)--provider-no-output-timeout-ms <ms>--provider-max-output-bytes <bytes>--provider-json-only--provider-env <KEY=VALUE>(repeatable)--provider-pass-env <ENV_VAR>(repeatable)--provider-trusted-dir <path>(repeatable)--provider-allow-insecure-path--provider-allow-symlink-command
Dry run
openclaw.json लिखे बिना changes validate करने के लिए --dry-run उपयोग करें।
ड्राई-रन व्यवहार
ड्राई-रन व्यवहार
- बिल्डर मोड: बदले गए refs/providers के लिए SecretRef resolvability जांचें चलाता है।
- JSON मोड (
--strict-json,--json, या बैच मोड): स्कीमा सत्यापन और SecretRef resolvability जांचें चलाता है। - ज्ञात असमर्थित SecretRef लक्ष्य सतहों के लिए नीति सत्यापन भी चलता है।
- नीति जांचें पूरे post-change config का मूल्यांकन करती हैं, इसलिए parent-object writes (उदाहरण के लिए
hooksको object के रूप में सेट करना) unsupported-surface validation को बाइपास नहीं कर सकते। - कमांड साइड इफेक्ट से बचने के लिए dry-run के दौरान Exec SecretRef जांचें डिफ़ॉल्ट रूप से छोड़ दी जाती हैं।
- exec SecretRef जांचों में opt in करने के लिए
--dry-runके साथ--allow-execका उपयोग करें (यह provider commands निष्पादित कर सकता है)। --allow-execकेवल dry-run के लिए है और--dry-runके बिना उपयोग करने पर त्रुटि देता है।
--dry-run --json फ़ील्ड
--dry-run --json फ़ील्ड
--dry-run --json मशीन-पठनीय रिपोर्ट प्रिंट करता है:ok: क्या dry-run पास हुआoperations: मूल्यांकित assignments की संख्याchecks: क्या schema/resolvability जांचें चलींchecks.resolvabilityComplete: क्या resolvability जांचें पूर्णता तक चलीं (जब exec refs छोड़े जाते हैं तो false)refsChecked: dry-run के दौरान वास्तव में resolved refs की संख्याskippedExecRefs: छोड़े गए exec refs की संख्या क्योंकि--allow-execसेट नहीं थाerrors: जबok=falseहो, तब structured missing-path, schema, या resolvability विफलताएं
JSON आउटपुट आकार
- सफलता उदाहरण
- विफलता उदाहरण
यदि dry-run विफल हो
यदि dry-run विफल हो
config schema validation failed: आपका post-change config shape अमान्य है; path/value या provider/ref object shape ठीक करें।Config policy validation failed: unsupported SecretRef usage: उस credential को वापस plaintext/string input में ले जाएं और SecretRefs को केवल समर्थित सतहों पर रखें।SecretRef assignment(s) could not be resolved: संदर्भित provider/ref वर्तमान में resolve नहीं हो सकता (missing env var, invalid file pointer, exec provider failure, या provider/source mismatch)।Dry run note: skipped <n> exec SecretRef resolvability check(s): dry-run ने exec refs छोड़ दिए; यदि आपको exec resolvability validation चाहिए तो--allow-execके साथ फिर चलाएं।- बैच मोड के लिए, failing entries ठीक करें और लिखने से पहले
--dry-runफिर चलाएं।
लिखने की सुरक्षा
openclaw config set और अन्य OpenClaw-owned config writers पूरी post-change config को डिस्क पर commit करने से पहले validate करते हैं। यदि नया payload schema validation में विफल होता है या destructive clobber जैसा दिखता है, तो active config को बिना बदले छोड़ दिया जाता है और rejected payload को उसके पास openclaw.json.rejected.* के रूप में सहेजा जाता है।
छोटे edits के लिए CLI writes को प्राथमिकता दें:
openclaw.json को rewrite नहीं करता। prefixed/clobbered config को repair करने या last-known-good copy restore करने के लिए openclaw doctor --fix चलाएं। Gateway troubleshooting देखें।
Whole-file recovery doctor repair के लिए reserved है। Plugin schema changes या minHostVersion skew, models, providers, auth profiles, channels, gateway exposure, tools, memory, browser, या cron config जैसी unrelated user settings को rollback करने के बजाय loud रहते हैं।
उपकमांड
config file: active config file path प्रिंट करें (OPENCLAW_CONFIG_PATHया default location से resolved)। path को regular file का नाम देना चाहिए, symlink का नहीं।
Validate
gateway शुरू किए बिना current config को active schema के विरुद्ध validate करें।openclaw config validate पास होने के बाद, आप उसी terminal से प्रत्येक change validate करते समय embedded agent से active config की docs से तुलना करवाने के लिए local TUI का उपयोग कर सकते हैं:
यदि validation पहले से fail हो रहा है, तो
openclaw configure या openclaw doctor --fix से शुरू करें। openclaw chat invalid-config guard को bypass नहीं करता।docs से तुलना करें
agent से कहें कि आपके current config की relevant docs page से तुलना करे और सबसे छोटा fix सुझाए।