Using the Command Line Tool

With the Tower Command Line Tool, you can stay in your terminal until the moment you want to look at something — and then a single command takes you right there in Tower.

This is especially handy when you're working with AI coding agents: once the agent has finished its task, one command opens its changes in Tower's Working Copy, so you can review them in a proper diff view before anything gets committed.

gittower is a launcher, not a Git client. It never commits, pushes, or changes your working files. Almost every command on this page simply opens a repository in Tower, or opens it at a particular view. The only exception is gittower branch, which can also write Tower's branch stacking information into your repository's Git config.

Tower 18 Beta The commands on this page require Tower 18 for Mac, which is currently in Beta. To try it out, change the Release channel to "Beta" under Settings → Updates. You'll also need to install the command line tool — run gittower --version to check that its version matches Tower's.

Opening a Repository

To open the repository you're currently working in, type the following from anywhere inside your project. This works from subfolders, too — Tower will find the repository's root folder for you:

gittower .

You can also open a repository located somewhere else, or name a file to open the repository it belongs to:

gittower ~/Projects/my-app
gittower src/Parser.swift

If the folder isn't a Git repository yet, Tower will offer to create one there.

New Window or New Tab Add -n (or --new-window) to open the repository in a new window, or --new-tab to open it in a new tab. These options work with all the view commands below, too.

Opening the History

The history command opens the History view — either for the whole repository, or scoped to a branch, a tag, or a single file:

gittower history                      # the whole repository
gittower history feature/login        # a branch
gittower history v1.1                 # a tag
gittower history src/Parser.swift     # a single file

You can even use Git's <revision>:<file> notation to see a file's history as of an older revision:

gittower history v1.0:src/Parser.swift

Opening a Specific Commit

Spotted an interesting commit while reading git log? Pass it to the commit command, and Tower will open the History view with that commit already selected:

git log --oneline -3
9f8a4b4 Extract token scanning from the parser
2ed2188 Add the renderer
a1b2c3d Fix the crash when the document is empty

gittower commit 9f8a4b4

Anywhere a commit is expected, you can use anything Git itself understands: a short or full commit hash, a branch name, a tag, or an expression like HEAD~3.

History vs. Commit Use history to choose which commits are listed, and commit to point at one specific commit.

Opening the Blame View

Want to know who wrote a particular line? Instead of switching to Tower, finding the repository, finding the file, and opening Blame, just type:

gittower blame src/Parser.swift

Tower comes to the front with the Blame view for that file already open. Just like with History, you can also travel back in time and see the file as it was at an older commit or tag:

gittower blame a1b2c3d:src/Parser.swift
gittower blame v1.0:src/Parser.swift

Reviewing Your Working Copy and Stashes

To review your uncommitted changes in Tower's Working Copy view, run:

gittower working-copy

If your fingers are used to typing git status, gittower status works too.

Your stashes are just as easy to reach:

gittower stashes

Opening Branches Review

The branches-review command opens the Branches Review view. You can have filters, sorting, and search applied right away — for example, to see only stale branches, or only those that won't merge cleanly:

gittower branches-review --filter stale
gittower branches-review --filter conflicts

These are all the options you can use:

  • --filter <value> shows only certain branches. Available values are none, mergeable, fully-merged, conflicts, active, stale, tracking-error, has-pr, and no-pr.
  • --branch <name> preselects a branch in the list.
  • --base <branch> compares all branches against this base branch.
  • --search <text> prefills the search field.
  • --sort name or --sort last-updated sorts the list, and --desc reverses the order.

Here are a few more examples:

gittower branches-review --filter fully-merged
gittower branches-review --branch feature/login --base main
gittower branches-review --sort last-updated --desc
gittower branches-review --search feature

Pull Requests, Settings, and Cloning

A few more handy shortcuts:

gittower pull-requests
gittower settings
gittower clone https://github.com/user/repo.git
  • pull-requests opens the Pull Requests view. You can also type gittower prs.
  • settings opens the repository's settings.
  • clone opens Tower's clone dialog with the URL already filled in. HTTPS and SSH URLs (like git@github.com:user/repo.git) both work.

Reading and Setting Stacked Branch Information

The branch command is the only one that doesn't open Tower. If you're using Stacked Branches, it lets you read and change Tower's branch stacking information directly from the terminal.

To check a branch's parent, or whether it is stacked:

gittower branch parent feature/login
gittower branch stacked feature/login

If you leave out the branch name, the currently checked-out branch is used.

To change this information:

gittower branch parent bugfix/crash --set main    # record "main" as the parent
gittower branch parent bugfix/crash --clear       # remove the parent and the stacked flag
gittower branch stacked bugfix/crash --set        # mark the branch as stacked on its parent
gittower branch stacked bugfix/crash --clear      # stop stacking, but keep the parent

Setting a parent doesn't stack the branch by itself — use gittower branch stacked <branch> --set for that. A branch needs a parent before it can be stacked.

These values are stored in your repository's Git config, so Tower and the terminal always agree. If Tower is already running, it will pick up any changes the next time it reloads your branches.

Just like the view commands, gittower branch accepts -C <path> to work with a repository other than the current folder. This is especially useful in scripts, or when an AI agent runs the command for you:

gittower branch parent feature/login -C ~/Projects/my-app

Options for All View Commands

Every command that opens a view (history, commit, blame, working-copy, stashes, branches-review, pull-requests, and settings) accepts these options:

  • -C <path> runs the command as if it was started in that folder — just like Git's own -C option. This lets you target a repository without leaving your current folder. (gittower branch accepts it, too.)
  • -n or --new-window opens the repository in a new window.
  • --new-tab opens the repository in a new tab.

For example:

gittower history -C ~/Projects/my-app --new-tab

Being Specific About What You Mean

Sometimes a name could mean more than one thing. For example, you might have a branch and a file both named release-notes. In that case, gittower doesn't guess — it tells you about the conflict and suggests how to be specific:

  • For the file, use ./release-notes, or put it after Git's -- separator: gittower history -- release-notes
  • For the branch, use its full name: gittower history refs/heads/release-notes

The -- separator also helps with files whose names start with a dash, like gittower history -- -notes.

If you want to open a folder that happens to share its name with a command (like a folder named history), use the open command: gittower open history.

Typos Welcome Made a typo? If you type gittower histroy, gittower will ask if you meant history.

Using the Command Line Tool in Scripts

gittower follows standard Unix exit codes, so it behaves predictably in your scripts:

  • 0 means the request was sent to Tower successfully, or a value was read or written.
  • 1 means "no" — for example, gittower branch stacked printed false, or gittower branch parent printed nothing because the branch has no parent. This is an answer, not an error.
  • Any other exit code means that nothing happened. The reason is printed to the terminal — for example, because the current folder isn't inside a Git repository.

Teaching Your AI Agent About gittower

AI coding agents like Claude Code or Codex don't know about gittower out of the box. To help them, we have created an Agent Skill: a small Markdown file that tells your agent what the Tower Command Line Tool can do, and when it makes sense to use it.

Once it's installed, you can simply ask your agent to "show me the history of this file in Tower" or "open Branches Review with only the stale branches". And when the agent finishes a task, it will offer to open the Working Copy in Tower, so you can review its changes before committing.

Agents can also use gittower to keep Tower in the loop while they work. For example, when an agent creates a new branch on top of another one, it can record that relationship with gittower branch parent <branch> --set <parent> — and then open the branch's history in Tower with gittower history <branch>, so you can review its commits there.

To install the skill in Claude Code, save the Tower CLI skill file as ~/.claude/skills/tower-cli/SKILL.md — or run this command in your terminal:

mkdir -p ~/.claude/skills/tower-cli && curl -fsSL https://www.git-tower.com/blog/assets/downloads/tower-cli/SKILL.md -o ~/.claude/skills/tower-cli/SKILL.md

The skill follows the open Agent Skills format, so it also works with other agents that support it. Simply place the file in that agent's skills folder instead.

Getting Help in the Terminal

To see a list of all available commands, run:

gittower --help

For the details of a specific command, use gittower help <command>, for example gittower help branches-review.

Licensing You can also use the command line tool to deploy and manage licenses in a scripted manner.