feat(crew): accept rig name as positional arg in crew status

Allow `gt crew status <rig>` to work without requiring --rig flag.
This matches the pattern already used by crew start and crew stop.

Desire path: hq-v33hb

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mayor
2026-01-12 23:07:26 -08:00
committed by beads/crew/emma
parent 2d8949a3d3
commit 15cfb76c2c
4 changed files with 545 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package cmd
import (
"encoding/json"
"fmt"
"path/filepath"
"time"
@@ -402,9 +403,22 @@ func outputHandoffWarning(prevSession string) {
}
// outputState outputs only the session state (for --state flag).
func outputState(ctx RoleContext) {
// If jsonOutput is true, outputs JSON format instead of key:value.
func outputState(ctx RoleContext, jsonOutput bool) {
state := detectSessionState(ctx)
if jsonOutput {
data, err := json.Marshal(state)
if err != nil {
// Fall back to plain text on error
fmt.Printf("state: %s\n", state.State)
fmt.Printf("role: %s\n", state.Role)
return
}
fmt.Println(string(data))
return
}
fmt.Printf("state: %s\n", state.State)
fmt.Printf("role: %s\n", state.Role)