From 4c20fb334315e5b4e0c5892a6b68a205687ff7d9 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sun, 15 Feb 2026 18:54:22 -0800 Subject: feat(v2): wire up v2 as default interface - main.go: v2 JSON interface is now default - Set SHIP_V1=1 to use legacy human-formatted output - initV2() called before rootV2Cmd.Execute() v2 rebuild complete - ready for testing --- cmd/ship/main.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cmd/ship') diff --git a/cmd/ship/main.go b/cmd/ship/main.go index f7d95c1..73d9a20 100644 --- a/cmd/ship/main.go +++ b/cmd/ship/main.go @@ -6,8 +6,20 @@ import ( ) func main() { - if err := rootCmd.Execute(); err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) + // Use v2 (agent-first JSON) interface by default + // Set SHIP_V1=1 to use legacy human-formatted output + if os.Getenv("SHIP_V1") == "1" { + if err := rootCmd.Execute(); err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } + return + } + + // v2: JSON output by default + initV2() + if err := rootV2Cmd.Execute(); err != nil { + // Error already printed as JSON by commands os.Exit(1) } } -- cgit v1.2.3