acker-dacker
v0.3.0
Published
Create deterministic, privacy-aware repository ZIPs for AI handoffs and code review.
Readme
Acker Dacker
A Bun CLI for making deterministic repository ZIPs for AI handoffs and code review.
Requirements
- Bun 1.4.0 or newer
- Git: required for
--git-handoff; optional for default mode (used for tag/hash archive naming andcore.excludesfilediscovery, with graceful fallback when Git is unavailable)
Use it
Run the published CLI without a global install:
bunx acker-dacker <repository-path> [options]Examples:
# Privacy-oriented default pack
bunx acker-dacker ../my-repository
# Include only Markdown and TypeScript files
bunx acker-dacker ../my-repository --filter "*.md" --filter "*.ts"
# Include an additional local directory
bunx acker-dacker ../my-repository --include ../shared-fixtures
# Capture the Git worktree, including eligible untracked files
bunx acker-dacker ../my-repository --git-handoff --output ./handoff.zip
# Create the minimal Rust Stage 3 handoff and a content-free report
bunx acker-dacker ../codex --git-handoff --profile rust-stage3 \
--output ./rust-stage3.zip --report ./rust-stage3.jsonIf <repository-path> is omitted, the current directory is used.
Archive output naming
Unless --output is supplied, archive names resolve as follows:
- In
--git-handoffmode, the default name is./<repository-name>-git-handoff.zip. Artifacts (--outputand--report) must be outside the Git worktree. - In default mode, naming follows this order of preference:
- Git tag version for the current checkout (e.g.
./<repository-name>-v2.33.zip). If multiple version tags point to HEAD, the highest numeric version is selected. If only non-version tags exist, a deterministic lexical tie-break is used regardless of repositorytag.sortconfiguration. package.jsonversion if present (e.g../<repository-name>-0.1.0.zip).- Short Git commit hash for the current checkout (e.g.
./<repository-name>-abcdef.zip). - Fallback to
./<repository-name>.zipif none of the above are present or if Git is unavailable.
- Git tag version for the current checkout (e.g.
Run bunx acker-dacker --help for the current usage text. The options are:
| Option | Description |
| --- | --- |
| --git-handoff | Use Git's tracked plus eligible-untracked file set and preserve modes and safe symlinks. |
| --profile <name> | Select a Git handoff profile. Currently rust-stage3; requires --git-handoff. |
| --filter, -f <pattern> | Include only matching paths or file names. Repeatable. |
| --include, -i <path\|glob> | Add a local directory, repository dependency, or wildcard glob in default mode. Repeatable. |
| --exclude <path\|glob> | Exclude a root-relative path or glob in Git handoff mode. Repeatable. |
| --output, -o <path> | Set the ZIP output path (default: ./<name>-<tag\|version\|hash>.zip in default mode, or ./<name>-git-handoff.zip in --git-handoff mode; handoff artifacts must be outside the worktree). |
| --report <path> | Write a content-free Git handoff JSON report. Requires --git-handoff. |
| --help, -h | Show help. |
Modes and safety
Default mode recursively discovers local file: and link: package dependencies, honors global Git ignore files alongside root and nested .gitignore files and .git/info/exclude, and omits common generated output, Xcode build artifacts, and sensitive file names. It also supports explicit --include paths.
Global Git ignore configuration
Global ignore files are discovered in the following order:
ACKER_DACKER_GLOBAL_GITIGNOREenvironment variable:- When unset, discovery follows Git conventions below.
- When set to empty string
""or'none', global ignore file discovery is disabled. - Any other value is resolved as a file path relative to
process.cwd().
core.excludesfilefrom Git configuration (if Git is available). If configured, it is used (or contributes no rules if the file is missing), suppressing fallback to XDG/home ignore files.- Standard fallback locations:
$XDG_CONFIG_HOME/git/ignoreor~/.config/git/ignore.
In all cases, repository .git/info/exclude rules and local/nested .gitignore rules apply with higher precedence, allowing repositories to negate global ignore rules.
Git handoff mode
Git handoff mode asks Git for tracked files and standard-ignore-aware untracked files. Tracked files remain eligible by design; sensitive and generated files are safety-filtered only when untracked. Deleted tracked files missing from the worktree are omitted from the archive and recorded in the report. Absolute, escaping, dangling, and cyclic symlinks are rejected, as are symlinked ancestor directories. Output and report artifact paths must reside outside the worktree and cannot alias each other via directory symlinks or hard links. --exclude, --filter, --profile, and --report are applied as documented above.
For a slim source handoff, repeat --exclude for known assets and duplicated captures; no new profile is needed:
bunx acker-dacker ../my-repository --git-handoff \
--exclude '**/*.[gG][lL][bB]' --exclude '**/*.[pP][nN][gG]' \
--exclude recovery/original/public --exclude recovery/original/bundle.js \
--output ./handoff-slim.zip --report ./handoff-slim.jsonExclusions are case-sensitive, root-relative paths/globs; **/ also matches the root, character classes cover mixed-case extensions, and excluding a directory excludes its descendants. The example omits GLBs, PNGs, the captured public tree and captured bundle only; add the other media extensions present in your repository explicitly. File size alone never determines exclusion. Source/shader text, configs, lockfiles and recovery evidence remain unless explicitly matched. Reports list included paths and omission counts per pattern (overlaps count toward the first matching pattern). Keep a full packet for browser parity, asset checks and recovery reproduction, and document which static checks still work in the slim packet.
Determinism and format limits
Archives are deterministic: file ordering, ZIP timestamps (normalized to 1980-01-01), and compression choices do not depend on the current clock. ZIP files are created using maximum DEFLATE compression (level: 9, memLevel: 9), with streaming deflation spooled for entries over 64 MiB (falling back to STORE only if compression does not reduce size). Archive files are written atomically via temporary siblings to ensure existing files are never corrupted on failure.
All archives adhere to the classic ZIP format (non-ZIP64 ceiling):
- Maximum 65,535 total entries.
- Maximum 4 GB uncompressed/compressed entry size and 4 GB total archive size / offset.
- Maximum 65,535 bytes path length.
- Paths are encoded using UTF-8 with General Purpose bit 11 (
0x0800) set in both local and central directory headers.
Development
bun install
bun run test
bun run typecheck
bun run check
bun run buildThe CLI entrypoint is src/index.ts. Workflow orchestration lives in src/cli/cli.ts; argument parsing is in src/cli/cli-options.ts; archive output naming is in src/cli/archive-name.ts; default discovery and policy are in src/pack/repository-pack.ts, src/pack/gitignore.ts, and src/pack/file-policy.ts; Git handoff selection and staging are in src/git/git-handoff-selection.ts and src/git/git-handoff.ts; deterministic ZIP writing is in src/zip/zip.ts.
To inspect the npm package before publishing:
npm pack --dry-runThe package exposes the acker-dacker bin and intentionally ships only src/ (excluding tests) as application files, plus npm's standard metadata files.
Slim Git handoffs
Use acker-dacker ../repo --git-handoff --slim --output ../repo-slim.zip --report ../repo-slim.json. --slim requires --git-handoff and composes with repeatable --exclude. It omits case-insensitive extensions GLB, GLTF, PNG, JPG, JPEG, WebP, GIF, AVIF, ICO, KTX, KTX2, HDR, EXR, MP3, WAV, OGG, MP4, WebM, MOV, WASM, WOFF, WOFF2, TTF and OTF at any depth. Source, shaders, configs, lockfiles and text evidence remain, regardless of size. Captured text bundles remain unless explicitly excluded. Omission counts use the existing report. Default/full behavior is unchanged; keep full assets for browser parity and asset-dependent checks.
