Repository navigation
Merged
Conversation
… absolute `path` to logs JSON
Before, `wt config state logs --format=json` errored with "unexpected argument
'--format'" because the flag only existed on the `get` action. The parent
subcommands (`logs`, `hints`, `ci-status`, `marker`) dispatch to the same
list/get view when no action is specified, so format should apply there too.
Consolidate `--format` to a single `global = true` flag on each parent;
remove the duplicate field from the `Get` actions. `--format=json` now works
regardless of ordering: `logs --format=json`, `logs --format=json get`,
`logs get --format=json`.
Logs JSON entries now include `path` (absolute, forward-slashed) alongside
`file` (relative), so consumers don't need to join with `wt_logs_dir()` to
open the file. `logs get --hook=X --format=json` emits `{"path": "..."}`
instead of a bare path line, keeping JSON output consistent across all
logs invocations.
Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 13, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 13, 2026
…h filters (#2161) Builds on [#2156](#2156) which hoisted `--format` and added absolute `path`. Two follow-on changes: ### 1. Structured fields on `hook_output` entries Hook-output log entries carried a slash-packed relative path in `file` — consumers had to split on `/` to filter by branch, source, or hook type. Expose first-class structured fields: ```json { "file": "main/user/post-start/server.log", "path": "/.../.git/wt/logs/main/user/post-start/server.log", "branch": "main", "source": "user", "hook_type": "post-start", "name": "server", "size": 1024, "modified_at": 1700000000 } ``` Internal-op entries (e.g., `feature/internal/remove.log`) normalize onto the same shape with `source: "internal"`, `hook_type: null`, and the op name in `name`. ### 2. Drop `--hook` / `--branch` filters; use jq With the structured fields, the old `--hook=SPEC` / `--branch=X` interface is a jq one-liner: ```bash wt config state logs --format=json \ | jq -r '.hook_output[] | select(.source == "user" and .hook_type == "post-start" and (.name | startswith("server"))) | .path' ``` That subsumes the filter flags without the CLI plumbing, the `HookLog::parse`/`to_spec` roundtrip, or the error-shape tests that locked in a fragile `source:hook-type:name` grammar. `logs` and `logs get` now always list — one code path, one shape. **Breaking change**: `wt config state logs get --hook=...` and `--branch=...` are removed. The jq pattern is documented in `wt config state logs --help`. > _This was written by Claude Code on behalf of Maximilian Roos_ --------- Co-authored-by: Claude <[email protected]>
Merged
13 of 15 tasks
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.
Previously
wt config state logs --format=jsonerrored with "unexpected argument '--format'" — the flag only existed on thegetaction, even though the bare form dispatches to the same list view. Same shape onhints,ci-status,marker.Consolidates
--formatto a singleglobal = trueflag on each parent; drops the now-duplicate field from theGetactions.--format=jsonnow works regardless of ordering:logs --format=json,logs --format=json get,logs get --format=json.Logs JSON entries now include
path(absolute, forward-slashed) alongsidefile(relative), so consumers don't need to join withwt_logs_dir()to open the file:{ "file": "main-vfz/user/post-switch/zellij-tab-xtr.log", "path": "/Users/.../.git/wt/logs/main-vfz/user/post-switch/zellij-tab-xtr.log", "size": 124, "modified_at": 1776041854 }logs get --hook=X --format=jsonalso emits{"path": "..."}instead of a bare path line, so JSON consumers get a uniform shape whether they're listing all logs or resolving one hook.