Path
기준일: 2026-07-26
공식 기준: Path
Path 문서는 OpenClaw 공식 문서(cli/path)를 한국어로 정리한 가이드입니다. CLI reference for openclaw path (inspect and edit workspace files via the oc:// addressing scheme) 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
CLI reference for openclaw path (inspect and edit workspace files via the oc:// addressing scheme)
한국어 가이드 범위: cli/path 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- Why use it
- How it is used
- 동작 방식
- 하위 명령
- Global flags
- oc:// syntax
- Addressing by file kind
- Mutation contract
- 예제
- Validate a path (no filesystem access)
- Read a leaf
- Wildcard search
- Dry-run a write
- Dry-run a write as a unified diff
- Apply the write
- Byte-fidelity round-trip (diagnostic)
- Quote keys containing / or .
- Deep JSON/JSONC paths can use slash segments; they normalize to dotted subsegments
- Replace a JSONC leaf with a parsed object
- Predicate search over JSONC children
- Insert into a JSONC array
- Insert a JSONC object key
- Append a JSONL event
- Resolve the last JSONL value line
- Resolve a YAML workflow step
- Update a YAML scalar
- Address markdown frontmatter
- Insert markdown frontmatter
- Find markdown item fields
- Validate a session-scoped path
상세 내용
openclaw path
Shell access to the oc:// addressing scheme: one kind-dispatched path syntax for inspecting and editing addressable workspace files (markdown, jsonc, jsonl, yaml/yml/lobster). Self-hosters, plugin authors, and editor extensions use it to read, find, or update a narrow location without hand-rolling a per-file parser.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
resolveis concrete and single-match.findis the multi-match verb for wildcards, unions, predicates, andsetonly accepts concrete paths or insertion markers; wildcard patternsvalidateparses a path with no filesystem access.emitround-trips a file through parse + emit (byte-fidelity diagnostic).
openclaw plugins enable oc-path
Why use it
OpenClaw state is spread across human-edited markdown, commented JSONC config, append-only JSONL logs, and YAML workflow/spec files. Scripts, hooks, and agents often need one small value from those files: a frontmatter key, a plugin setting, a log record field, a YAML step, or a bullet item under a named section.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- A hook reads one setting from commented JSONC without losing comments when
- A maintenance script finds every matching event field in a JSONL log
- An editor jumps to a markdown section or bullet item by slug, then renders
- An agent dry-runs a small workspace edit before applying it, with the
How it is used
Read one value from a human-edited config file:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
openclaw path resolve 'oc://config.jsonc/plugins/github/enabled'
openclaw path set 'oc://config.jsonc/plugins/github/enabled' 'true' --dry-run
openclaw path find 'oc://session.jsonl/[event=tool_call]/name'
openclaw path resolve 'oc://AGENTS.md/runtime-safety/openclaw-gateway'
동작 방식
- Parses the
oc://address into slots: file, section, item, field, and an optional session query. 2. Chooses the file-kind adapter from the target extension (.md,.jsonc,.json,.jsonl,.ndjson,.yaml,.yml,.lobster). 3. Resolves the slots against that file kind's structure: markdown headings/items, JSONC object keys/array indexes, JSONL line records, or YAML map/sequence nodes. 4. Forset, emits edited bytes through the same adapter so untouched parts of the file keep their comments, line endings, and nearby formatting where the kind supports it.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
하위 명령
| Subcommand | Purpose |
|---|---|
resolve <oc-path> |
Print the concrete match at the path (or "not found"). |
find <pattern> |
Enumerate matches for a wildcard / union / predicate path. |
set <oc-path> <value> |
Write a leaf or insertion target at a concrete path. Supports --dry-run. |
validate <oc-path> |
Parse-only; print the structural breakdown (file / section / item / field). |
emit <file> |
Round-trip a file through parse + emit (byte-fidelity diagnostic). |
Global flags
validate takes only --json / --human; it does no filesystem access, so --cwd and --file do not apply.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
| Flag | Applies to | Purpose |
|---|---|---|
--cwd <dir> |
resolve, find, set, emit |
Resolve the file slot against this directory (default: process.cwd()). |
--file <path> |
resolve, find, set, emit |
Override the file slot's resolved path (absolute access). |
--json |
all | Force JSON output (default when stdout is not a TTY). |
--human |
all | Force human output (default when stdout is a TTY). |
--value-json |
set |
Parse <value> as JSON for JSON/JSONC/JSONL leaf replacement. |
--dry-run |
set |
Print the bytes that would be written without writing. |
--diff |
set (requires --dry-run) |
Print a unified diff instead of the full bytes. |
oc:// syntax
Slot rules: field requires item, and item requires section. Across all four slots:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Quoted segments —
"a/b.c"survives/and.separators. Content is - Predicates —
[k=v],[k!=v],[k<v],[k<=v],[k>v],[k>=v]. - Unions —
{a,b,c}matches any of the alternatives. - Wildcards —
*(single sub-segment) and**(zero-or-more, - Positional —
$first/$lastresolve to the first / last index or - Ordinal —
#Nfor the Nth match by document order. - Insertion markers —
+,+key,+nnnfor keyed / indexed insertion - Session scope —
?session=cron-dailyetc. Orthogonal to slot nesting.
oc://FILE/SECTION/ITEM/FIELD?session=SCOPE
Addressing by file kind
resolve returns a structured match: root, node, leaf, or insertion-point, with a 1-based line number. Leaf values are surfaced as text plus a leafType so plugin authors can render previews without depending on the per-kind AST shape.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
| Kind | File extensions | Addressing model |
|---|---|---|
| Markdown | .md |
H2 sections by slug, bullet items by slug or #N, frontmatter via [frontmatter]. |
| JSONC/JSON | .jsonc, .json |
Object keys and array indexes; dots split nested sub-segments unless quoted. |
| JSONL | .jsonl, .ndjson |
Top-level line addresses (L1, L2, $first, $last), then JSONC-style descent inside the line. |
| YAML/.lobster | .yaml, .yml, .lobster |
Map keys and sequence indexes; comments and flow style are handled by the YAML document API. |
Mutation contract
leaves. Markdown insertions append sections, frontmatter keys, or section items and render a canonical markdown shape for the changed file. Section bodies are not writable as a whole through set.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Markdown frontmatter values and
- key: valueitem fields are string - JSONC leaf writes coerce the string value to the existing leaf type
- JSONL leaf writes coerce like JSONC inside a line. Whole-line replacement
- YAML leaf writes coerce to the existing scalar type (
string, finite
예제
### Validate a path (no filesystem access)
openclaw path validate 'oc://AGENTS.md/Tools/$last/risk'
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
### Read a leaf
openclaw path resolve 'oc://gateway.jsonc/version'
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
### Wildcard search
openclaw path find 'oc://session.jsonl/*/event' --file ./logs/session.jsonl
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
### Dry-run a write
openclaw path set 'oc://gateway.jsonc/version' '2.0' --dry-run
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
### Dry-run a write as a unified diff
openclaw path set 'oc://gateway.jsonc/version' '2.0' --dry-run --diff
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
### Apply the write
openclaw path set 'oc://gateway.jsonc/version' '2.0'
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
### Byte-fidelity round-trip (diagnostic)
```text
More grammar examples:
Quote keys containing / or .
openclaw path resolve 'oc://config.jsonc/agents.defaults.models/"anthropic/claude-opus-4-7"/alias'
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Deep JSON/JSONC paths can use slash segments; they normalize to dotted subsegments
openclaw path set 'oc://openclaw.json/agents/list/0/tools/exec/security' 'allowlist' --dry-run
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Replace a JSONC leaf with a parsed object
openclaw path set 'oc://openclaw.json/gateway/auth/token' '{"source":"file","provider":"secrets","id":"/test"}' --value-json --dry-run
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Predicate search over JSONC children
openclaw path find 'oc://config.jsonc/plugins/[enabled=true]/id'
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Insert into a JSONC array
openclaw path set 'oc://config.jsonc/items/+1' '{"id":"new","enabled":true}' --dry-run
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Insert a JSONC object key
openclaw path set 'oc://config.jsonc/plugins/+github' '{"enabled":true}' --dry-run
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Append a JSONL event
openclaw path set 'oc://session.jsonl/+' '{"event":"checkpoint","ok":true}' --file ./logs/session.jsonl
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Resolve the last JSONL value line
openclaw path resolve 'oc://session.jsonl/$last/event' --file ./logs/session.jsonl
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Resolve a YAML workflow step
openclaw path resolve 'oc://workflow.yaml/steps/0/id'
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Update a YAML scalar
openclaw path set 'oc://workflow.yaml/steps/$last/id' 'classify-renamed' --dry-run
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Address markdown frontmatter
openclaw path resolve 'oc://AGENTS.md/[frontmatter]/name'
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Insert markdown frontmatter
openclaw path set 'oc://AGENTS.md/[frontmatter]/+description' 'Agent instructions' --dry-run
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Find markdown item fields
openclaw path find 'oc://SKILL.md/Tools/*/send_email'
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Validate a session-scoped path
openclaw path validate 'oc://AGENTS.md/Tools/$last/risk?session=cron-daily' ```
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Recipes by file kind
The same five verbs work across kinds; the addressing scheme dispatches on the file extension.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Markdown
name: drafter description: email drafting agent tier: core
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
도구
bash $ openclaw path resolve 'oc://x.md/[frontmatter]/tier' --file frontmatter.md --human leaf @ L4: "core" (string)
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- gh: GitHub CLI
- curl: HTTP client
- send_email: enabled
JSONC
JSONC edits go through jsonc-parser, so comments and whitespace survive a set. Run with --dry-run first to inspect the bytes before committing. .json files use the same adapter and edit path as .jsonc.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
// config.jsonc
{
"plugins": {
"github": {"enabled": true, "role": "vcs"},
"slack": {"enabled": false, "role": "chat"}
}
}
$ openclaw path resolve 'oc://config.jsonc/plugins/github/enabled' --file config.jsonc --human
leaf @ L4: "true" (boolean)
$ openclaw path set 'oc://config.jsonc/plugins/slack/enabled' 'true' --file config.jsonc --dry-run
--dry-run: would write 142 bytes to /…/config.jsonc
{
"plugins": {
"github": {"enabled": true, "role": "vcs"},
"slack": {"enabled": true, "role": "chat"}
}
}
JSONL
Each line is a record. Address by predicate ([event=action]) when you do not know the line number, or by the canonical LN segment when you do. .ndjson files use the same adapter as .jsonl.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
{"event":"start","userId":"u1","ts":1}
{"event":"action","userId":"u1","ts":2}
{"event":"end","userId":"u1","ts":3}
$ openclaw path find 'oc://session.jsonl/[event=action]/userId' --file session.jsonl --human
1 match for oc://session.jsonl/[event=action]/userId:
oc://session.jsonl/L2/userId → leaf @ L2: "u1" (string)
$ openclaw path resolve 'oc://session.jsonl/L2/ts' --file session.jsonl --human
leaf @ L2: "2" (number)
YAML
### workflow.yaml
command: openclaw.invoke bash $ openclaw path resolve 'oc://workflow.yaml/steps/0/id' --file workflow.yaml --human leaf @ L3: "fetch" (string)
> 위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과 `--help`를 확인하세요.
주요 항목:
- id: fetch
- id: classify
- id: fetch
- id: classify-renamed
```text
Subcommand reference
이 섹션의 세부 항목은 공식 문서 Subcommand reference를 참고하세요.
resolve
Read a single leaf or node. Wildcards are rejected — use find for those. Exits 0 on a match, 1 on a clean miss, 2 on a parse error or refused pattern.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
openclaw path resolve 'oc://AGENTS.md/tools/gh/risk' --human
openclaw path resolve 'oc://gateway.jsonc/server/port' --json
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/cli/path - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
openclaw plugins enable oc-path
openclaw path resolve 'oc://config.jsonc/plugins/github/enabled'
openclaw path set 'oc://config.jsonc/plugins/github/enabled' 'true' --dry-run
openclaw path find 'oc://session.jsonl/[event=tool_call]/name'
openclaw path resolve 'oc://AGENTS.md/runtime-safety/openclaw-gateway'
openclaw path validate 'oc://AGENTS.md/tools/$last/risk'
관련 링크
- 공식 원문: cli/path
- OpenClaw 문서 홈
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.