docs(config): quote bracket config paths (#83058) · openc...
leno23
·
2026-05-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,7 @@ openclaw config get browser.executablePath
|
31 | 31 | openclaw config set browser.executablePath "/usr/bin/google-chrome" |
32 | 32 | openclaw config set browser.profiles.work.executablePath "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" |
33 | 33 | openclaw config set agents.defaults.heartbeat.every "2h" |
34 | | -openclaw config set agents.list[0].tools.exec.node "node-id-or-name" |
| 34 | +openclaw config set 'agents.list[0].tools.exec.node' "node-id-or-name" |
35 | 35 | openclaw config set agents.defaults.models '{"openai/gpt-5.4":{}}' --strict-json --merge |
36 | 36 | openclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN |
37 | 37 | openclaw config set secrets.providers.vaultfile --provider-source file --provider-path /etc/openclaw/secrets.json --provider-mode json |
@@ -73,18 +73,18 @@ openclaw config schema > openclaw.schema.json
|
73 | 73 | |
74 | 74 | ### Paths |
75 | 75 | |
76 | | -Paths use dot or bracket notation: |
| 76 | +Paths use dot or bracket notation. Quote bracket-notation paths in shell examples so shells such as zsh do not expand `[0]` as a glob before OpenClaw receives the path: |
77 | 77 | |
78 | 78 | ```bash |
79 | 79 | openclaw config get agents.defaults.workspace |
80 | | -openclaw config get agents.list[0].id |
| 80 | +openclaw config get 'agents.list[0].id' |
81 | 81 | ``` |
82 | 82 | |
83 | 83 | Use the agent list index to target a specific agent: |
84 | 84 | |
85 | 85 | ```bash |
86 | 86 | openclaw config get agents.list |
87 | | -openclaw config set agents.list[1].tools.exec.node "node-id-or-name" |
| 87 | +openclaw config set 'agents.list[1].tools.exec.node' "node-id-or-name" |
88 | 88 | ``` |
89 | 89 | |
90 | 90 | ## Values |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -396,14 +396,14 @@ Per-agent override:
|
396 | 396 | |
397 | 397 | ```bash |
398 | 398 | openclaw config get agents.list |
399 | | -openclaw config set agents.list[0].tools.exec.node "node-id-or-name" |
| 399 | +openclaw config set 'agents.list[0].tools.exec.node' "node-id-or-name" |
400 | 400 | ``` |
401 | 401 | |
402 | 402 | Unset to allow any node: |
403 | 403 | |
404 | 404 | ```bash |
405 | 405 | openclaw config unset tools.exec.node |
406 | | -openclaw config unset agents.list[0].tools.exec.node |
| 406 | +openclaw config unset 'agents.list[0].tools.exec.node' |
407 | 407 | ``` |
408 | 408 | |
409 | 409 | ## Permissions map |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -145,7 +145,7 @@ Per-agent node binding (use the agent list index in config):
|
145 | 145 | |
146 | 146 | ```bash |
147 | 147 | openclaw config get agents.list |
148 | | -openclaw config set agents.list[0].tools.exec.node "node-id-or-name" |
| 148 | +openclaw config set 'agents.list[0].tools.exec.node' "node-id-or-name" |
149 | 149 | ``` |
150 | 150 | |
151 | 151 | Control UI: the Nodes tab includes a small "Exec node binding" panel for the same settings. |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import fs from "node:fs/promises"; |
| 2 | +import path from "node:path"; |
| 3 | +import { describe, expect, it } from "vitest"; |
| 4 | + |
| 5 | +const DOCS_WITH_CONFIG_PATH_EXAMPLES = [ |
| 6 | +"docs/cli/config.md", |
| 7 | +"docs/tools/exec.md", |
| 8 | +"docs/nodes/index.md", |
| 9 | +]; |
| 10 | + |
| 11 | +function findUnquotedBracketPathExamples(markdown: string, docPath: string): string[] { |
| 12 | +const failures: string[] = []; |
| 13 | + |
| 14 | +for (const [index, line] of markdown.split(/\r?\n/).entries()) { |
| 15 | +const match = line.match(/\bopenclaw\s+config\s+(?:get|set|unset)\s+(\S+)/); |
| 16 | +if (!match) { |
| 17 | +continue; |
| 18 | +} |
| 19 | + |
| 20 | +const pathArg = match[1]; |
| 21 | +if (pathArg.includes("[") && !pathArg.startsWith("'") && !pathArg.startsWith('"')) { |
| 22 | +failures.push(`${docPath}:${index + 1}: ${pathArg}`); |
| 23 | +} |
| 24 | +} |
| 25 | + |
| 26 | +return failures; |
| 27 | +} |
| 28 | + |
| 29 | +describe("config path docs", () => { |
| 30 | +it("quotes bracket-notation config paths in shell examples", async () => { |
| 31 | +const failures: string[] = []; |
| 32 | + |
| 33 | +for (const docPath of DOCS_WITH_CONFIG_PATH_EXAMPLES) { |
| 34 | +const markdown = await fs.readFile(path.join(process.cwd(), docPath), "utf8"); |
| 35 | +failures.push(...findUnquotedBracketPathExamples(markdown, docPath)); |
| 36 | +} |
| 37 | + |
| 38 | +expect(failures).toEqual([]); |
| 39 | +}); |
| 40 | +}); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。