
gh-repro
io.github.dev-shiki/gh-repro
Extract minimal 1-line local repro commands and context from failing GitHub Actions runs.
Documentation
gh-repro
Extract deterministic 1-line local reproduction commands from failing GitHub Actions runs without spinning up Docker.
gh-repro reads failing GitHub Actions logs (gh run view --log-failed) alongside .github/workflows/*.yml, strips UTC timestamps, ANSI sequences, and group noise, redacts leaked credentials, and outputs the minimal local test or lint command with the step's working-directory and env.
Supported runners and linters
- Python:
pytest,ruff,mypy - Go:
go test,golangci-lint - JavaScript / TypeScript:
vitest,jest(including multi-line suite output withnpx,pnpm,yarn, orbunx),bun test - Rust:
cargo test - Generic fallback: reconstructs the failing workflow step's
run:command when no specialized parser matches
Install
gh extension install dev-shiki/gh-repro
From source (Go 1.24+):
go install github.com/dev-shiki/gh-repro@latest
Or run via GHCR Docker image:
docker run -i --rm -e GH_TOKEN ghcr.io/dev-shiki/gh-repro:latest
CLI usage
# Inspect the latest failed workflow run in the current repository
gh repro
# Inspect failing checks on PR #123
gh repro --pr 123
# Inspect a specific run ID and emit JSON
gh repro --run-id 123456789 --json
# Offline analysis from a saved `gh run view --log-failed` file
gh repro --log-file failed.log
# Execute the first extracted reproduction command locally (opt-in only)
gh repro --pr 123 --run
# Print version
gh repro --version
Example output:
[1] test-python / Run pytest (pytest)
cwd: backend
env: map[APP_ENV:test DATABASE_URL:sqlite:///:memory:]
cmd: pytest tests/test_auth.py::TestToken::test_refresh
err: FAILED tests/test_auth.py::TestToken::test_refresh - AssertionError: expired token [REDACTED]
MCP server mode
gh-repro --mcp runs a read-only stdio MCP server (protocol 2025-06-18, compatible with 2024-11-05 through 2025-11-25) exposing three tools:
list_failed_runs: list recent failed GitHub Actions workflow runs (run_id,workflow_name,title,branch,event,created_at,url) for a repository or branch.reproduce_ci_failure: synthesize a 1-line local test or lint command,working_dir,env, and redacted 20-lineerror_tailfrom arun_id,pr, latest failed run, or offlinelog_file.get_failed_run_log: fetch ANSI-stripped, secret-redacted failed step log lines grouped by job and step when the 20-line tail is not enough.
Local gh extension config:
{
"mcpServers": {
"gh-repro": {
"command": "gh",
"args": ["repro", "--mcp"]
}
}
}
Container config:
{
"mcpServers": {
"gh-repro": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GH_TOKEN", "ghcr.io/dev-shiki/gh-repro:latest"]
}
}
}
Security notes
- Never executes extracted commands in MCP mode, or in CLI mode unless
--runis explicitly passed. - Invokes
exec.Command(bin, args...)directly withoutsh -cshell interpolation when--runis used. - Redacts
ghp_,github_pat_,AKIA,sk-, andBearertokens from logs and error tails. - Parses
.github/workflows/*.ymlwith structuredgopkg.in/yaml.v3decoding.
ghcr.io/dev-shiki/gh-repro:0.2.0docker pull ghcr.io/dev-shiki/gh-repro:0.2.0:undefinedRelated Servers
io.github.dev-shiki/ai-agent-guardrail-mcp
Zero-LLM guardrail MCP to detect prompt injections, redact/HMAC PII, and validate tool args.
io.github.dev-shiki/arxiv-hf-papers-mcp
Query ArXiv, HuggingFace Daily Papers, and linked GitHub repos in one fast MCP call.
io.github.dev-shiki/doc-archive-unpacker
Zero-browser unpacker for ZIP, TAR, GZ, EML, and MSG archives returning clean JSON & text.