summaryrefslogtreecommitdiff
path: root/internal/cli/root.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-03 21:15:50 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-03 21:15:50 +0000
commit74cc740398cf2d90804ab19db728c844c2e056b7 (patch)
treee8532d1da9273e1613beb7b762b16134da0de286 /internal/cli/root.go
parentf527972f4d8311a09e639ede6c4da4ca669cfd5e (diff)
Add elaborate, logs-stream, templates, and subtask-list endpoints
- POST /api/tasks/elaborate: calls claude to draft a task config from a natural-language prompt - GET /api/executions/{id}/logs/stream: SSE tail of stdout.log - CRUD /api/templates: create/list/get/update/delete reusable task configs - GET /api/tasks/{id}/subtasks: list child tasks - Server.NewServer accepts claudeBinPath for elaborate; injectable elaborateCmdPath and logStore for test isolation - Valid-transition guard added to POST /api/tasks/{id}/run - CLI passes claude binary path through to the server Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/cli/root.go')
-rw-r--r--internal/cli/root.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/cli/root.go b/internal/cli/root.go
index 4f8dad6..43f5cb9 100644
--- a/internal/cli/root.go
+++ b/internal/cli/root.go
@@ -1,6 +1,8 @@
package cli
import (
+ "path/filepath"
+
"github.com/thepeterstone/claudomator/internal/config"
"github.com/spf13/cobra"
)
@@ -22,8 +24,16 @@ func NewRootCmd() *cobra.Command {
cmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default $HOME/.claudomator/config.toml)")
cmd.PersistentFlags().StringVar(&cfg.DataDir, "data-dir", cfg.DataDir, "data directory")
+ cmd.PersistentFlags().StringVar(&cfg.ClaudeBinaryPath, "claude-bin", cfg.ClaudeBinaryPath, "path to claude binary")
cmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output")
+ // Re-derive DBPath and LogDir after flags are parsed, so --data-dir takes effect.
+ cmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
+ cfg.DBPath = filepath.Join(cfg.DataDir, "claudomator.db")
+ cfg.LogDir = filepath.Join(cfg.DataDir, "executions")
+ return nil
+ }
+
cmd.AddCommand(
newRunCmd(),
newServeCmd(),