feat(refinery): Auto-start refinery on attach if not running

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 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-22 14:12:41 -08:00
parent dc7cad1a04
commit bcaa55e09a

View File

@@ -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