CLI Reference
Complete reference for all ghostree commands.
ghostree new
Create a new worktree and open it in Ghostty.
ghostree new <branch> [--base <ref>] [--no-open]
| Flag | Description |
|---|---|
--base <ref> | Base branch or commit to create from (default: current branch) |
--no-open | Create worktree without opening Ghostty |
ghostree list
List all active worktrees.
ghostree list [--json]
| Flag | Description |
|---|---|
--json | Output as JSON |
ghostree switch
Switch to an existing worktree. Without arguments, opens fuzzy search.
ghostree switch [<branch>]
ghostree remove
Remove a worktree and close its Ghostty window.
ghostree remove <branch> [--force]
| Flag | Description |
|---|---|
--force | Remove even if there are uncommitted changes |
ghostree prune
Remove worktrees for branches that have been merged.
ghostree prune [--dry-run]
| Flag | Description |
|---|---|
--dry-run | Show what would be removed without removing |
ghostree status
Show the status of all worktrees (branch, uncommitted changes, ahead/behind).
ghostree status
ghostree shell-init
Print shell integration script.
ghostree shell-init <shell>
Supported shells: zsh, bash, fish.