# Distribution and versioning Exporting, adopting and upgrading an instance, and the version and changelog of the stack itself. ## Contents - [`dist export`](#dist-export) - [`dist adopt`](#dist-adopt) - [`dist upgrade`](#dist-upgrade) - [`version show`](#version-show) - [`version check`](#version-check) - [`version notes`](#version-notes) - [`version bump`](#version-bump) - [`version regrade`](#version-regrade) - [`version release`](#version-release) ## `dist export` Write a contentless, distributable copy of this repo's machinery. **Synopsis** - `wikitool dist export [--dry-run] [--source-repo U] [--source-commit SHA] [--release-url U] [--update-url U]` **Options** ```text Arguments: target Directory to write the distribution into. Must not exist, or must be empty. [required] Options: --dry-run List what would be written, without writing anything. --source-repo Repository this export was built from (recorded in the stamp) --source-commit Commit this export was built from (recorded in the stamp) --release-url Release page this export ships as (recorded in the stamp) --update-url Release feed `version check` should ask (recorded in the stamp) -h, --help Show this message and exit. ``` **Examples** ```bash tools/wikitool dist export ../my-wiki --dry-run tools/wikitool dist export ../my-wiki ``` **Behaviour** - Writes a contentless, distributable copy of this repo's machinery into an empty or new `` directory. - Ships `AGENTS.md`/`README.md`/`INSTALL.md` with any `dist:strip-start`...`dist:strip-end` marker region removed, `instructions/` (minus `instructions/dev/`), `types/` (the `root: kb` page type-specs, their schemas and their subtype templates `types/..md` re-keyed as `.template`, the stack's own verbatim), `docs/` verbatim (minus `docs/dev/`), `tools/` (no venv/caches, and not the dev-only test suite `tools/chemenu/tests/` with its `pytest.ini`/`.coveragerc`), the `.github/hooks/`+`.vibe/` session-tracing config plus `.claude/settings.json`, `kb/CONTRACT.md` (no pages, no areas) and `VERSION`. - Ships `raw/` and `incoming/` as flat roots, each with a `.gitkeep` and no subdirectories. `incoming/.gitkeep` is trackable and survives becoming a git repository, so a plain clone gets the directory without any bootstrap step. - Ships templates, never the filled files: `USER.md.template`/`SOUL.md.template`, `kb/CONVENTIONS.md.template`, and each collection's contract re-keyed as `kb//COLLECTION.md.template`. The filled `USER.md`/`SOUL.md`/`kb/CONVENTIONS.md`/`kb//COLLECTION.md`/`types/.md`/`types/..md` bind their instance; `find_leaks` refuses a plan carrying one. - Writes a generated `.wikitool-release.json` stamp: version, export date, origin, and a sha256 per exported file - the base a later upgrade compares against. - The four origin options only fill stamp fields: `export` never calls git and cannot discover them. - A build and test tool: every release is an export packed as a tarball, and an instance is installed from such a release, never from an export directly. - One-way: no command reconstructs a distributed instance into a dev instance - work on the stack in a clone of the origin repo. - `--dry-run` lists every file it would write, and writes nothing. **Properties** - Changes files: yes - Idempotent: yes - Atomic: Yes - nothing is written until every file is planned - Counts toward the session call budget: yes - Can reach the network: no **Exit codes** - `0` - success - `1` - `` exists and is not empty, or is not a directory - `1` - The tree has no readable `VERSION` - `1` - A licence file is missing from the source tree - `1` - The plan would carry this instance's own data (a filled personalization, conventions or page type-spec file) **See also** - `instructions/setup-instance.md` - installs a release, which is this export as a tarball - `wikitool dist upgrade` - applies a later export to an existing instance - `wikitool version show` - reads the stamp this writes ## `dist adopt` Take shipped templates as this instance's own: copy each to its unsuffixed name. **Synopsis** - `wikitool dist adopt [