dw-init
dw-init
Guided setup. Run the diffwiki CLI for every mutation — never edit registry/state files directly. Read references/setup.md for exact commands.
Steps
-
Detect context. Run
git rev-parse --show-toplevel 2>/dev/nullto see if we're in a repo, anddiffwiki collection listto show existing collections. Seed the authoring templates (idempotent, never overwrites):diffwiki templates init. -
Ask location (AskUserQuestion, "Where should this wiki live?"):
- In this repo (recommended when in a repo) — an in-repo collection under
wiki/or your preferred in-repo location, tracked in git with the code. - Global — a collection under in your global git backed wiki (
~/.diffwiki/collections), shared across projects.
- In this repo (recommended when in a repo) — an in-repo collection under
-
Create it.
- In-repo: ask for the collection name (default = repo name) and path (default
wiki), then rundiffwiki collection init -c <name> -p <path>. - Global: ask for the name, then
diffwiki collection create <name>.
- In-repo: ask for the collection name (default = repo name) and path (default
-
Set recall context (only meaningful in-repo). Show the current
diffwiki collection listand ask (multi-select) which collectionsdw-recallshould search from within this repo — typically this repo's collection plus any collections dedicated to the topic (language, framework, or subject). Apply it withdiffwiki context set <a,b,c>(seereferences/setup.md) — never hand-editdiffwiki.yaml. -
Offer indexing. If a search plugin is installed (
diffwiki plugin list), offer to rundiffwiki search index.