summaryrefslogtreecommitdiff
path: root/internal/cli/root.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-02-08 21:35:45 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-02-08 21:35:45 -1000
commit2e2b2187b957e9af78797a67ec5c6874615fae02 (patch)
tree1181dbb7e43f5d30cb025fa4d50fd4e7a2c893b3 /internal/cli/root.go
Initial project: task model, executor, API server, CLI, storage, reporter
Claudomator automation toolkit for Claude Code with: - Task model with YAML parsing, validation, state machine (49 tests, 0 races) - SQLite storage for tasks and executions - Executor pool with bounded concurrency, timeout, cancellation - REST API + WebSocket for mobile PWA integration - Webhook/multi-notifier system - CLI: init, run, serve, list, status commands - Console, JSON, HTML reporters with cost tracking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/cli/root.go')
-rw-r--r--internal/cli/root.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/internal/cli/root.go b/internal/cli/root.go
new file mode 100644
index 0000000..2800a76
--- /dev/null
+++ b/internal/cli/root.go
@@ -0,0 +1,40 @@
+package cli
+
+import (
+ "github.com/claudomator/claudomator/internal/config"
+ "github.com/spf13/cobra"
+)
+
+var (
+ cfgFile string
+ verbose bool
+ cfg *config.Config
+)
+
+func NewRootCmd() *cobra.Command {
+ cfg = config.Default()
+
+ cmd := &cobra.Command{
+ Use: "claudomator",
+ Short: "Automation toolkit for Claude Code",
+ Long: "Claudomator captures tasks, dispatches them to Claude Code, and reports results.",
+ }
+
+ 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().BoolVarP(&verbose, "verbose", "v", false, "verbose output")
+
+ cmd.AddCommand(
+ newRunCmd(),
+ newServeCmd(),
+ newListCmd(),
+ newStatusCmd(),
+ newInitCmd(),
+ )
+
+ return cmd
+}
+
+func Execute() error {
+ return NewRootCmd().Execute()
+}