From 5c5e242084341d575c2e5e6124260d2446cf38f0 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 25 Dec 2025 14:32:29 -0800 Subject: [PATCH] fix(crew): parse rig/name format in crew add command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The crew add command was not parsing rig/name format (e.g., "beads/emma"), which caused nested directories like crew/beads/emma to be created instead of properly routing to the beads rig. Now `gt crew add beads/emma` from any directory correctly creates the crew workspace in the beads rig at beads/crew/emma/. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/crew_add.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/cmd/crew_add.go b/internal/cmd/crew_add.go index 08308330..5a1d5c7e 100644 --- a/internal/cmd/crew_add.go +++ b/internal/cmd/crew_add.go @@ -16,6 +16,16 @@ import ( func runCrewAdd(cmd *cobra.Command, args []string) error { name := args[0] + // Parse rig/name format (e.g., "beads/emma" -> rig=beads, name=emma) + // This prevents creating nested directories like crew/beads/emma + rigName := crewRig + if parsedRig, crewName, ok := parseRigSlashName(name); ok { + if rigName == "" { + rigName = parsedRig + } + name = crewName + } + // Find workspace townRoot, err := workspace.FindFromCwdOrError() if err != nil { @@ -29,8 +39,7 @@ func runCrewAdd(cmd *cobra.Command, args []string) error { rigsConfig = &config.RigsConfig{Rigs: make(map[string]config.RigEntry)} } - // Determine rig - rigName := crewRig + // Determine rig (if not already set from slash format or --rig flag) if rigName == "" { // Try to infer from cwd rigName, err = inferRigFromCwd(townRoot)