From 2e2b2187b957e9af78797a67ec5c6874615fae02 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Feb 2026 21:35:45 -1000 Subject: 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 --- internal/config/config.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 internal/config/config.go (limited to 'internal/config/config.go') diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..da7f264 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,41 @@ +package config + +import ( + "os" + "path/filepath" +) + +type Config struct { + DataDir string `toml:"data_dir"` + DBPath string `toml:"-"` + LogDir string `toml:"-"` + ClaudeBinaryPath string `toml:"claude_binary_path"` + MaxConcurrent int `toml:"max_concurrent"` + DefaultTimeout string `toml:"default_timeout"` + ServerAddr string `toml:"server_addr"` + WebhookURL string `toml:"webhook_url"` +} + +func Default() *Config { + home, _ := os.UserHomeDir() + dataDir := filepath.Join(home, ".claudomator") + return &Config{ + DataDir: dataDir, + DBPath: filepath.Join(dataDir, "claudomator.db"), + LogDir: filepath.Join(dataDir, "executions"), + ClaudeBinaryPath: "claude", + MaxConcurrent: 3, + DefaultTimeout: "15m", + ServerAddr: ":8484", + } +} + +// EnsureDirs creates the data directory structure. +func (c *Config) EnsureDirs() error { + for _, dir := range []string{c.DataDir, c.LogDir} { + if err := os.MkdirAll(dir, 0700); err != nil { + return err + } + } + return nil +} -- cgit v1.2.3