diff --git a/internal/cmd/crew_at.go b/internal/cmd/crew_at.go index 29fa3385..a652e325 100644 --- a/internal/cmd/crew_at.go +++ b/internal/cmd/crew_at.go @@ -29,7 +29,19 @@ func runCrewAt(cmd *cobra.Command, args []string) error { // Try to detect from current directory detected, err := detectCrewFromCwd() if err != nil { - return fmt.Errorf("could not detect crew workspace from current directory: %w\n\nUsage: gt crew at ", err) + // Try to show available crew members if we can detect the rig + hint := "\n\nUsage: gt crew at " + if crewRig != "" { + if mgr, _, mgrErr := getCrewManager(crewRig); mgrErr == nil { + if members, listErr := mgr.List(); listErr == nil && len(members) > 0 { + hint = fmt.Sprintf("\n\nAvailable crew in %s:", crewRig) + for _, m := range members { + hint += fmt.Sprintf("\n %s", m.Name) + } + } + } + } + return fmt.Errorf("could not detect crew workspace from current directory: %w%s", err, hint) } name = detected.crewName if crewRig == "" { diff --git a/internal/cmd/crew_helpers.go b/internal/cmd/crew_helpers.go index d65b0eea..d7724377 100644 --- a/internal/cmd/crew_helpers.go +++ b/internal/cmd/crew_helpers.go @@ -122,7 +122,7 @@ func detectCrewFromCwd() (*crewDetection, error) { // Look for pattern: /crew//... // Minimum: rig, crew, name = 3 parts if len(parts) < 3 { - return nil, fmt.Errorf("not in a crew workspace (path too short)") + return nil, fmt.Errorf("not inside a crew workspace - specify the crew name or cd into a crew directory (e.g., gastown/crew/max)") } rigName := parts[0]