carapace-sh/carapace-bin / skills/but
but
VerifiedUse when working with the GitButler CLI (`but`) — virtual branches, stacked branches, workspace model, commit editing (rub, amend, squash, reword), CLI IDs, forge integration, PRs, operations log, conflict resolution, TUI, AI agent setup, skills, aliases, configuration. Triggers on: "but", "gitbutler", "but rub", "but commit", "but status", "but branch", "but apply", "but unapply", "but push", "but pull", "but pr", "but oplog", "but undo", "but redo", "but resolve", "but stage", "but squash", "but amend", "but reword", "but config", "but alias", "but setup", "but teardown", "but tui", "but diff", "but show", "but agent", "but skill", "but clean", "but move", "but pick", "but absorb", "but update", "but completions", "virtual branch", "stacked branch", "integration branch", "gitbutler workspace", "but oplog restore", "but oplog snapshot", "CLI ID", "hunk ID".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.5 KB |
| references/ai-agents.md | markdown | 6.2 KB |
| references/branches.md | markdown | 5.4 KB |
| references/commits.md | markdown | 6.9 KB |
| references/config.md | markdown | 4.5 KB |
| references/conflicts.md | markdown | 2.1 KB |
| references/forge.md | markdown | 3.6 KB |
| references/inspection.md | markdown | 4.5 KB |
| references/misc.md | markdown | 3.4 KB |
| references/oplog.md | markdown | 3.3 KB |
| references/rubbing.md | markdown | 3.0 KB |
| references/tui.md | markdown | 2.1 KB |
| references/workspace.md | markdown | 4.6 KB |
references/inspection.md
View on GitHub# Inspection — Status, Diff, and CLI IDs
Commands for inspecting workspace state and the CLI ID system that identifies changes, commits, and branches.
> **Source of truth**: <https://docs.gitbutler.com/cli-guides/cli-tutorial/inspecting>
## `but status` — Workspace Overview
Show the project workspace state: applied stacks, branches, commits, and unassigned changes.
```bash
but status # Basic overview
but status -f # With file IDs (CLI IDs) in commits
but status -u # With upstream info
but status -v # Verbose (author and timestamp)
but status -r # Refresh PRs from forge first
```
| Flag | Short | Description |
|------|-------|-------------|
| `--files` | | Show committed files (hidden, use `-f` instead) |
| `-f` | `-f` | Show committed files with CLI IDs |
| `--no-hint` | | Disable command hints at end of output |
| `--refresh-prs` | `-r` | Sync pull requests from forge before showing status |
| `--upstream` | `-u` | Show upstream commits not yet integrated |
| `--verbose` | `-v` | Show commit author and timestamp |
### Status Output Structure
The status output shows:
- **Stacks** — Applied stacks with their branches and commits
- **Unassigned changes** — Changes not assigned to any branch (labeled "uncommitted" since 0.20.4)
- **Upstream state** — How far behind the merge base is (with `-u`)
### JSON Output
```bash
but --format json status
but --format json status -f # With committed file details
```
The JSON structure contains:
- `unassignedChanges` — changes not assigned to a branch
- `stacks` — applied stacks, each containing branches and their commits
- `mergeBase` — the target branch commit
- `upstreamState` — how far behind the merge base is (`behind`, `latestCommit`, `lastFetched`)
Each stack contains branches, each branch contains commits, and each commit contains changes.
## `but diff` — Show Diffs
Display the diff of changes in the repo. More readable than `git diff` for GitButler's multi-branch workspace.
```bash
but diff # All uncommitted changes
but diff <id> # Diff a specific file/commit by CLI ID
but diff --tui # Open diff in TUI viewer
```
Positional arguments are CLI IDs or targets — can be changes, commits, or branches.
## `but show` — Show Details
Show detailed information about a commit or branch.
```bash
but show <commit-or-branch>
but show -v <commit> # Full commit messages and files changed
```
| Flag | Short | Description |
|------|-------|-------------|
| `--verbose` | `-v` | Show full commit messages and files changed for each commit |
Positional arguments are targets (commits or branches by CLI ID or name).
## CLI ID System
CLI IDs are short, stable identifiers used throughout the `but` CLI to refer to changes, commits, branches, and stacks. They appear in `but status -f` output and JSON as the `cliId` field.
### ID Format
CLI IDs are multi-part identifiers separated by `:`. Examples:
| ID Pattern | Refers To |
|------------|-----------|
| `h0` | A hunk (change) |
| `i0` | Another change |
| `c3` | A commit |
| `b1` | A branch |
| `zz` | The unassigned area (special) |
### ID Types
CLI IDs identify different entity types:
| Type | Description |
|------|-------------|
| Changes | Uncommitted file/hunk changes (assigned and unassigned) |
| Branches | Branch CLI IDs |
| Commits | Commit CLI IDs |
| Stacks | Stack CLI IDs (including `zz` for unassigned) |
### Change Types
Each change has a `changeType` field:
| Type | Abbreviation | Style |
|------|-------------|-------|
| `added` | `A` | green (positive) |
| `removed` | `D` | red (negative) |
| `modified` | `M` | yellow (ambiguous) |
| `renamed` | `R` | dim |
### Hunk IDs
Hunk IDs are stable across commits and discards (since 0.20.4). This means the same hunk retains its ID even after operations that move it between commits or discard it.
## Output Formats
The `--format` global flag controls output format:
| Format | Description |
|--------|-------------|
| `human` | Default human-readable output |
| `agent` | Formatted for AI agent consumption |
| `shell` | Shell-friendly output |
| `json` | Machine-parseable JSON |
| `none` | No output |
```bash
but --format json status # JSON status
but --format agent status # Agent-optimized status
```
## Related
- [workspace.md](workspace.md) — Workspace model and concepts
- [commits.md](commits.md) — Commit commands that use CLI IDs
- [rubbing.md](rubbing.md) — Rub command using CLI IDs
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |