but
0
总安装量
4
周安装量
安装命令
npx skills add https://github.com/gitbutlerapp/gitbutler --skill but
Agent 安装分布
amp
4
opencode
4
kimi-cli
4
codex
4
gemini-cli
4
Skill 文档
GitButler CLI Skill
Use GitButler CLI (but) as the default version-control interface.
Non-Negotiable Rules
- Use
butfor all write operations. Never rungit add,git commit,git push,git checkout,git merge,git rebase,git stash, orgit cherry-pick. - Start every write/history-edit task with
but status --json. - For mutation commands, always add
--json --status-after. - Use CLI IDs from
but status --json/but diff --json/but show --json; do not hardcode IDs and do not switch branches withgit checkout. - After a successful mutation with
--status-after, do not run a redundantbut statusunless needed for new IDs. - If the user says a
gitwrite command (for example “git push”), translate it to thebutequivalent and execute thebutcommand directly. - For branch-update tasks, run
but pull --check --jsonbeforebut pull --json --status-after. Do not substitutebut fetch+ status summaries for this check. - Avoid routine
--helpprobes before mutations. Use the command patterns in this skill (andreferences/reference.md) first; only use--helpwhen syntax is genuinely unclear or after a failed attempt.
Core Flow
but status --json
# If new branch needed:
but branch new <name>
# Perform task with IDs from status/diff/show
but <mutation> ... --json --status-after
Canonical Command Patterns
- Commit specific files/hunks:
but commit <branch> -m "<message>" --changes <id>,<id> --json --status-after - Create branch while committing:
but commit <branch> -c -m "<message>" --changes <id> --json --status-after - Amend into a known commit:
but amend <file-id> <commit-id> --json --status-after - Reorder commits:
but move <source-commit-id> <target-commit-id> --json --status-after - Push:
but pushorbut push <branch-id> - Pull update safety flow:
but pull --check --jsonthenbut pull --json --status-after
Task Recipes
Commit one file
but status --json- Find that file’s
cliId but commit <branch> -c -m "<clear message>" --changes <file-id> --json --status-after
Commit only A, not B
but status --json- Find
src/a.rsID andsrc/b.rsID - Commit with
--changes <a-id>only
User says “git push”
Interpret as GitButler push. Run but push (or but push <branch-id>) immediately.
Do not run git push, even if but push reports nothing to push.
Check mergeability, then update branches
- Run exactly:
but pull --check --json - If user asked to proceed, run:
but pull --json --status-after - Do not replace step 1 with
but fetch,but status, or a narrative-only summary.
Amend into existing commit
but status --json- Locate file ID and commit ID from
status(orbut show <branch-id> --json) - Run exactly:
but amend <file-id> <commit-id> --json --status-after - Never use
git checkoutorgit commit --amend
Reorder commits
but status --json- Identify source/target commit IDs in the branch by commit message
- Run:
but move <commit-a> <commit-b> --json --status-after - From the returned
status, refresh IDs and then run the inverse move:but move <commit-b> <commit-a> --json --status-after - This two-step sequence is the safe default for reorder requests.
- Never use
git rebasefor this.
Git-to-But Map
git status->but status --jsongit add+git commit->but commit ... --changes ... --json --status-aftergit checkout -b->but branch new <name>git push->but pushgit rebase -i->but move,but squash,but rewordgit cherry-pick->but pick
Notes
- Prefer explicit IDs over file paths for mutations.
--changesis the safe default for precise commits.--changesaccepts one argument per flag. For multiple IDs, use comma-separated values (--changes a1,b2) or repeat the flag (--changes a1 --changes b2), not--changes a1 b2.- Read-only git inspection is allowed (
git log,git blame) when needed. - Keep skill version checks low-noise:
- Do not run
but skill checkas a routine preflight on every task. - Run
but skill checkwhen command behavior appears to diverge from this skill (for example: unexpected unknown-flag errors, missing subcommands, or output shape mismatches), or when the user asks. - If update is available, recommend
but skill check --update(or run it if the user asked to update).
- Do not run
- For deeper command syntax and flags, use
references/reference.md. - For workspace model and dependency behavior, use
references/concepts.md. - For end-to-end workflow patterns, use
references/examples.md.