Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var noConfigCommands = map[string]bool{
}

var rootCmd = &cobra.Command{
Use: "supermodel [path]",
Use: "supermodel",
Short: "Give your AI coding agent a map of your codebase",
Long: `Runs a full generate on startup (using cached graph if available), then
enters daemon mode. Listens for file-change notifications from the
Expand All @@ -40,7 +40,7 @@ enters daemon mode. Listens for file-change notifications from the
Press Ctrl+C to stop and remove graph files.

See https://supermodeltools.com for documentation.`,
Args: cobra.MaximumNArgs(1),
Args: cobra.NoArgs,
SilenceUsage: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// Walk up to the root command name to get the subcommand.
Expand Down Expand Up @@ -68,10 +68,7 @@ See https://supermodeltools.com for documentation.`,
if err := cfg.RequireAPIKey(); err != nil {
return err
}
dir := "."
if len(args) > 0 {
dir = args[0]
}
dir := watchDir
opts := shards.WatchOptions{
CacheFile: watchCacheFile,
Debounce: watchDebounce,
Expand All @@ -84,6 +81,7 @@ See https://supermodeltools.com for documentation.`,
}

var (
watchDir string
watchCacheFile string
watchDebounce time.Duration
watchNotifyPort int
Expand All @@ -92,6 +90,7 @@ var (
)

func init() {
rootCmd.Flags().StringVar(&watchDir, "dir", ".", "project directory")
rootCmd.Flags().StringVar(&watchCacheFile, "cache-file", "", "override cache file path")
rootCmd.Flags().DurationVar(&watchDebounce, "debounce", 2*time.Second, "debounce duration before processing changes")
rootCmd.Flags().IntVar(&watchNotifyPort, "notify-port", 7734, "UDP port for hook notifications")
Expand Down
Loading