summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/commands/command.go
diff options
context:
space:
mode:
authoradamdotdevin <[email protected]>2025-08-15 07:43:30 -0500
committeradamdotdevin <[email protected]>2025-08-15 07:43:30 -0500
commit6e0e87fb2ad5cc440cc5455c4e43cafc9d07aff0 (patch)
tree163bce201bfaac03955bda338ce4f87ce95da7c9 /packages/tui/internal/commands/command.go
parentc875d11959d568f9fca7fea29ebf6479b29391e3 (diff)
downloadopencode-6e0e87fb2ad5cc440cc5455c4e43cafc9d07aff0.tar.gz
opencode-6e0e87fb2ad5cc440cc5455c4e43cafc9d07aff0.zip
fix: more commands cleanup
Diffstat (limited to 'packages/tui/internal/commands/command.go')
-rw-r--r--packages/tui/internal/commands/command.go89
1 files changed, 31 insertions, 58 deletions
diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go
index 19f8586dc..64a78acf1 100644
--- a/packages/tui/internal/commands/command.go
+++ b/packages/tui/internal/commands/command.go
@@ -108,9 +108,12 @@ func (r CommandRegistry) Matches(msg tea.KeyPressMsg, leader bool) []Command {
const (
AppHelpCommand CommandName = "app_help"
- SwitchAgentCommand CommandName = "switch_agent"
- SwitchAgentReverseCommand CommandName = "switch_agent_reverse"
+ AppExitCommand CommandName = "app_exit"
+ ThemeListCommand CommandName = "theme_list"
+ ProjectInitCommand CommandName = "project_init"
EditorOpenCommand CommandName = "editor_open"
+ ToolDetailsCommand CommandName = "tool_details"
+ ThinkingBlocksCommand CommandName = "thinking_blocks"
SessionNewCommand CommandName = "session_new"
SessionListCommand CommandName = "session_list"
SessionShareCommand CommandName = "session_share"
@@ -118,34 +121,25 @@ const (
SessionInterruptCommand CommandName = "session_interrupt"
SessionCompactCommand CommandName = "session_compact"
SessionExportCommand CommandName = "session_export"
- ToolDetailsCommand CommandName = "tool_details"
- ThinkingBlocksCommand CommandName = "thinking_blocks"
+ MessagesPageUpCommand CommandName = "messages_page_up"
+ MessagesPageDownCommand CommandName = "messages_page_down"
+ MessagesHalfPageUpCommand CommandName = "messages_half_page_up"
+ MessagesHalfPageDownCommand CommandName = "messages_half_page_down"
+ MessagesFirstCommand CommandName = "messages_first"
+ MessagesLastCommand CommandName = "messages_last"
+ MessagesCopyCommand CommandName = "messages_copy"
+ MessagesUndoCommand CommandName = "messages_undo"
+ MessagesRedoCommand CommandName = "messages_redo"
ModelListCommand CommandName = "model_list"
- AgentListCommand CommandName = "agent_list"
ModelCycleRecentCommand CommandName = "model_cycle_recent"
ModelCycleRecentReverseCommand CommandName = "model_cycle_recent_reverse"
- ThemeListCommand CommandName = "theme_list"
- FileListCommand CommandName = "file_list"
- FileCloseCommand CommandName = "file_close"
- FileSearchCommand CommandName = "file_search"
- FileDiffToggleCommand CommandName = "file_diff_toggle"
- ProjectInitCommand CommandName = "project_init"
+ AgentListCommand CommandName = "agent_list"
+ AgentCycleCommand CommandName = "agent_cycle"
+ AgentCycleReverseCommand CommandName = "agent_cycle_reverse"
InputClearCommand CommandName = "input_clear"
InputPasteCommand CommandName = "input_paste"
InputSubmitCommand CommandName = "input_submit"
InputNewlineCommand CommandName = "input_newline"
- MessagesPageUpCommand CommandName = "messages_page_up"
- MessagesPageDownCommand CommandName = "messages_page_down"
- MessagesHalfPageUpCommand CommandName = "messages_half_page_up"
- MessagesHalfPageDownCommand CommandName = "messages_half_page_down"
-
- MessagesFirstCommand CommandName = "messages_first"
- MessagesLastCommand CommandName = "messages_last"
-
- MessagesCopyCommand CommandName = "messages_copy"
- MessagesUndoCommand CommandName = "messages_undo"
- MessagesRedoCommand CommandName = "messages_redo"
- AppExitCommand CommandName = "app_exit"
)
func (k Command) Matches(msg tea.KeyPressMsg, leader bool) bool {
@@ -185,16 +179,6 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
Trigger: []string{"help"},
},
{
- Name: SwitchAgentCommand,
- Description: "next agent",
- Keybindings: parseBindings("tab"),
- },
- {
- Name: SwitchAgentReverseCommand,
- Description: "previous agent",
- Keybindings: parseBindings("shift+tab"),
- },
- {
Name: EditorOpenCommand,
Description: "open editor",
Keybindings: parseBindings("<leader>e"),
@@ -259,12 +243,6 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
Trigger: []string{"models"},
},
{
- Name: AgentListCommand,
- Description: "list agents",
- Keybindings: parseBindings("<leader>a"),
- Trigger: []string{"agents"},
- },
- {
Name: ModelCycleRecentCommand,
Description: "next recent model",
Keybindings: parseBindings("f2"),
@@ -275,31 +253,26 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
Keybindings: parseBindings("shift+f2"),
},
{
- Name: ThemeListCommand,
- Description: "list themes",
- Keybindings: parseBindings("<leader>t"),
- Trigger: []string{"themes"},
+ Name: AgentListCommand,
+ Description: "list agents",
+ Keybindings: parseBindings("<leader>a"),
+ Trigger: []string{"agents"},
},
- // {
- // Name: FileListCommand,
- // Description: "list files",
- // Keybindings: parseBindings("<leader>f"),
- // Trigger: []string{"files"},
- // },
{
- Name: FileCloseCommand,
- Description: "close file",
- Keybindings: parseBindings("esc"),
+ Name: AgentCycleCommand,
+ Description: "next agent",
+ Keybindings: parseBindings("tab"),
},
{
- Name: FileSearchCommand,
- Description: "search file",
- Keybindings: parseBindings("<leader>/"),
+ Name: AgentCycleReverseCommand,
+ Description: "previous agent",
+ Keybindings: parseBindings("shift+tab"),
},
{
- Name: FileDiffToggleCommand,
- Description: "split/unified diff",
- Keybindings: parseBindings("<leader>v"),
+ Name: ThemeListCommand,
+ Description: "list themes",
+ Keybindings: parseBindings("<leader>t"),
+ Trigger: []string{"themes"},
},
{
Name: ProjectInitCommand,