Merge branch 'steveyegge:main' into main
This commit is contained in:
@@ -240,27 +240,30 @@ var crewPrevCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var crewStartCmd = &cobra.Command{
|
var crewStartCmd = &cobra.Command{
|
||||||
Use: "start <rig> [name]",
|
Use: "start [rig] [name...]",
|
||||||
Aliases: []string{"spawn"},
|
Aliases: []string{"spawn"},
|
||||||
Short: "Start crew worker(s) in a rig",
|
Short: "Start crew worker(s) in a rig",
|
||||||
Long: `Start crew workers in a rig, creating workspaces if they don't exist.
|
Long: `Start crew workers in a rig, creating workspaces if they don't exist.
|
||||||
|
|
||||||
Takes the rig name as the first argument. Optionally specify a crew member name
|
The rig name can be provided as the first argument, or inferred from the
|
||||||
to start just that worker, or use --all to start all crew members in the rig.
|
current directory. Optionally specify crew member names to start specific
|
||||||
|
workers, or use --all to start all crew members in the rig.
|
||||||
|
|
||||||
The crew session starts in the background with Claude running and ready.
|
The crew session starts in the background with Claude running and ready.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
gt crew start gastown joe # Start joe in gastown rig
|
gt crew start gastown joe # Start joe in gastown rig
|
||||||
gt crew start gastown --all # Start all crew in gastown rig
|
gt crew start gastown --all # Start all crew in gastown rig
|
||||||
gt crew start beads # Error: specify name or --all
|
gt crew start --all # Start all crew (rig inferred from cwd)
|
||||||
gt crew start beads grip fang # Start grip and fang in beads rig`,
|
gt crew start beads grip fang # Start grip and fang in beads rig`,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
if len(args) < 1 {
|
// With --all, we can have 0 args (infer rig) or 1+ args (rig specified)
|
||||||
return fmt.Errorf("requires at least 1 argument: the rig name")
|
if crewAll {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
if len(args) == 1 && !crewAll {
|
// Without --all, need at least rig and one crew name
|
||||||
return fmt.Errorf("specify a crew member name or use --all to start all crew in the rig")
|
if len(args) < 2 {
|
||||||
|
return fmt.Errorf("requires rig and crew name, or use --all")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -219,17 +219,27 @@ func runCrewRefresh(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// runCrewStart starts crew workers in a rig.
|
// runCrewStart starts crew workers in a rig.
|
||||||
// args[0] is the rig name (required)
|
// args[0] is the rig name (optional if inferrable from cwd)
|
||||||
// args[1:] are crew member names (optional, or use --all flag)
|
// args[1:] are crew member names (optional, or use --all flag)
|
||||||
func runCrewStart(cmd *cobra.Command, args []string) error {
|
func runCrewStart(cmd *cobra.Command, args []string) error {
|
||||||
rigName := args[0]
|
var rigName string
|
||||||
crewNames := args[1:]
|
var crewNames []string
|
||||||
|
|
||||||
// Get the rig manager and rig
|
if len(args) == 0 {
|
||||||
|
// No args - infer rig from cwd (only valid with --all)
|
||||||
|
rigName = "" // getCrewManager will infer from cwd
|
||||||
|
} else {
|
||||||
|
rigName = args[0]
|
||||||
|
crewNames = args[1:]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the rig manager and rig (infers from cwd if rigName is empty)
|
||||||
crewMgr, r, err := getCrewManager(rigName)
|
crewMgr, r, err := getCrewManager(rigName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// Update rigName in case it was inferred
|
||||||
|
rigName = r.Name
|
||||||
|
|
||||||
// If --all flag, get all crew members
|
// If --all flag, get all crew members
|
||||||
if crewAll {
|
if crewAll {
|
||||||
|
|||||||
Reference in New Issue
Block a user