commands

package
v1.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IconWorktree   = "" // Nerd Font: git branch
	IconCreate     = "" // Nerd Font: plus
	IconGit        = "" // Nerd Font: git
	IconStatus     = "" // Nerd Font: file-diff
	IconLog        = "" // Nerd Font: history
	IconNavigation = "" // Nerd Font: compass
	IconSettings   = "" // Nerd Font: cog
	IconCustom     = "" // Nerd Font: terminal
	IconMultiplex  = "" // Nerd Font: layers
	IconRecent     = "" // Nerd Font: clock
)

Section icons for command palette display.

Variables

This section is empty.

Functions

func RegisterClipboardActions added in v1.39.0

func RegisterClipboardActions(r *Registry, h ClipboardHandlers)

RegisterClipboardActions registers clipboard actions.

func RegisterGitOperations

func RegisterGitOperations(r *Registry, h GitHandlers)

RegisterGitOperations registers git operations.

func RegisterLogPaneActions

func RegisterLogPaneActions(r *Registry, h LogHandlers)

RegisterLogPaneActions registers log pane actions.

func RegisterNavigationActions

func RegisterNavigationActions(r *Registry, h NavigationHandlers)

RegisterNavigationActions registers navigation actions.

func RegisterSettingsActions

func RegisterSettingsActions(r *Registry, h SettingsHandlers)

RegisterSettingsActions registers settings actions.

func RegisterStatusPaneActions

func RegisterStatusPaneActions(r *Registry, h StatusHandlers)

RegisterStatusPaneActions registers status pane actions.

func RegisterWorktreeActions

func RegisterWorktreeActions(r *Registry, h WorktreeHandlers)

RegisterWorktreeActions registers worktree-related actions.

Types

type ClipboardHandlers added in v1.39.0

type ClipboardHandlers struct {
	CopyPath   func() tea.Cmd
	CopyBranch func() tea.Cmd
	CopyPRURL  func() tea.Cmd
}

ClipboardHandlers holds callbacks for clipboard actions.

type CommandAction

type CommandAction struct {
	ID          string
	Label       string
	Description string
	Section     string
	Shortcut    string // Keyboard shortcut display (e.g., "g")
	Icon        string // Category icon (Nerd Font)
	Handler     func() tea.Cmd
	Available   func() bool
}

CommandAction describes a command palette action.

type GitHandlers

type GitHandlers struct {
	ShowDiff          func() tea.Cmd
	Refresh           func() tea.Cmd
	Fetch             func() tea.Cmd
	Push              func() tea.Cmd
	Sync              func() tea.Cmd
	FetchPRData       func() tea.Cmd
	ViewCIChecks      func() tea.Cmd
	CIChecksAvailable func() bool
	OpenPR            func() tea.Cmd
	OpenLazyGit       func() tea.Cmd
	RunCommand        func() tea.Cmd
}

GitHandlers holds callbacks for git operations.

type LogHandlers

type LogHandlers struct {
	CherryPick func() tea.Cmd
	CommitView func() tea.Cmd
}

LogHandlers holds callbacks for log pane actions.

type NavigationHandlers struct {
	ToggleZoom    func() tea.Cmd
	ToggleLayout  func() tea.Cmd
	Filter        func() tea.Cmd
	Search        func() tea.Cmd
	FocusWorktree func() tea.Cmd
	FocusStatus   func() tea.Cmd
	FocusLog      func() tea.Cmd
	SortCycle     func() tea.Cmd
}

NavigationHandlers holds callbacks for navigation actions.

type PaletteItem

type PaletteItem struct {
	ID          string
	Label       string
	Description string
	IsSection   bool
	IsMRU       bool
	Shortcut    string // Keyboard shortcut display (e.g., "g")
	Icon        string // Category icon (Nerd Font)
}

PaletteItem represents a palette entry.

func BuildPaletteItems

func BuildPaletteItems(opts PaletteOptions) []PaletteItem

BuildPaletteItems builds palette items from actions and history.

type PaletteOptions

type PaletteOptions struct {
	MRUEnabled      bool
	MRULimit        int
	History         []services.CommandPaletteUsage
	Actions         []CommandAction
	CustomItems     []PaletteItem
	MRUSectionLabel string
}

PaletteOptions controls palette item building.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry stores command palette actions.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

func (*Registry) Actions

func (r *Registry) Actions() []CommandAction

Actions returns the registered actions in order.

func (*Registry) Execute

func (r *Registry) Execute(id string) tea.Cmd

Execute runs the handler for an action ID.

func (*Registry) KnownActionIDs added in v1.43.0

func (r *Registry) KnownActionIDs() []string

KnownActionIDs returns all registered action IDs.

func (*Registry) Register

func (r *Registry) Register(actions ...CommandAction)

Register adds actions to the registry.

func (*Registry) UpdateShortcuts added in v1.43.0

func (r *Registry) UpdateShortcuts(keybindings map[string]string)

UpdateShortcuts overwrites action Shortcut fields with user-configured keys. It first clears any existing action that held the same shortcut key to prevent duplicate display in the palette.

type SettingsHandlers

type SettingsHandlers struct {
	Theme     func() tea.Cmd
	Help      func() tea.Cmd
	Taskboard func() tea.Cmd
}

SettingsHandlers holds callbacks for settings actions.

type StatusHandlers

type StatusHandlers struct {
	StageFile    func() tea.Cmd
	CommitStaged func() tea.Cmd
	CommitAll    func() tea.Cmd
	EditFile     func() tea.Cmd
	DeleteFile   func() tea.Cmd
}

StatusHandlers holds callbacks for status pane actions.

type WorktreeHandlers

type WorktreeHandlers struct {
	Create            func() tea.Cmd
	Delete            func() tea.Cmd
	Rename            func() tea.Cmd
	EditMetadata      func() tea.Cmd
	Annotate          func() tea.Cmd
	SetIcon           func() tea.Cmd
	SetColor          func() tea.Cmd
	SetDescription    func() tea.Cmd
	SetTags           func() tea.Cmd
	BrowseTags        func() tea.Cmd
	Absorb            func() tea.Cmd
	Prune             func() tea.Cmd
	CreateFromCurrent func() tea.Cmd
	CreateFromBranch  func() tea.Cmd
	CreateFromCommit  func() tea.Cmd
	CreateFromPR      func() tea.Cmd
	CreateFromIssue   func() tea.Cmd
	CreateFreeform    func() tea.Cmd
}

WorktreeHandlers holds callbacks for worktree actions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL