diff options
| author | Dax <[email protected]> | 2025-08-07 16:32:12 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-07 16:32:12 -0400 |
| commit | c34aec060f2abb78486857b0e0d678cac52e2fab (patch) | |
| tree | 7d2b42a0c87ab016ffbc096e332b186ec4bce7ac /packages/tui/cmd | |
| parent | 12f1ad521fef2e1fa6f1b0ce6ec939664d61899f (diff) | |
| download | opencode-c34aec060f2abb78486857b0e0d678cac52e2fab.tar.gz opencode-c34aec060f2abb78486857b0e0d678cac52e2fab.zip | |
Merge agent and mode into one (#1689)
The concept of mode has been deprecated, there is now only the agent field in the config.
An agent can be cycled through as your primary agent with <tab> or you can spawn a subagent by @ mentioning it. if you include a description of when to use it, the primary agent will try to automatically use it
Full docs here: https://opencode.ai/docs/agents/
Diffstat (limited to 'packages/tui/cmd')
| -rw-r--r-- | packages/tui/cmd/opencode/main.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/tui/cmd/opencode/main.go b/packages/tui/cmd/opencode/main.go index 5532289fd..654eb0adc 100644 --- a/packages/tui/cmd/opencode/main.go +++ b/packages/tui/cmd/opencode/main.go @@ -31,7 +31,7 @@ func main() { var model *string = flag.String("model", "", "model to begin with") var prompt *string = flag.String("prompt", "", "prompt to begin with") - var mode *string = flag.String("mode", "", "mode to begin with") + var agent *string = flag.String("agent", "", "agent to begin with") flag.Parse() url := os.Getenv("OPENCODE_SERVER") @@ -44,9 +44,9 @@ func main() { os.Exit(1) } - modesStr := os.Getenv("OPENCODE_MODES") - var modes []opencode.Mode - err = json.Unmarshal([]byte(modesStr), &modes) + agentsStr := os.Getenv("OPENCODE_AGENTS") + var agents []opencode.Agent + err = json.Unmarshal([]byte(agentsStr), &agents) if err != nil { slog.Error("Failed to unmarshal modes", "error", err) os.Exit(1) @@ -86,7 +86,7 @@ func main() { logger := slog.New(apiHandler) slog.SetDefault(logger) - slog.Debug("TUI launched", "app", appInfoStr, "modes", modesStr, "url", url) + slog.Debug("TUI launched", "app", appInfoStr, "modes", agentsStr, "url", url) go func() { err = clipboard.Init() @@ -96,7 +96,7 @@ func main() { }() // Create main context for the application - app_, err := app.New(ctx, version, appInfo, modes, httpClient, model, prompt, mode) + app_, err := app.New(ctx, version, appInfo, agents, httpClient, model, prompt, agent) if err != nil { panic(err) } |
