Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion data/help/commands/archive/list.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Use when:
- You need objects of a kind without a text query, such as all chapters or all entities.

Usage:
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--all] [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]

Returns:
- URI-addressable objects in document order.
Expand All @@ -24,10 +24,13 @@ Notes:
- Use `search` when you have query text.
- Add `--evidence` or `--evidence <n>` to include source evidence previews on entity and triple results.
- Add `--backlinks` to include reverse references on top-level source results; nested evidence sources are not expanded.
- Add `--all --jsonl` to stream every result page. With `--all`, `--limit` controls page size.
- Avoid `--all` without `--jsonl` for large results; it buffers all result objects before printing.
- Use `wikigraph next <cursor>` for any returned `nextCursor`.
- Use `wikigraph help uri` before constructing Wiki Graph URIs; bare filesystem paths are not valid object command inputs.

Examples:
wikigraph wkg:///books/book.wikg/chapter list
wikigraph wkg:///books/book.wikg/chapter list --all --jsonl
wikigraph wkg:///books/book.wikg/chapter/3/entity list --json
wikigraph wkg:///books/book.wikg/triple/_/_/Q178561 list
10 changes: 6 additions & 4 deletions data/help/commands/archive/search.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Use when:
- You have words, names, phrases, or concepts and need candidate object URIs.

