You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add read-only structured project-command approval status #3698
External tools that delegate worktree lifecycle to Worktrunk need to determine whether project commands are approved before scheduling a non-interactive operation. Today they must invoke wt config approvals add and infer status from its behavior.
Request
Please add a read-only machine-readable command, for example:
wt config approvals status --format=json
The result should distinguish approved, approval-required, and repositories with no project commands, without modifying approval state or prompting. This would let orchestrators preserve Worktrunk's approval model without parsing human output or using --yes.
Thanks for the suggestion — this is a reasonable gap to close, and the read-only three-state distinction you want is already computed internally; it just isn't emitted in a machine-readable form yet.
wt config approvals list is the closest existing surface. It's read-only, never prompts, and never mutates state, and it already partitions into exactly the states you describe: it reports "No commands configured in project" when there are none, and otherwise splits the project's commands into APPROVED / UNAPPROVED sections (plus a separate list of stale approvals — commands approved earlier but since edited or removed from the config). The one thing missing is a structured format: today it only renders paged human text with no --format flag.
So the smallest change that satisfies the request is to add --format=json to the existing list subcommand rather than introduce a new status subcommand. That matches how worktrunk exposes structured output elsewhere — wt config show --format=json, wt config state get --format=json, wt config state logs --format=json, wt list --format=json — all add a format flag to a read command instead of forking a parallel machine-readable command. Reusing list also means the JSON automatically carries the stale-approvals dimension, which an orchestrator scheduling non-interactive runs will care about (a stale approval means the saved approval no longer covers the current command template, so --yes would re-approve a changed command).
A couple of design points a maintainer would want to settle before implementation:
New subcommand vs. flag.wt config approvals list --format=json fits the established pattern; a dedicated status verb would be a second way to read the same state. The --format flag on list seems preferable, but that's a call for a maintainer.
The four states, not three. The JSON should distinguish approved, unapproved (approval-required), stale, and no-commands — collapsing stale into either bucket would lose the signal above.
This also reads as one of a cluster of requests aimed at making Worktrunk drivable by external orchestrators (#3696, #3697, #3699, #3700); worth a maintainer looking at them together, since a shared JSON convention across them would matter more than any one command's shape.
I'll leave it for a maintainer to evaluate and prioritize. If they're happy with wt config approvals list --format=json as the shape, this is a localized change I'm glad to implement.
The three/four states are already computed in list_approvals: src/commands/config/approvals.rs lines 53-130 — the commands.is_empty() && stale.is_empty() no-commands branch, the approved/unapproved partition, and the separate stale section.
Structured-output precedent on read commands: SwitchFormat { Text, Json } in src/cli/mod.rs lines 209-212, used by wt config show, wt config state, and wt list.
Activity
worktrunk-bot commentedon Aug 1, 2026
Thanks for the suggestion — this is a reasonable gap to close, and the read-only three-state distinction you want is already computed internally; it just isn't emitted in a machine-readable form yet.
wt config approvals listis the closest existing surface. It's read-only, never prompts, and never mutates state, and it already partitions into exactly the states you describe: it reports "No commands configured in project" when there are none, and otherwise splits the project's commands into APPROVED / UNAPPROVED sections (plus a separate list of stale approvals — commands approved earlier but since edited or removed from the config). The one thing missing is a structured format: today it only renders paged human text with no--formatflag.So the smallest change that satisfies the request is to add
--format=jsonto the existinglistsubcommand rather than introduce a newstatussubcommand. That matches how worktrunk exposes structured output elsewhere —wt config show --format=json,wt config state get --format=json,wt config state logs --format=json,wt list --format=json— all add a format flag to a read command instead of forking a parallel machine-readable command. Reusinglistalso means the JSON automatically carries the stale-approvals dimension, which an orchestrator scheduling non-interactive runs will care about (a stale approval means the saved approval no longer covers the current command template, so--yeswould re-approve a changed command).A couple of design points a maintainer would want to settle before implementation:
wt config approvals list --format=jsonfits the established pattern; a dedicatedstatusverb would be a second way to read the same state. The--formatflag onlistseems preferable, but that's a call for a maintainer.This also reads as one of a cluster of requests aimed at making Worktrunk drivable by external orchestrators (#3696, #3697, #3699, #3700); worth a maintainer looking at them together, since a shared JSON convention across them would matter more than any one command's shape.
I'll leave it for a maintainer to evaluate and prioritize. If they're happy with
wt config approvals list --format=jsonas the shape, this is a localized change I'm glad to implement.Sources
--formattoday):src/cli/config.rslines 234-278list_approvals:src/commands/config/approvals.rslines 53-130 — thecommands.is_empty() && stale.is_empty()no-commands branch, theapproved/unapprovedpartition, and the separatestalesection.SwitchFormat { Text, Json }insrc/cli/mod.rslines 209-212, used bywt config show,wt config state, andwt list.wt config approvalsfeat: machine-readable approval state and branch-removal outcomes (ma…