Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

git-hunk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-hunk

Non-interactive hunk staging for AI agents

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

git-hunk

Non-interactive hunk staging for AI agents. A better git add.

Built with Bun + Bunli. TypeScript rewrite of nexxeln/git-hunk (Rust) — same core concepts (snapshots, change keys, hunk-level staging), redesigned for agent workflows.

What this solves over the Rust version

  • --path selector — stage entire files without extracting change keys. Agents spent most of their time mapping files to change keys via python one-liners; now --path src/lib.ts,src/other.ts just works.
  • --summary scan mode — file-level overview without hunks or changes. The orchestrator only needs filenames and line counts to form groups, not 649 change keys.
  • Staging only, no commits — the Rust version bundled commit which mixed concerns. This version does one thing: stage precisely. Use regular git commit after.
  • JS bundle distribution — no compiled binary issues. Runs anywhere Bun is installed. The Rust version required cargo or prebuilt binaries.
  • Simpler codebase — ~1400 lines of TypeScript vs ~3900 lines of Rust, for equivalent functionality. Easier to iterate on.

Install

bun install

Usage

# File-level overview
git-hunk scan --summary --json

# Change-level detail
git-hunk scan --compact --json

# Stage whole files
git-hunk stage --snapshot <id> --path src/lib.ts,src/other.ts --json

# Stage specific changes
git-hunk stage --snapshot <id> --change-key ck_abc,ck_def --json

# Preview before staging
git-hunk stage --snapshot <id> --path src/lib.ts --dry-run --json

# Stage everything
git-hunk stage --snapshot <id> --all --json

# Inspect a change
git-hunk show <change-key> --json

# Unstage
git-hunk unstage --snapshot <id> --path src/lib.ts --json

Development

bun dev -- scan --summary --json
bun test
bun run typecheck

Keywords

git

FAQs

Package last updated on 26 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts