mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
wip: refactoring tui
This commit is contained in:
25
packages/tui/internal/commands/command.go
Normal file
25
packages/tui/internal/commands/command.go
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user