Files
gastown/internal/cmd/goals.go
furiosa c48e157a95 feat(cmd): add gt goals command skeleton
Create goals.go with basic command structure for viewing strategic
goals (epics) with staleness indicators. Includes --json, --status,
and --priority flags. Implementation stubs return not-yet-implemented
errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 19:46:14 -08:00

61 lines
1.6 KiB
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
// Goal command flags
var (
goalsJSON bool
goalsStatus string
goalsPriority string
)
var goalsCmd = &cobra.Command{
Use: "goals [goal-id]",
GroupID: GroupWork,
Short: "View strategic goals (epics) with staleness indicators",
Long: `View strategic goals (epics) across the workspace.
Goals are high-level objectives that organize related work items.
This command shows goals with staleness indicators to help identify
stale or neglected strategic initiatives.
Examples:
gt goals # List all open goals
gt goals --json # Output as JSON
gt goals --status=all # Show all goals including closed
gt goals hq-abc # Show details for a specific goal`,
RunE: runGoals,
}
func init() {
goalsCmd.Flags().BoolVar(&goalsJSON, "json", false, "Output as JSON")
goalsCmd.Flags().StringVar(&goalsStatus, "status", "open", "Filter by status (open, closed, all)")
goalsCmd.Flags().StringVar(&goalsPriority, "priority", "", "Filter by priority (e.g., P0, P1, P2)")
rootCmd.AddCommand(goalsCmd)
}
func runGoals(cmd *cobra.Command, args []string) error {
// If arg provided, show specific goal
if len(args) > 0 {
goalID := args[0]
return showGoal(goalID)
}
// Otherwise list all goals
return listGoals()
}
func showGoal(goalID string) error {
// TODO: Implement goal details view
return fmt.Errorf("goal details not yet implemented: %s", goalID)
}
func listGoals() error {
// TODO: Implement goals listing with staleness
return fmt.Errorf("goals listing not yet implemented")
}