Skip to content

Consider making lazygit scriptable with an internal API #4753

@stefanhaller

Description

@stefanhaller

Lazygit can be customized by defining custom commands, but all these can do is launch external programs or scripts.

It would be nice if custom commands could trigger scripts (probably in Lua) that have access to an internal API so that they can trigger things in lazygit. Examples for such things are

  • focus a view
  • select an item
  • invoke a command
  • switch to another repo
  • change the value of a user config

Providing Lua bindings seems possible using either https://github.com/Shopify/go-lua or https://github.com/yuin/gopher-lua.

This is probably a huge task, there are tons of questions to be answered, and I'm not planning to work on this any time soon. Just putting this here so that we can link to it from other issues, for which this could be a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions