summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/commands
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-13 09:57:54 -0500
committeradamdottv <[email protected]>2025-06-13 09:57:54 -0500
commit5706c6ad3add2ad4eb6c3d152f0fa72b701027c4 (patch)
treeaaa8b3c9f7ae66588a258d3c517b331c980a4d4d /packages/tui/internal/commands
parente8e03c895aa5fb215302ece625e9569397c9064c (diff)
downloadopencode-5706c6ad3add2ad4eb6c3d152f0fa72b701027c4.tar.gz
opencode-5706c6ad3add2ad4eb6c3d152f0fa72b701027c4.zip
wip: refactoring tui
Diffstat (limited to 'packages/tui/internal/commands')
-rw-r--r--packages/tui/internal/commands/command.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go
new file mode 100644
index 000000000..c2b8f2eae
--- /dev/null
+++ b/packages/tui/internal/commands/command.go
@@ -0,0 +1,25 @@
+package commands
+
+import (
+ "github.com/charmbracelet/bubbles/v2/key"
+)
+
+// Command represents a user-triggerable action.
+type Command struct {
+ // Name is the identifier used for slash commands (e.g., "new").
+ Name string
+ // Description is a short explanation of what the command does.
+ Description string
+ // KeyBinding is the keyboard shortcut to trigger this command.
+ KeyBinding key.Binding
+}
+
+// Registry holds all the available commands.
+type Registry struct {
+ Commands map[string]Command
+}
+
+// ExecuteCommandMsg is a message sent when a command should be executed.
+type ExecuteCommandMsg struct {
+ Name string
+} \ No newline at end of file