From bcaa55e09a56e9b3dceb84992f7e5f6361cf69fa Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 22 Dec 2025 14:12:41 -0800 Subject: [PATCH] feat(refinery): Auto-start refinery on attach if not running MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Like gt crew at and gt mayor at, gt refinery attach now auto-starts the refinery session if it is not already running. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/refinery.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/cmd/refinery.go b/internal/cmd/refinery.go index 8161207b..dca7600a 100644 --- a/internal/cmd/refinery.go +++ b/internal/cmd/refinery.go @@ -357,7 +357,7 @@ func runRefineryAttach(cmd *cobra.Command, args []string) error { } // Use getRefineryManager to validate rig (and infer from cwd if needed) - _, _, rigName, err := getRefineryManager(rigName) + mgr, _, rigName, err := getRefineryManager(rigName) if err != nil { return err } @@ -372,7 +372,12 @@ func runRefineryAttach(cmd *cobra.Command, args []string) error { return fmt.Errorf("checking session: %w", err) } if !running { - return fmt.Errorf("refinery is not running for rig '%s'", rigName) + // Auto-start if not running + fmt.Printf("Refinery not running for %s, starting...\n", rigName) + if err := mgr.Start(false); err != nil { + return fmt.Errorf("starting refinery: %w", err) + } + fmt.Printf("%s Refinery started\n", style.Bold.Render("✓")) } // Attach to the session