docs(oc-path): explain why path addressing helps · openclaw/openclaw@696540f
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,6 +30,20 @@ first use:
|
30 | 30 | openclaw plugins enable oc-path |
31 | 31 | ``` |
32 | 32 | |
| 33 | +## Why use it |
| 34 | + |
| 35 | +OpenClaw state is spread across human-edited markdown, commented JSONC config, |
| 36 | +and append-only JSONL logs. Shell scripts, hooks, and agents often need one |
| 37 | +small value from those files: a frontmatter key, a plugin setting, a log record |
| 38 | +field, or a bullet item under a named section. |
| 39 | + |
| 40 | +`openclaw path` gives those callers a stable address instead of a one-off grep, |
| 41 | +regex, or parser for each file kind. The same `oc://` path can be validated, |
| 42 | +resolved, searched, dry-run, and written from the terminal, which makes narrow |
| 43 | +automation easier to review and safer to replay. It is especially useful when |
| 44 | +you want to update one leaf while preserving the rest of the file's comments, |
| 45 | +line endings, and surrounding formatting. |
| 46 | + |
33 | 47 | ## Subcommands |
34 | 48 | |
35 | 49 | | Subcommand | Purpose | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,6 +24,20 @@ without scripting against the SDK directly; agents and hooks treat it as a
|
24 | 24 | deterministic substrate so byte-fidelity round-trips and the redaction |
25 | 25 | sentinel guard apply uniformly across kinds. |
26 | 26 | |
| 27 | +## Why enable it |
| 28 | + |
| 29 | +Enable `oc-path` when you want scripts, hooks, or local agent tooling to point |
| 30 | +at a precise piece of workspace state without inventing a parser for each file |
| 31 | +shape. A single `oc://` address can name a markdown frontmatter key, a section |
| 32 | +item, a JSONC config leaf, or a JSONL event field. |
| 33 | + |
| 34 | +That matters for maintainer workflows where the change should be small, |
| 35 | +auditable, and repeatable: inspect one value, find matching records, dry-run a |
| 36 | +write, then apply only that leaf while leaving comments, line endings, and |
| 37 | +nearby formatting alone. Keeping this as an opt-in plugin gives power users the |
| 38 | +addressing substrate without putting parser dependencies or CLI surface into |
| 39 | +core for installs that never need it. |
| 40 | + |
27 | 41 | ## Where it runs |
28 | 42 | |
29 | 43 | The plugin runs **in-process inside the `openclaw` CLI** on the host where you |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。