summaryrefslogtreecommitdiff
path: root/internal/cli/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/run.go')
-rw-r--r--internal/cli/run.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/cli/run.go b/internal/cli/run.go
index 1c53b1a..a5a6419 100644
--- a/internal/cli/run.go
+++ b/internal/cli/run.go
@@ -6,12 +6,14 @@ import (
"os"
"os/signal"
"syscall"
+ "time"
+ "github.com/spf13/cobra"
"github.com/thepeterstone/claudomator/internal/executor"
+ "github.com/thepeterstone/claudomator/internal/provider/anthropic"
"github.com/thepeterstone/claudomator/internal/provider/openaicompat"
"github.com/thepeterstone/claudomator/internal/storage"
"github.com/thepeterstone/claudomator/internal/task"
- "github.com/spf13/cobra"
)
func newRunCmd() *cobra.Command {
@@ -116,6 +118,18 @@ func runTasks(file string, parallel int, dryRun bool) error {
}
}
+ if pc, ok := cfg.Providers["anthropic"]; ok && pc.APIKey != "" && cfg.Runners.AnthropicEnabled() {
+ timeout := time.Duration(0)
+ if pc.TimeoutSeconds > 0 {
+ timeout = time.Duration(pc.TimeoutSeconds) * time.Second
+ }
+ runners["anthropic"] = &executor.NativeRunner{
+ Provider: anthropic.New(pc.APIKey, pc.Endpoint, timeout),
+ Logger: logger,
+ LogDir: cfg.LogDir,
+ DefaultModel: pc.DefaultModel,
+ }
+ }
pool := executor.NewPool(parallel, runners, store, logger)
pool.Classifier = &executor.Classifier{