From e539ea3cc8ab2b60073f1ebe9b5afd534831ef8a Mon Sep 17 00:00:00 2001 From: gastown/crew/max Date: Tue, 30 Dec 2025 22:23:42 -0800 Subject: [PATCH] Fix gt hook --json flag not working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The --json flag was only registered on the status subcommand, not the parent hook command. When running `gt hook --json` (no args), it would fail with "unknown flag". Now the flag is registered on both. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/hook.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/cmd/hook.go b/internal/cmd/hook.go index 8a43e543..439b0ab0 100644 --- a/internal/cmd/hook.go +++ b/internal/cmd/hook.go @@ -63,12 +63,14 @@ var ( ) func init() { + // Flags for attaching work (gt hook ) hookCmd.Flags().StringVarP(&hookSubject, "subject", "s", "", "Subject for handoff mail (optional)") hookCmd.Flags().StringVarP(&hookMessage, "message", "m", "", "Message for handoff mail (optional)") hookCmd.Flags().BoolVarP(&hookDryRun, "dry-run", "n", false, "Show what would be done") hookCmd.Flags().BoolVarP(&hookForce, "force", "f", false, "Replace existing incomplete pinned bead") - // Add status subcommand (shares --json flag with mol status) + // --json flag for status output (used when no args, i.e., gt hook --json) + hookCmd.Flags().BoolVar(&moleculeJSON, "json", false, "Output as JSON (for status)") hookStatusCmd.Flags().BoolVar(&moleculeJSON, "json", false, "Output as JSON") hookCmd.AddCommand(hookStatusCmd)