Sidequery

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]
FlagDescription
--base <ref>Base branch or commit to create from (default: current branch)
--no-openCreate worktree without opening Ghostty

ghostree list

List all active worktrees.

ghostree list [--json]
FlagDescription
--jsonOutput 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]
FlagDescription
--forceRemove even if there are uncommitted changes

ghostree prune

Remove worktrees for branches that have been merged.

ghostree prune [--dry-run]
FlagDescription
--dry-runShow 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.