CLI skeleton for PR Sheriff: detect pull requests that are likely safe to close because they have been superseded by newer work.
This repo currently provides a minimal command structure, config loading, and JSON output plumbing.
npm install
npm run buildAll commands emit JSON to stdout.
# Help (JSON)
node dist/cli.js --help
# Analyze a single PR (placeholder)
node dist/cli.js analyze-pr --owner Martian-Engineering --repo pr-sheriff --pr 123
# Batch mode (placeholder)
node dist/cli.js batch --owner Martian-Engineering --repo pr-sheriff --limit 50
# Index (placeholder)
node dist/cli.js index --input ./data/results.json
# Report (placeholder)
node dist/cli.js report --input ./data/index.json --format mdConfig is loaded from (in order):
- Defaults
- Config file (if found)
- Environment variables (override config file)
To specify a config path:
- CLI:
--config /path/to/config.json - Env:
PR_SHERIFF_CONFIG=/path/to/config.json
If neither is set, the loader looks for:
./pr-sheriff.config.json./.pr-sheriffrc.json~/.config/pr-sheriff/config.json
Example config JSON:
{
"githubApiUrl": "https://api.github.com",
"githubToken": "ghp_...redacted...",
"openaiApiKey": "sk-...redacted...",
"model": "gpt-4.1-mini",
"logLevel": "info"
}PR_SHERIFF_GITHUB_API_URLPR_SHERIFF_GITHUB_TOKENPR_SHERIFF_OPENAI_API_KEYPR_SHERIFF_MODELPR_SHERIFF_LOG_LEVEL