GitButler ⧓

GuidesCLI Tutorial

Working with AI

How to use the GitButler CLI with AI and agents

There are a couple of different ways that the GitButler CLI can use or interact with AI tools. Some are via --ai options to commands to use AI to help with tasks, others are ways that coding agents can more easily use the CLI to accomplish tasks.

Dash Dash AI

There are a few commands that will take a --ai option to use a configured AI provider to generate something.

but commit --ai

Probably the most commonly used would be but commit --ai, which will take a look at the changes in the files you're committing and generate an example commit message for you. If you're not feeling like writing anything more than "did some stuff", this could be a nice option for you.

This will automatically commit the work specified with the generated message, but you can also easily edit it with but reword <commit> if you wish.

but squash --ai

If you squash two commits together, by default it will simply concatenate the commit messages together, which is rarely what you probably want. You can easily edit the message afterwards, but if you want to let AI try to combine the messages for you, you can give but squash --ai a try.

We're working on integrating AI features into many more of our commands, so keep an eye out.

Skills

If you're using an AI coding agent that can read skills, you can have GitButler automatically install a GitButler specific skill for various agents with but skill install.

❯ but skill install

Select a skill folder format:

? Which format would you like to use?:
> Claude Code - Claude Code CLI skill format (./.claude/skills/gitbutler)
  OpenCode - OpenCode AI skill format (./.opencode/skills/gitbutler)
  Codex - Codex skill format (./.codex/skills/gitbutler)
  GitHub Copilot - GitHub Copilot local (repo) skill format (./.github/skills/gitbutler)
  GitHub Copilot - GitHub Copilot global skill format (./.copilot/skills/gitbutler)

We keep these templates up to date, so if you update GitButler, you may want to update the skills too.

Hooks and MCP

You can also install explicit hooks or an MCP server if you prefer. You can read more about those options over here

Last updated on

On this page

Edit on GitHubGive us feedback