Usage:
wikigraph <archive-uri> search <query> [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <chapter-uri> search <query> [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <archive-uri>/<entity|triple|source|summary|chunk> search <query> [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <chapter-uri>/<entity|triple|source|summary|chunk> search <query> [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <archive-uri> search <query> [--all] [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <chapter-uri> search <query> [--all] [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <archive-uri>/<entity|triple|source|summary|chunk> search <query> [--all] [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]
wikigraph <chapter-uri>/<entity|triple|source|summary|chunk> search <query> [--all] [--limit <n>] [--evidence [n]] [--backlinks] [--cursor <token>] [--json|--jsonl] [--help|-h]

Returns:
- In text output, a ranked list of full `wkg://...` URIs.
Expand All @@ -28,6 +28,8 @@ Notes:
- Put the lens after a chapter URI, such as `<chapter-uri>/entity`, to keep retrieval local to one chapter.
- Add `--evidence` or `--evidence <n>` to include source evidence previews on entity and triple results.
- Add `--backlinks` to include reverse references on top-level source results; nested evidence sources are not expanded.
- Add `--all --jsonl` to stream every result page. With `--all`, `--limit` controls page size.
- Avoid `--all` without `--jsonl` for large results; it buffers all result objects before printing.
- Use `wikigraph next <cursor>` for any returned `nextCursor`.
- Use a located chapter URI to keep retrieval local.
- Read `wikigraph help uri` before constructing Wiki Graph URIs; bare filesystem paths are not valid object command inputs.
Expand Down
22 changes: 12 additions & 10 deletions data/help/commands/maintenance/chapter/list.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@ Command: wikigraph <archive-uri>/chapter list
chapter list

Purpose:
List every chapter in the `.wikg` chapter tree.
List every chapter and its stored artifact readiness.

Usage:
wikigraph <archive-uri>/chapter list [--json] [--llm <json>] [--help|-h]
wikigraph <archive-uri>/chapter list [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl] [--llm <json>] [--help|-h]

Output shape:
[<chapterId>] <stage> <title-or-[untitled]>
With `--json`, prints `{ "chapters": [...] }`.
wkg://chapter/<id> <title-or-[untitled]> source:<ready|missing> reading-graph:<ready|missing> reading-summary:<ready|missing> knowledge-graph:<ready|missing>

With `--jsonl`, each chapter is one JSON object with `uri`, `title`, and `state`.

Behavior:
- Includes summary-stage and unfinished chapters.
- Indents child chapters under their parent.
- The bracketed number is the chapter id used in chapter URIs.
- Includes sourced, generated, and unfinished chapters.
- Use `--all --jsonl` for grep/jq-style readiness checks across every chapter.
- With `--all`, `--limit` controls page size. Avoid `--all` without `--jsonl` for large results.
- Chapter ids are encoded in the returned `wkg://chapter/<id>` URIs.
- Does not call an LLM provider.
- Does not mutate chapter content or summaries.

Use this before mutation:
Discover ids with:
wikigraph <archive-uri>/chapter list
Discover ids and missing generated artifacts with:
wikigraph <archive-uri>/chapter list --all --jsonl
wikigraph <archive-uri>/chapter list --all --jsonl | jq 'select(.state["knowledge-graph"] == "missing")'

See also:
- wikigraph wkg://book.wikg/state get --help
- wikigraph wkg://book.wikg/chapter/3/state get --help
- wikigraph help command
11 changes: 5 additions & 6 deletions data/help/commands/root.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Object workflow:
- `pack` builds bounded Agent-readable context around one graph object URI.

Object commands:
wikigraph <located-wkg-uri> search <query> [--limit <n>] [--cursor <token>] [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> search <query> [--limit <n>] [--cursor <token>] [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <located-wkg-uri>/triple/<subject|_>/<predicate|_>/<object|_> search <query> [--limit <n>] [--cursor <token>] [--evidence [n]] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--limit <n>] [--cursor <token>] [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <located-wkg-uri>/triple/<subject|_>/<predicate|_>/<object|_> list [--limit <n>] [--cursor <token>] [--evidence [n]] [--json|--jsonl]
wikigraph <located-wkg-uri> search <query> [--all] [--limit <n>] [--cursor <token>] [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> search <query> [--all] [--limit <n>] [--cursor <token>] [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <located-wkg-uri>/triple/<subject|_>/<predicate|_>/<object|_> search <query> [--all] [--limit <n>] [--cursor <token>] [--evidence [n]] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--all] [--limit <n>] [--cursor <token>] [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <located-wkg-uri>/triple/<subject|_>/<predicate|_>/<object|_> list [--all] [--limit <n>] [--cursor <token>] [--evidence [n]] [--json|--jsonl]
wikigraph <object-uri> get [--evidence [n]] [--backlinks] [--json|--jsonl]
wikigraph <chunk-uri|entity-uri> related [query] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
wikigraph <entity|triple|summary|chunk-uri> evidence [query] [--limit <n>] [--cursor <token>] [--json|--jsonl]
Expand All @@ -40,7 +40,6 @@ Archive commands:
wikigraph <archive-uri> create [source] [--input-format <format>] [--llm <json>] [--prompt <text>]
wikigraph <archive-uri> export --output-format <format> [--output <path>]
wikigraph <archive-uri> estimate [--stage <source|reading-graph|reading-summary>] [--json]
wikigraph <archive-uri>/state get [--json]
wikigraph transform [--input <path>] [--output <path>] [--input-format <format>] [--output-format <format>] [--digest-dir <path>] [--llm <json>] [--prompt <text>] [--stage <stage>] [--verbose|-v]

Generation queue:
Expand Down
4 changes: 2 additions & 2 deletions data/help/topics/ai.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Default exploration loop:

Archive and job commands also use URI targets:
wikigraph wkg://book.wikg create ./book.md
wikigraph wkg://book.wikg/state get --json
wikigraph wkg://book.wikg/chapter list --all --jsonl
wikigraph wkg://book.wikg/chapter/3 queue add --task reading-graph --accept-cost
wikigraph wkg-job:// list
wikigraph wkg-job://<job-id> watch --jsonl
Expand All @@ -46,4 +46,4 @@ Use URI lenses to select searchable object kinds:
wkg://book.wikg/triple
wkg://book.wikg/chapter/3/entity

Use `--json` or `--jsonl` when a stable machine-readable result is needed.
Use `--json` or `--jsonl` when a stable machine-readable result is needed. Use `--all --jsonl` for full streamed list/search exports.
1 change: 0 additions & 1 deletion data/help/topics/command.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Archive commands:
wikigraph <archive-uri> create
wikigraph <archive-uri> export
wikigraph <archive-uri> estimate
wikigraph <archive-uri>/state get
wikigraph transform [options]

Generation:
Expand Down
4 changes: 2 additions & 2 deletions data/help/topics/troubleshoot.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Topic: troubleshoot
Troubleshooting

No search results:
Try fewer keywords, use a broader URI, or inspect archive state and structure with:
wikigraph <archive-uri>/state get
Try fewer keywords, use a broader URI, or inspect chapter readiness and structure with:
wikigraph <archive-uri>/chapter list --all --jsonl
wikigraph <archive-uri>/chapter/tree get

Missing generated objects:
Expand Down
2 changes: 1 addition & 1 deletion data/help/topics/uri.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Object command examples:
Archive command examples:
Create or inspect an archive:
wikigraph wkg://book.wikg create ./book.md
wikigraph wkg://book.wikg/state get --json
wikigraph wkg://book.wikg/chapter list --all --jsonl
wikigraph wkg://book.wikg/chapter/tree get --json

Job URIs:
Expand Down
14 changes: 8 additions & 6 deletions docs/en/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ wikigraph wkg-job://<job-id> <action> ...
```bash
wikigraph <archive-uri> create [source] [--input-format <format>] [--llm <json>] [--prompt <text>]
wikigraph <archive-uri> estimate [--stage <source|reading-graph|reading-summary>] [--json]
wikigraph <archive-uri>/state get [--json]
wikigraph <located-wkg-uri> search <query> [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> search <query> [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri> search <query> [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> search <query> [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <object-uri> get [--json|--jsonl]
wikigraph <chunk-uri> related [query] [--evidence [n]] [--json|--jsonl]
wikigraph <entity-uri> related [query] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
Expand Down Expand Up @@ -47,6 +46,8 @@ Search and collection behavior:
- For content understanding, choose a search lens in the URI: `<archive-uri>/chunk` for Reading Graph structure, `<archive-uri>/summary` for quick overview, `<archive-uri>/source` for original source wording, or `<archive-uri>/entity` and `<archive-uri>/triple` for Knowledge Graph objects.
- Use a chapter scope URI such as `wkg:///Users/me/book.wikg/chapter/12` to keep search or list local to one chapter.
- `--limit` defaults to `20`; pass returned `nextCursor` back through `--cursor` for the next page.
- Use `--all --jsonl` to stream every `search` or `list` page. With `--all`, `--limit` controls page size.
- Avoid `--all` without `--jsonl` for large results because it buffers all result objects before printing.
- Search does not do semantic expansion, stemming, or vector search.
- Read `wikigraph help uri` for the URI grammar and object boundary rules.

Expand Down Expand Up @@ -111,7 +112,8 @@ Maintenance commands use URI targets:
```bash
wikigraph <archive-uri> get|set [metadata options]
wikigraph <cover-uri> get
wikigraph <archive-uri>/chapter list|add [options]
wikigraph <archive-uri>/chapter list [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <archive-uri>/chapter add [options]
wikigraph <chapter-uri>/state get [--json]
wikigraph <chapter-uri> move|remove|reset [options]
wikigraph <chapter-uri>/source set [--input <path>] --input-format <format>
Expand All @@ -122,7 +124,7 @@ wikigraph <archive-uri>/chapter/tree get|set [options]

Use URI-first commands for routine exploration. `<archive-uri>/chapter/tree get` is read-only structure inspection and prints a stable JSON tree with `title: null` for untitled chapters. `<archive-uri>/chapter/tree set` can reorder chapters and change titles when `title` is present.

`wikigraph config status` prints configuration status. `wikigraph <archive-uri>/state get` prints archive state.
`wikigraph config status` prints configuration status.

## Standard Stream Rules

Expand Down
14 changes: 8 additions & 6 deletions docs/zh-CN/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ wikigraph wkg-job://<job-id> <action> ...
```bash
wikigraph <archive-uri> create [source] [--input-format <format>] [--llm <json>] [--prompt <text>]
wikigraph <archive-uri> estimate [--stage <source|reading-graph|reading-summary>] [--json]
wikigraph <archive-uri>/state get [--json]
wikigraph <located-wkg-uri> search <query> [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> search <query> [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri> search <query> [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> search <query> [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <located-wkg-uri>/<chapter|entity|triple|source|summary|chunk> list [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <object-uri> get [--json|--jsonl]
wikigraph <chunk-uri> related [query] [--evidence [n]] [--json|--jsonl]
wikigraph <entity-uri> related [query] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
Expand Down Expand Up @@ -47,6 +46,8 @@ wikigraph queue clean
- 做内容理解时,在 URI 中选择 search lens:`<archive-uri>/chunk` 用于 Reading Graph 结构,`<archive-uri>/summary` 用于快速概览,`<archive-uri>/source` 用于原文措辞,`<archive-uri>/entity` 和 `<archive-uri>/triple` 用于 Knowledge Graph 对象。
- 使用 chapter scope URI,例如 `wkg:///Users/me/book.wikg/chapter/12`,把 search 或 list 限定在一个章节内。
- `--limit` 默认 `20`;下一页把返回的 `nextCursor` 传给 `--cursor`。
- 用 `--all --jsonl` 流式输出 `search` 或 `list` 的所有分页。使用 `--all` 时,`--limit` 控制每页大小。
- 大结果避免使用不带 `--jsonl` 的 `--all`,因为它会先缓存所有 result object 再输出。
- Search 不做语义扩展、词干匹配或向量搜索。
- URI 语法和 object boundary 规则见 `wikigraph help uri`。

Expand Down Expand Up @@ -111,7 +112,8 @@ wikigraph transform [--input <path>] [--output <path>] [--input-format <format>]
```bash
wikigraph <archive-uri> get|set [metadata options]
wikigraph <cover-uri> get
wikigraph <archive-uri>/chapter list|add [options]
wikigraph <archive-uri>/chapter list [--all] [--limit <n>] [--cursor <token>] [--json|--jsonl]
wikigraph <archive-uri>/chapter add [options]
wikigraph <chapter-uri>/state get [--json]
wikigraph <chapter-uri> move|remove|reset [options]
wikigraph <chapter-uri>/source set [--input <path>] --input-format <format>
Expand All @@ -122,7 +124,7 @@ wikigraph <archive-uri>/chapter/tree get|set [options]

常规探索请使用 URI-first commands。`<archive-uri>/chapter/tree get` 是只读结构检查,会输出稳定 JSON tree,未命名章节显示为 `title: null`。`<archive-uri>/chapter/tree set` 可以重排章节,并在节点包含 `title` 时修改标题。

`wikigraph config status` 输出配置状态。`wikigraph <archive-uri>/state get` 输出归档状态。
`wikigraph config status` 输出配置状态。

## 标准流规则

Expand Down
Loading
Loading