Update from the template¶
A knowledge base records the template version it was generated from in
.copier-answers.yml (_commit, for example v0.3.0). copier update
brings the changes of later releases into the files the template manages:
the tooling and its tasks, the agent layer, CI and the core schema. Files
the knowledge base owns, such as schema/vocabulary.yaml and every page,
are never touched. The repository layout
lists which is which.
Steps¶
-
Start from a clean working tree. Copier refuses to update a repository with uncommitted changes.
-
Run the update from the repository root:
Copier asks the questions again, with your recorded answers as defaults. Add
--skip-answeredto keep every recorded answer without being asked. To move to a specific release instead of the latest tag, add--vcs-ref v0.4.0.--trustis needed because the template runskb indexafter the update. -
Resolve conflicts. Where both you and the template changed the same lines of a managed file, Copier writes git-style conflict markers into the file:
Edit each file to keep the right lines, and remove the markers. The pre-commit hook
check-merge-conflictrefuses a commit that still has them. If you prefer the rejected hunks in separate.rejfiles, run the update with--conflict rej. -
Refresh the environment and check everything:
uv run poe setup # uv syncs the tooling; pre-commit hook, indexes uv run poe ci # kb check, independent OKF validator, lint, tests, index freshnessUpdating to a release before v0.6.0, run
just setupandjust ciinstead. -
Read the changelog for steps specific to the release, then commit:
If you want to change a managed file for good, change it in your own fork of the template and update from the fork. Local edits to managed files survive updates only as long as Copier can merge them.
Updating to v0.7.0¶
v0.7.0 changes the tooling throughout, adds hooks for Codex and Gemini CLI,
and lints the tooling in CI. The update itself is the usual one; expect a
few conflicts if you edited files under tools/.
- Two new questions. Copier asks
codexandgemini_cli, with the default No. Answer Yes for an agent you use: the update then adds.codex/hooks.jsonor.gemini/settings.json. Both CLIs ask you to trust the project's hooks the first time; see Codex and Gemini CLI. - Commit the lockfile. The tooling has new development dependencies
(ruff, mypy and their type stubs), and CI now installs with
uv sync --locked, which fails whenuv.lockdoes not matchpyproject.toml. After the update, runuv lock(or step 4'suv run poe setup, which writes it too), and commituv.lockwith the update. See The lockfile. uv run poe cilints the tooling. The newlinttask runsruff checkandruff format --checkovertools/andmypyovertools/kbtools/, andciruns it. Code you added undertools/must pass too: runuv run ruff check --fix tools, thenuv run ruff format tools, and fix whatuv run poe lintstill reports, or move your scripts out oftools/.- Conflicts in
tools/. About 30 files of the tooling were reformatted with ruff, besides the changes of this release. If you editedtools/kbtools/ortools/tests/, Copier is likely to report conflicts there (step 3). Prefer the template's version, then apply your change again. .claude/settings.jsonis rewritten. It registers new hooks around Bash commands, runs them aspython -m kbtools.hooks, and denies shell commands that name.envand reads of.env.*(except.env.example). If you changed the file, for exampleKB_ACTOR, check that your change survived the merge, and apply it again if not. The agent can no longer create.envfor you withcp .env.example .env: run that yourself. Old hook commands (kb hook post-edit,kb hook stop) keep working.- New files.
.gitattributeskeeps LF line endings on every platform. A repository committed from Windows withcore.autocrlf=falseholds CRLF files; normalize it once, as in Line endings. Otherwise there is nothing to do. Withgithub_ci,.github/dependabot.ymlproposes updates of the pinned actions weekly (Pinned actions and Dependabot). - Import mappings are checked more strictly. A mapping with an unknown
nested key, an invalid regular expression or an invalid actor now stops
kb importwith a message that names the key.excludeignores case:private/**now also excludesPrivate/. See the mapping reference. - Zotero settings.
ZOTERO_LOCAL_APIis now the root of the local API,http://localhost:23119/api;kbadds/users/0or/groups/<id>itself. An old value that ends in/users/0still works. Inschema/resources.yaml,zotero.user_idandzotero.group_idmust be numbers;kb checkreports anything else (H061). kb mv. A new name with another extension is refused:kb mv a.md b.txtused to createb.txt.md. A destination that is an existing folder moves the page into it (kb mv a.md aigivesai/a.md, where it used to giveai.md). Seekb mv.- What counts as the knowledge base. Every
kbcommand reads the files git would commit, and never files below a dot-folder. The pre-commit hooks runkb --tracked, which reads only what the commit contains. As a result:kb reporttotals may drop: Templates and pages in.trash/or_folders are no longer counted;- a link into a dot-folder or to a gitignored file is now a broken link (W030), and links must match the case of the file name.
tools/retrieval-eval/questions.yamlbelongs to the knowledge base, so the update keeps your file and its old header.kb evalreads it; the format is the same, with optionalfilters. The template's new header explains the format; copy it from thekb evalreference or from a freshly generated knowledge base if you want it.kb mvandkb mergenow update the entries of the pages they move or merge.kb openrefuses programs. It opens web URLs, Zotero items and files under a declared root, but no longer programs, shortcuts or executable files. Seekb open.
After the update, run uv run poe setup and uv run poe ci
(step 4 above), then commit, including uv.lock.
Updating to v0.6.0¶
v0.6.0 replaces the justfile with poethepoet tasks
in pyproject.toml. The tasks keep the names of the recipes.
- The justfile goes away.
copier updatedeletesjustfile, even if you edited it, without asking. If you had your own recipes, recover them from git before you commit the update, withgit show HEAD:justfile, and move them intotasks.toml(see Custom recipes below). tasks.tomlappears at the repository root. It holds this knowledge base's own tasks, andcopier updatenever overwrites it.- Run tasks with
uv run poe. Replacejust Xwithuv run poe Xin your habits, shell aliases and scripts:uv run poe setup,uv run poe check path.md,uv run poe find --type Tool.uv run poealone lists the tasks. just is no longer needed; poethepoet is installed into.venvbyuv run. Optionally,uv tool install poethepoetonce lets you typepoe Xin any knowledge base. - README.md belongs to the knowledge base, so the update leaves it
alone: replace the
just …commands in it by hand. - Custom recipes that you added to the old
justfilego intotasks.toml, as poe tasks (example). Never add them topyproject.toml: the template manages it. A recipe longer than a line or two becomes asequenceof commands, or a script that the task runs. - The just variables are gone. The folder name is written into the
tasks that need it, and
kb searchcomputes the qmd collection name, still$KB_QMD_COLLECTIONorkb_name. Sojust qmd_collection=other search …becomesKB_QMD_COLLECTION=other uv run poe search …. - New
kbcommands do the work of the longer recipes:kb setup,kb search(with--setupand--reindex) andkb rename-bundle. The search fallback no longer needs ripgrep. - CI runs
uv run poe ci; the step that installed just is gone. Nothing to do if you did not edit the workflow.
After the update, run uv run poe setup and uv run poe ci
(step 4 above), then commit.
Updating to v0.5.0¶
- Knowledge-base folder: Copier asks the new question
bundle_dir, the name of the knowledge-base folder, with the defaultkb. Accept it: your knowledge base keeps itskb/folder, andpyproject.tomlrecords the name in[tool.kb] bundle = "kb". Answering another name here does not move your pages. - Optional rename: to give the folder, and so the Obsidian vault,
another name, commit the update first, then run
uv run poe rename-bundle <name>. See Rename the knowledge-base folder.
Updating to v0.4.0¶
- Search: the qmd collection is now named after the knowledge base
instead of
kb. Remove the old one, then set it up again:qmd collection remove kb && uv run poe search-setup. See Enable search. - Obsidian: plugins are now installed by
uv run poe obsidian-setup. Yourkb/.obsidian/community-plugins.jsonbelongs to the knowledge base, so it keeps its previous list. The command installs every listed plugin that has a pin; remove the IDs you don't want from the list first. See Set up Obsidian.
When the template repository is private¶
copier update fetches the template from _src_path in
.copier-answers.yml. For a private repository, such as your own fork, git
needs credentials for it. Either:
-
let the GitHub CLI act as git's credential helper:
-
or make git use SSH for GitHub URLs:
You can also generate the knowledge base from the SSH address in the first
place (uvx copier copy --trust git@github.com:you/okf-kb-template.git my-kb);
_src_path then records it.
Updates need release tags in the template repository: _commit names a tag,
and Copier compares it with the new one. If you maintain a fork, push tags
with your commits (git push origin main --tags).