Skip to content

snarang181/repropack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReproPack

ReproPack is a small CLI that turns a failing command into a shareable repro bundle: logs, environment/tooling info, git state, and (optionally) the relevant source files — with redaction on by default.

It’s designed to make “can you send a repro?” painless.


Features

  • Capture command execution:
    • stdout / stderr logs
    • exit code + wall time
    • runnable run.sh replay script
    • machine-readable repropack.json manifest
  • Capture environment + tools:
    • macOS info: sw_vers, uname, sysctl
    • tool versions (clang/cmake/python/rustc/git/etc.)
  • Capture git info (when available):
    • HEAD SHA (or “no commits yet”)
    • dirty status
    • git diff patch
    • sanitized remotes
  • Include source files:
    • --files changed copies changed files into the bundle (skips common secret files)
  • Redaction default ON
    • scrubs common token/secret patterns from logs + diffs + remotes
    • disable with --no-redact
  • Optional zip output:
    • --zip produces repro_....zip
  • Replay:
    • repropack replay <bundle_dir>

Install

Prerequisites

  • Rust toolchain (rustc, cargo)

Install Rust (macOS/Linux):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Build from source

git clone https://github.com/snarang181/repropack.git
cd repropack
cargo build --release

The compiled binary will be located at target/release/repropack.

Usage

Create a bundle on failure

repropack run -- bash -lc "echo hello; echo err >&2; exit 3"

Force a bundle even on success

repropack --always run -- echo hello

Zip the bundle

repropack --zip run -- bash -lc "exit 3"
# creates repro_....zip next to the folder

Include changed files from git

repropack --files changed run -- bash -lc "exit 3"
# includes changed files in the bundle

Disable redaction

repropack --no-redact run -- bash -lc "echo 'Bearer abcdef123'; exit 3"
# includes sensitive info in logs/diffs/remotes

Replay a bundle

repropack replay <bundle_dir>
# runs the captured command in the bundle

CLI Reference

Global Flags

  • --out <DIR>: Output directory name (default: repro_<timestamp>)
  • --always: Always create a bundle, even if the command succeeds
  • --zip: Create a zip archive of the bundle
  • --files <none|changed|all>: Include source files in the bundle
  • --no-redact: Disable redaction of sensitive info

Subcommands

  • run -- <COMMAND>: Run a command and create a repro bundle on failure
  • replay <BUNDLE_DIR>: Execute's bundle's run.sh to reproduce the command

Bundle Format

The repro bundle directory contains:

repro_YYYY-MM-DD_HHMMSS/
  README.md
  run.sh
  repropack.json
  logs/
    stdout.log
    stderr.log
  env/
    sw_vers.txt
    uname.txt
    sysctl.txt
    tool_versions.txt
  repo/
    head_sha.txt
    status.txt
    patch.diff
    remotes.txt
  files/                # present if --files changed
    ...

Notable Files

  • README.md: summary with the command, result, and git info (if available)
  • run.sh: script to replay the captured command
  • repropack.json: machine-readable manifest of the bundle contents
  • logs/: captured stdout and stderr logs
  • repo/patch.diff: git diff of uncommitted changes (redacted by default)

Redaction and Safety

Redaction is enabled by default and applies to:

  • logs/*
  • repo/*
  • README.md, run.sh, repropack.json

Redaction uses a set of best-effort patterns for common secrets:

  • GitHub tokens (ghp, etc.)
  • Bearer tokens
  • AWS access keys
  • Slack token patterns
  • Generic API keys token, secret, password patterns

File inclusion (--files changed|all) skips common secret files:

  • .env
  • SSH Keys (id_rsa, id_ed25519, etc.)
  • private keys/certificates (.pem, .crt, etc.)
  • filenames containing secret, password, token

Note: This is a best-effort tool. Always review the bundle contents before sharing.

Development

Run Locally

cargo run -- run -- bash -lc "exit 3"

Format

cargo fmt

Lint

cargo clippy -- -D warnings

Test

cargo test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages