GuidesCLI Tutorial
Scripting
How to script with GitButler CLI
JSON output
Commands are designed to be user friendly in an interactive terminal, and you can script them by passing --format json to commands that support JSON output. For example, here is but show on a commit.
$ but show 2672465
Commit: 26724656b8856871542da1e69c888b2e7330294a Change-ID: pzyoupplvookqoqpussrpnnlrwqsnzkr Author: Scott Chacon <schacon@gmail.com> Date: 2026-02-04 07:22:53 +0100 (3d ago) hero update - new branding Files changed: M app/models/user.rb M app/views/home/index.html.erb A test.md
Now with JSON output:
$ but show --format json 2672465 | jq
{
"commit": "26724656b8856871542da1e69c888b2e7330294a",
"author": {
"name": "Scott Chacon",
"email": "schacon@gmail.com"
},
"committer": {
"name": "Scott Chacon",
"email": "schacon@gmail.com"
},
"date": "2026-02-04 07:22:53 +0100",
"message": "hero update - new branding\n",
"files": [
{
"path": "app/models/user.rb",
"status": "modified"
},
{
"path": "app/views/home/index.html.erb",
"status": "modified"
},
{
"path": "test.md",
"status": "added"
}
],
"changeId": "pzyoupplvookqoqpussrpnnlrwqsnzkr"
}
You can use --format json with commands that support formatted output, such as committing, status, and diffing, to get parseable data for scripts or agents.
Last updated on