MCPcopy Index your code
hub / github.com/Martian-Engineering/pr-sheriff

github.com/Martian-Engineering/pr-sheriff @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
155 symbols 420 edges 46 files 32 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

pr-sheriff (scaffold)

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.

Install

npm install
npm run build

Usage

All 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 md

Configuration

Config is loaded from (in order):

  1. Defaults
  2. Config file (if found)
  3. Environment variables (override config file)

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"
}

Environment variables

  • PR_SHERIFF_GITHUB_API_URL
  • PR_SHERIFF_GITHUB_TOKEN
  • PR_SHERIFF_OPENAI_API_KEY
  • PR_SHERIFF_MODEL
  • PR_SHERIFF_LOG_LEVEL

Core symbols most depended-on inside this repo

yamlQuote
called by 25
scripts/qmd-corpus-index.js
yamlScalar
called by 18
scripts/qmd-corpus-index.js
addNode
called by 10
src/graph/reference_graph_builder.mjs
assertString
called by 9
src/llm/judge_schema.mjs
env
called by 8
src/config/loadConfig.ts
usageAndExit
called by 8
scripts/qmd-corpus-index.js
prNodeId
called by 7
src/graph/reference_graph_builder.mjs
addEdge
called by 6
src/graph/reference_graph_builder.mjs

Shape

Function 141
Method 12
Class 2

Languages

TypeScript100%

Modules by API surface

src/github/github_fetch.mjs19 symbols
scripts/qmd-corpus-index.js19 symbols
scripts/pr-supersession-single.js19 symbols
src/llm/judge_schema.mjs11 symbols
src/graph/reference_graph_builder.mjs10 symbols
src/commands/subcommands/analyzePr.ts8 symbols
scripts/pr-supersession-detector-llm.js7 symbols
src/github/file_cache.mjs6 symbols
test/reference_graph.test.mjs5 symbols
src/config/loadConfig.ts5 symbols
scripts/pr-supersession-detector.js4 symbols
test/github_fetch.test.mjs3 symbols

For agents

$ claude mcp add pr-sheriff \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact