Skip to content

CLI overview

The Birch Code CLI is a companion to the desktop app. It does two things the GUI can’t easily do:

  1. Integrates with your issue tracker. Given a ticket or PR number, it figures out the right branch name and creates a worktree for it.
  2. Scripts. Every command supports --json so you can pipe its output into hooks, CI, or other tools.

The birch binary is bundled with the desktop app:

  • macOS: /Applications/Birch.app/Contents/Resources/cli/birch
  • Windows: <install-dir>\cli\birch.exe

Add that path to your $PATH (or %PATH%) and you’re set. A future installer will wire this up automatically.

Create a worktree for GitHub issue #42:

Terminal window
birch worktree new --from gh:42

Create a worktree for a GitLab MR:

Terminal window
birch worktree new --from gl:!137

List all worktrees as JSON (great for status bars and shell prompts):

Terminal window
birch worktree list --json

Open a worktree in your default editor:

Terminal window
birch worktree open feature-auth
PrefixSystem
gh:GitHub issues and PRs
gl:GitLab issues and MRs
az:Azure DevOps work items
lin:Linear tickets

See Commands for the full reference and JSON output for machine-readable formats.