Non-interactive git staging at file, hunk, and line granularity. MCP server + skill for structured commit workflows.
Non-interactive git staging at file, hunk, and line granularity.
git add -p requires a TTY. pgs doesn't.
git add -p is interactive — AI agents and scripts have no TTYgit apply --cached is fragile — one off-by-one line number and the patch failsgit diff output is unstructured — no stable way to reference a specific hunk across commandspgs provides content-addressed hunk IDs (SHA-256), atomic staging with automatic backup/restore, and structured output parseable by both humans and machines.
pgs scan # list unstaged changes
pgs scan src/main.rs --full # line-level diff for one file
pgs stage src/main.rs # stage entire file
pgs stage abc123def456 # stage specific hunk by ID
pgs stage src/main.rs:10-20 # stage line range (1-indexed, inclusive)
pgs stage src/main.rs --dry-run # validate without modifying index
pgs unstage src/main.rs # remove file from index
pgs status # show staged changes (HEAD vs index)
pgs commit -m "feat: add feature" # commit
Positional arguments are auto-detected:
| Pattern | Example | Meaning |
|---|---|---|
| File path | src/main.rs | Entire file |
| Hunk ID | abc123def456 | 12-hex content-addressed ID from scan |
| Line range | src/main.rs:10-20,30-40 | 1-indexed, inclusive |
--exclude uses the same syntax: pgs stage src/main.rs --exclude abc123def456
Default: structured text markers — @@pgs:v1 <kind> <json>.
JSON: opt-in via --json or --output json.
See docs/CLI_SPEC.md for the full output contract.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | No effect (nothing to stage, empty selection) |
| 2 | User error (bad syntax, binary file constraint) |
| 3 | Conflict — re-scan and retry (stale scan, locked index) |
| 4 | Internal error |
Install pgs as a Claude Code plugin for automatic MCP tool integration and the git-commit-staging skill:
# Add the marketplace
/plugin marketplace add UtsavBalar1231/pgs
# Install the plugin
/plugin install pgs@pgs-marketplace
Or test locally during development:
claude --plugin-dir /path/to/pgs
What you get:
pgs_scan, pgs_stage, pgs_unstage, pgs_status, pgs_commit — available automatically via the bundled MCP serverSupported platforms: macOS (Intel + Apple Silicon), Linux (x86_64 + ARM64). Windows binaries are available for standalone use via claude mcp add.
pgs also ships pgs-mcp, a local stdio MCP server for the same scan/status/stage/unstage/commit workflow.
cargo run --bin pgs-mcp
Or add it manually to Claude Code without the plugin:
claude mcp add --transport stdio pgs -- /path/to/pgs-mcp
MCP tool calls require an explicit repo_path. For full MCP usage, task support, and safety notes, see docs/MCP_SERVER.md.
cargo build # compile
cargo test # all tests
cargo clippy -- -D warnings # lint (zero warnings)
cargo fmt --check # format check
Requires Rust 1.85+ and a C compiler (for libgit2).
See docs/CLI_SPEC.md for the complete output contract and docs/ARCHITECTURE.md for system design.
Admin access level
Server config contains admin-level keywords
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Multi-agent orchestration for Claude Code. Specialist agents handle planning, execution, code review, debugging, and research with evidence-based verification.
Linux kernel driver API, debugging, testing, review, devicetree, stable, and vendor/LTS workflows packaged as an Agent Skill.
npx claudepluginhub utsavbalar1231/pgs --plugin pgsSurgical, non-interactive git hunk control for AI agents
Advanced commit workflows with smart staging and push automation
Git commit workflow without Claude attribution
Generate Git commit messages from staged diffs and apply them automatically, using git-ai-commit as the execution backend.
Git commit workflow: atomic commits, validation, conventions
Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques