Loading...
Loading...
Non-interactive hunk and line-range staging with the `git-hunk` CLI. Use when a user wants atomic commits, selective staging, partial hunk staging, or an agent-safe replacement for `git add -p` or `git commit -p`, especially when `git-hunk` is available in the current repo or on `PATH`.
npx skill4agent add diodeinc/pcb git-hunkgit-hunkchange_keysnapshot_idchange_idgit-hunk scan --mode stage --jsongit-hunk show --mode stage <hunk-id>
git-hunk show --mode stage <change-id> --json
git-hunk show --mode stage <change-key> --jsongit-hunk stage --snapshot <snapshot-id> --hunk <hunk-id>
git-hunk stage --snapshot <snapshot-id> --change <change-id>
git-hunk stage --snapshot <snapshot-id> --change-key <change-key>
git-hunk stage --snapshot <snapshot-id> --hunk <hunk-id>:new:41-44
git-hunk stage --snapshot <snapshot-id> --change-key <change-key> --dry-run --jsongit-hunk commit -m "feat: message" --snapshot <snapshot-id> --change <change-id>
git-hunk commit -m "feat: message" --snapshot <snapshot-id> --change-key <change-key>
git-hunk commit -m "fix: message" --snapshot <snapshot-id> --hunk <hunk-id>:old:18-22
git-hunk commit -m "feat: message" --snapshot <snapshot-id> --change-key <change-key> --dry-run --jsongit-hunk resolve --mode stage --snapshot <snapshot-id> --path src/lib.rs --start 42 --jsongit-hunk validate --mode stage --snapshot <snapshot-id> --change-key <change-key> --compact --jsonscan --mode stagechange_idchange_key--jsonsnapshot_idscan --compact --jsonscan --mode unstageHEADunstagegit-hunk unstage --snapshot <snapshot-id> --change <change-id>
git-hunk unstage --snapshot <snapshot-id> --change-key <change-key>
git-hunk unstage --snapshot <snapshot-id> --hunk <hunk-id>:old:10-12change_idchange_key_schemev1change_keychange_key--change-keyscanshowstageunstagecommitchange_keychange_idresolveresolvechange_idchange_key--side autonewstageoldunstagegit-hunk resolve --mode stage --snapshot <snapshot-id> --path src/lib.rs --start 42 --end 47 --json
git-hunk resolve --mode unstage --snapshot <snapshot-id> --path src/lib.rs --start 42 --side old --jsonvalidatesnapshot_idchange_keystage --dry-rununstage --dry-runcommit --dry-run<hunk-id>:<old|new>:<start-end>newoldshow--jsonchange_keychange_idresolvesnapshot_idstageunstagecommitstale_snapshoterror.detailsvalidatechange_keysnapshot_id{
"snapshot_id": "s_123",
"selectors": [
{ "type": "hunk", "id": "h_abc" },
{ "type": "change", "id": "c_def" },
{ "type": "change_key", "key": "ck_xyz" },
{
"type": "line_range",
"hunk_id": "h_xyz",
"side": "new",
"start": 41,
"end": 44
}
]
}git-hunk stage --plan plan.json --json
git-hunk stage --plan - --json < plan.json
git-hunk commit -m "refactor: split change" --plan plan.json --jsonambiguous_line_rangechange_idscanerror.categoryerror.retryableerror.detailsunsupportedgit-hunkcommit--allow-emptychange_keyresolvevalidatechange_keystage --dry-rununstage --dry-runcommit --dry-runcommitstage