Conversation
This was referenced Feb 13, 2026
Adds `wt config state kv set/get/list/clear` commands for storing
arbitrary key-value data per branch in git config. KV data is also
available in templates via `{{ kv.key }}` syntax, working in hooks
and `wt step eval`.
Part of #947
Co-Authored-By: Claude <noreply@anthropic.com>
Adds a `kv` object field to JSON output containing per-branch key-value data. Absent when no kv data is set for the branch. Co-Authored-By: Claude <noreply@anthropic.com>
- Skip kv lookup in expand_template when template doesn't reference kv - Remove empty println!() for missing kv keys (match git config behavior) - Inline get_kv_entries wrapper (no added value over repo.kv_entries()) - Extract parse_all_kv helper to deduplicate show_json/show_table parsing Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
`[experimental]` was interpreted as an intra-doc link by rustdoc, causing `cargo doc -Dwarnings` to fail. Co-Authored-By: Claude <noreply@anthropic.com>
- Add KV data to comprehensive state get tests (table and JSON) - Add tests for kv clear nonexistent key, clear --all when empty - Add tests for kv list/clear with --branch flag - Escape [experimental] in rustdoc to fix broken intra-doc link Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wt config state kv set/get/list/clearcommands for storing arbitrary key-value data per branch in git config (worktrunk.state.{branch}.kv.{key}){{ kv.key }}syntax (hooks,wt step eval){{ kv.key | default('fallback') }}works when no data is setwt list --format=jsonoutput as akvobject fieldBuilds on #1004 (
wt step eval). Part of #947.Test plan
wt step eval(dot notation, default filter)🤖 Generated with Claude Code