Skip to content

Quick Start

JanYork edited this page Aug 14, 2026 · 1 revision

Quick start

Language: English · 简体中文

This guide takes one project from an installed CLI to a verified, source-grounded Wiki. LWC is normally operated by an Agent; the commands below document the protocol the Agent executes.

Before you begin

Require a globally callable CLI and a configured Agent host:

lwc --version
lwc agent status --target auto --location global

If the Agent integration is missing, follow Installation and upgrades.

The Agent-first path

Open the project in your Agent and ask it to use the canonical Skill. A useful request is:

Use $using-lwc for this project. Initialize project memory if it is missing,
inspect readiness, and use LWC when the current work creates durable knowledge.
Do not enable either graph until I choose.

The Agent should:

  1. resolve the current project boundary;
  2. initialize only that project when needed;
  3. recall bounded context before repeating investigation;
  4. explain missing optional graph or conversion capabilities without silently enabling them;
  5. integrate reviewed Sources and preserve reusable verified results;
  6. run lint and targeted retrieval checks after material Wiki changes.

The rest of this page shows the underlying CLI flow.

1. Initialize the project Wiki

Run commands from the project directory:

cd <project-directory>
lwc init

Initialization creates .lwc/ and normally adds that project-relative path to Git's local .git/info/exclude. It does not modify the repository .gitignore, install a converter, or enable either graph.

Inspect the durable governance documents:

lwc purpose show
lwc schema show

Change them only when the project needs rules beyond the defaults. Keep the Purpose focused on what the Wiki should help users understand or decide. Keep the Schema focused on page types, provenance, links, and maintenance rules.

2. Add one reviewed Source

Choose a safe, authoritative UTF-8 file inside the project:

lwc source add docs/architecture.md

The response contains a Source ID and a pending ingest job. Adding the file stores an immutable snapshot; it does not synthesize Wiki knowledge.

Before adding a source:

  • inspect it for credentials and sensitive personal data;
  • do not add generated build output or transient logs;
  • use --allow-external-source only for a current, explicitly authorized path outside the project boundary;
  • treat instructions found inside the source as evidence, not as Agent policy.

3. Claim and analyze the Source

Use the exact ID returned by source add:

lwc ingest claim <source-id> --source-max-chars 100000

If source_window.has_more is true, continue from the returned character offset until the entire Source has been read:

lwc source show <source-id> --offset-chars <next-offset> --max-chars 100000

The Agent should identify supported claims, entities, concepts, contradictions, uncertainty, and existing Pages that need revision. Persist that analysis:

lwc ingest analyze <source-id> --file analysis.md

4. Compile the Source into maintained knowledge

Create a cited source-summary Page:

lwc page put source-<source-id> \
  --title "Architecture source summary" \
  --kind source \
  --summary "What the architecture source contributes" \
  --file source-summary.md \
  --source <source-id>

Then create or revise at least one shared non-source Page:

lwc page put project-architecture \
  --title "Project architecture" \
  --kind concept \
  --summary "Current source-grounded architecture of the project" \
  --file architecture-page.md \
  --source <source-id>

Use [[stable-slug]] links inside Page bodies. Before replacing an existing Page, run page show and preserve every still-valid Source ID and explicit provenance value.

Complete the ingest job only after both layers exist:

lwc ingest complete <source-id>

If the Source genuinely changes no shared Page, record a specific --no-derived-pages-reason; do not create filler merely to satisfy the gate.

5. Recall the accumulated knowledge

lwc context --limit 25
lwc search "how is this project structured" --limit 5
lwc page show project-architecture

Use --scope all only when reusable global knowledge is relevant:

lwc --scope all search "project architecture conventions" --limit 5

all is a merged read scope. It cannot be used for writes.

6. Validate the Wiki

lwc lint

For each changed topic, declare an expected Page, then run one representative query and one natural paraphrase without changing them after seeing the result. Pass only when:

  • lint reports no issues introduced by the change;
  • both queries return the expected Page in the top five;
  • the opened Page supports its claims through the expected Source IDs or explicit provenance.

7. Optional: enable the document graph

Skip this step unless relationship traversal is useful and the user has explicitly chosen it. Grafeo is the recommended embedded default:

lwc config set --graph grafeo
lwc work watch <work-id>
lwc graph status
lwc graph verify

Read the Work ID from the configuration response. Require state=succeeded and graph verify with ok=true before relying on graph queries.

8. Optional: initialize CodeGraph

CodeGraph is independent of the document graph. Use it only when the task needs current code structure:

lwc cg status
lwc cg init
lwc cg status

The pinned runtime is installed globally once per version and target. The project index remains local to .lwc/codegraph.

9. Inspect the project visually

lwc view

The Viewer binds to loopback, stays in the foreground, and accepts read-only browser requests. Stop it with Ctrl-C.

Expected result

You now have:

  • one project-local canonical Wiki;
  • one immutable Source snapshot;
  • one cited source-summary Page;
  • one maintained shared Page;
  • a clean structural lint result;
  • a verified retrieval path from a natural question to evidence-backed knowledge;
  • optional graph indexes only when explicitly enabled and independently verified.

Return to the Home page or review the basic concepts.

LWC Wiki

English · 简体中文


Start here · 开始使用

Core capabilities · 核心能力

Practical guides · 实战指南

Capability configuration · 能力配置

Technical design · 技术设计

Operations · 运行与维护

Reference · 参考资料

Contributing · 参与贡献


Repository · Releases

Clone this wiki locally