custom_commands

package
v0.66.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch added in v0.42.0

type Branch struct {
	Name           string
	DisplayName    string
	Recency        string
	Pushables      string // deprecated: use AheadForPull
	Pullables      string // deprecated: use BehindForPull
	AheadForPull   string
	BehindForPull  string
	AheadForPush   string
	BehindForPush  string
	UpstreamGone   bool
	Head           bool
	DetachedHead   bool
	UpstreamRemote string
	UpstreamBranch string
	Subject        string
	CommitHash     string
}

type Client

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

Client is the entry point to this package. It returns a list of keybindings based on the config's user-defined custom commands. See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md for more info.

func NewClient

func NewClient(
	c *helpers.HelperCommon,
	helpers *helpers.Helpers,
) *Client

func (*Client) GetCustomCommandKeybindings

func (self *Client) GetCustomCommandKeybindings() ([]*types.Binding, error)

type Commit added in v0.42.0

type Commit struct {
	Hash          string
	Sha           string // deprecated: use Hash
	Name          string
	Status        models.CommitStatus
	Action        todo.TodoCommand
	Tags          []string
	ExtraInfo     string
	AuthorName    string
	AuthorEmail   string
	UnixTimestamp int64
	Divergence    models.Divergence
	Parents       []string
}

type CommitFile added in v0.42.0

type CommitFile struct {
	Name         string
	ChangeStatus string
}

type CommitRange added in v0.46.0

type CommitRange struct {
	From string
	To   string
}

type CustomCommandObject added in v0.36.0

type CustomCommandObject struct {
	// deprecated. Use Responses instead
	PromptResponses []string
	Form            map[string]string
}

type CustomCommandObjects

type CustomCommandObjects struct {
	*SessionState
	PromptResponses []string
	Form            map[string]string
}

type File added in v0.42.0

type File struct {
	Name                    string
	PreviousName            string
	HasStagedChanges        bool
	HasUnstagedChanges      bool
	Tracked                 bool
	Added                   bool
	Deleted                 bool
	HasMergeConflicts       bool
	HasInlineMergeConflicts bool
	DisplayString           string
	ShortStatus             string
	IsWorktree              bool
}

type HandlerCreator

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

takes a custom command and returns a function that will be called when the corresponding user-defined keybinding is pressed

func NewHandlerCreator

func NewHandlerCreator(
	c *helpers.HelperCommon,
	sessionStateLoader *SessionStateLoader,
	suggestionsHelper *helpers.SuggestionsHelper,
	mergeAndRebaseHelper *helpers.MergeAndRebaseHelper,
) *HandlerCreator

type KeybindingCreator

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

KeybindingCreator takes a custom command along with its handler and returns a corresponding keybinding

func NewKeybindingCreator

func NewKeybindingCreator(c *helpers.HelperCommon) *KeybindingCreator
type MenuGenerator struct {
	// contains filtered or unexported fields
}

func NewMenuGenerator

func NewMenuGenerator(c *common.Common) *MenuGenerator

takes the output of a command and returns a list of menu entries based on a filter and value/label format templates provided by the user

type Remote added in v0.42.0

type Remote struct {
	Name     string
	Urls     []string
	PushUrls []string
	Branches []*RemoteBranch
}

type RemoteBranch added in v0.42.0

type RemoteBranch struct {
	Name       string
	RemoteName string
}

type Resolver

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

takes a prompt that is defined in terms of template strings and resolves the templates to contain actual values

func NewResolver

func NewResolver(c *common.Common) *Resolver

type SessionState

type SessionState struct {
	SelectedLocalCommit    *Commit // deprecated, use SelectedCommit
	SelectedReflogCommit   *Commit // deprecated, use SelectedCommit
	SelectedSubCommit      *Commit // deprecated, use SelectedCommit
	SelectedCommit         *Commit
	SelectedCommitRange    *CommitRange
	SelectedFile           *File
	SelectedSubmodule      *Submodule
	SelectedPath           string
	SelectedLocalBranch    *Branch
	SelectedRemoteBranch   *RemoteBranch
	SelectedRemote         *Remote
	SelectedTag            *Tag
	SelectedStashEntry     *StashEntry
	SelectedCommitFile     *CommitFile
	SelectedCommitFilePath string
	SelectedWorktree       *Worktree
	CheckedOutBranch       *Branch
}

SessionState captures the current state of the application for use in custom commands

type SessionStateLoader

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

loads the session state at the time that a custom command is invoked, for use in the custom command's template strings

func NewSessionStateLoader

func NewSessionStateLoader(c *helpers.HelperCommon, refsHelper *helpers.RefsHelper) *SessionStateLoader

type StashEntry added in v0.42.0

type StashEntry struct {
	Index   int
	Recency string
	Name    string
}

type Submodule added in v0.57.0

type Submodule struct {
	Name string
	Path string
	Url  string
}

type Tag added in v0.42.0

type Tag struct {
	Name    string
	Message string
}

type TrimmerTemplate

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

wrapper around a template which trims the output

func NewTrimmerTemplate

func NewTrimmerTemplate(template *template.Template) *TrimmerTemplate

type Worktree added in v0.42.0

type Worktree struct {
	IsMain        bool
	IsCurrent     bool
	Path          string
	IsPathMissing bool
	GitDir        string
	Branch        string
	Name          string
}

Jump to

Keyboard shortcuts

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