by Scott Chacon

5 min read

Introducing the GitButler CLI

Now in technical preview, the new GitButler CLI brings all the power of GitButler to your command line

Introducing the GitButler CLI

The Git command line interface is now more than 20 years old and it's showing. GitButler has been modernizing the interface to Git projects for our desktop client for years now, and today we're releasing a command line tool that can do all the same powerful things, drop in compatible with all your existing Git projects.

TLDR

The GitButler CLI is a massively simpler, more user friendly and powerful Git interface. It can do tons of things that Git either struggles with or simply cannot do at all, all with a both beautiful and scripting-friendly interface.

Such as...

You can check out our new CLI tutorial to learn all about it in detail, or check out our commands overview, but here is the quick rundown of the fun parts.

How do I install it?

If you have the desktop client installed, you can add the CLI by going to your General Settings in the GitButler GUI and clicking "Install CLI", which will create a global symlink.

You can also install it via Homebrew with a simple brew install gitbutler

brew install gitbutler

Or via a simple bash command (also currently Mac only, but we're working on it...)

curl -fsSL https://gitbutler.com/install.sh | sh

Then you can go into any existing Git project and run but to set it up and start working with all these extra Git features.

Give me a tour!

The but CLI can do much of what the GUI can do and many of the operations should be familiar to you from the Git CLI. For example, you can run but status, but commit, but push, and but branch.

However, there are many things that GitButler can do that Git itself cannot - working with parallel branches, restoring to a previous point, auto-absorbing work, easily editing your commits.

Let's take a super quick overview of some of the cool things you can do with the but CLI.

Shortlog

The main command that you will use is but status, which will run by default when you run but with no subcommand. It runs a combination of a shortlog and status of uncommitted file modifications.

Example output of but status command. Here you can see two branches stacked and one parallel branch also applied.

This is very cool, because it shows you roughly what a git status would - uncommitted changes, but it also shows you the current branches and stacks that you're working with.

Parallel Branches

Imagine you're working on a feature and you spot a bug. Do you stash and fix? Do you fix it in your feature branch?

With GitButler, you can run but branch new bug-fix to create a parallel branch and commit the bug fix to that branch without stashing your feature. We keep both branches in your working directory while keeping them logically seperated.

Stacked Branches

You can also base a new branch off of an existing one if there are dependencies by running but branch -a <target> <new-branch>, which stacks the new branch and links them properly when opening Pull Requests in GitHub.

Here is an example of a stacked PR made with GitButler on PostHog's Twig project:

Managing stacked branches and pull requests in GitButler made easy
Managing stacked branches and pull requests in GitButler made easy

With GitButler's stacked branches, there is no need to move up and down the stack to make changes and restack manually. You can easily insert commits, move commits around or absorb work into exsting commits anywhere in the stack.

For example, modifying commits on the bottom branch of a stack will automatically rebase everything above it properly without any config settings, autosquash, fixup commits, other Git shenanigans needed.

Undo!

All but commands that modify state will automatically create an operations log entry that you can view and restore to any save point whenever you want. You can even run but undo as a quick way to undo the last thing you did.

Pull Requests

The modern workflow often involves opening Pull Requests on GitHub or Merge Requests on GitLab. Unlike Git, the but tool has support for interacting with these forges and their review systems built in.

Running the but pr command will prompt you to open PRs on any applied branches that don't have one associated yet and automatically open them.

GitButler will also periodically do a background check for CI status for any branches with an associated PR. You can see this in but status and you can even get the PR URL with the -v (verbose) option:

Commit Editing

Don't fancy yourself a git rebase -i guru? No problem, we've got:

  • but reword - easily edit any commit message
  • but uncommit - move all changes from any commit back to uncommitted
  • but amend - absorb new modifications into any existing commit
  • but move - reorder commits or move them between branches
  • but squash - combine multiple commits into one

My favorite one, however, is but absorb, which will take all uncommitted changes and try to find the most logical commit in your workspace to absorb each hunk into.

JSON Errwhere

All of the commands are designed to be very user friendly when we have an interactive terminal, but you can also very easily script everything by passing the --json or -j option to anything. For example, here is using but show on a commit.

Now with the --json option:

JSON
❯ but show --json ed498855
{
  "commit": "ed498855b62c51d88250a0b9184e2b6983ab106a",
  "changeId": "qvrnqwpzoxrxvpovpzpyrvsxyzvwokop",
  "author": {
    "name": "Scott Chacon",
    "email": "schacon@gmail.com"
  },
  "committer": {
    "name": "Scott Chacon",
    "email": "schacon@gmail.com"
  },
  "date": "2026-02-04 09:34:58 +0100",
  "message": "Add update-manpages script and pnpm command\n\nProvide a pnpm script to regenerate CLI manpages from the external\nGitButler repo. \n\n",
  "files": [
    {
      "path": "package.json",
      "status": "modified"
    },
    {
      "path": "scripts/update-manpages.sh",
      "status": "added"
    }
  ]
}

You can do this with anything - committing, status, diffing, etc. Just throw a -j in there and you get parseable data (or, data your agent can very easily work with).

AI Skills

Speaking of which, if you want to give your coding agent a much more powerful toolkit for version control, you can easily install skills with but skill install.

What's Next

This is just the beginning. We're excited to keep improving our powerful CLI, capable of so many things Git struggles to do or can't do at all, while being able to design for both a better human experience and a better scripting and agentic interface.

Try it out and let us know what you think (on Discord).

Scott Chacon

Written by Scott Chacon

Scott Chacon is a co-founder of GitHub and GitButler, where he builds innovative tools for modern version control. He has authored Pro Git and spoken globally on Git and software collaboration.

Stay in the Loop

Subscribe to get fresh updates, insights, and
exclusive content delivered straight to your inbox.
No spam, just great reads. 🚀