gitcontribute

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT

README ΒΆ

GitContribute

Find better open-source contributionsβ€”with evidence, not guesswork.

GitContribute is a local-first research workbench for discovering, investigating, validating, and preparing focused GitHub contributions.

CI npm Go License Platforms

Quick start Β· How it works Β· CLI guide Β· MCP Β· Safety Β· Contributing


[!IMPORTANT] GitContribute never writes to GitHub. It syncs public or authenticated read-only data, keeps research on your machine, and prepares local drafts for you to review.

Why GitContribute?

Finding an issue is easy. Finding a contribution that is useful, unclaimed, appropriately scoped, and backed by evidence is the hard part.

GitContribute gives developers and coding agents a durable SQLite corpus of repositories, issues, pull requests, reviews, code snapshots, and research artifacts. Network access is always explicit. Once data is synced, search, inspection, health analysis, dossiers, and investigations run entirely offline.

Capability What it gives you
πŸ”Ž Typed offline search Search repositories, issues, PRs, threads, and indexed code with transparent ranking.
πŸ“‘ Contribution Radar Rank promising open issues with explicit positives, risks, blockers, confidence, and missing-evidence warnings.
πŸ—‚οΈ Durable research corpus Keep observations, coverage, investigations, evidence, and outcomes in local SQLite.
🧭 Contribution workflow Move from hypothesis to opportunity, workspace, validation, readiness checks, and a prepared issue, PR, or review.
πŸ€– Agent-ready MCP server Give Codex or Claude Code structured tools and resources with explicit capability boundaries.
πŸ›‘οΈ Safe by default Separate network reads, local writes, process execution, and GitHub mutation.

⚑ Quick start

Run the guided setup with Node.js 18 or newer:

npx gitcontribute@latest setup

The interactive wizard offers two independent capabilities:

  • a persistent gitcontribute command for the CLI and TUI;
  • MCP registration for Codex and/or Claude Code.

Installing the terminal app is the recommended default. The wizard shows the exact global npm command before applying changes. MCP-only setup remains available and does not require a persistent CLI installation.

Then launch the TUI, sync a repository, rank contribution candidates, and search the local corpus:

gitcontribute tui
gitcontribute sync owner/repo
gitcontribute radar owner/repo --limit 10
gitcontribute search threads "connection timeout" \
  --repo owner/repo --json
gitcontribute dossier build owner/repo --json

setup initializes the corpus, helps select a GitHub authentication source, can install the terminal app, and can register the MCP server with Codex and Claude Code. Adding a repository during setup does not contact GitHub or begin a sync.

For non-interactive setup, terminal installation must be explicitly selected:

# Recommended: terminal app plus Codex MCP
npx gitcontribute@latest setup --install-cli --codex --yes

# Terminal app only
npx gitcontribute@latest setup --install-cli --no-mcp --yes

# MCP only; leaves the terminal command uninstalled
npx gitcontribute@latest setup --codex --yes

When terminal installation is skipped, continue to prefix direct commands with npx gitcontribute@latest.

Other installation options
Install a persistent command
npm install --global gitcontribute@latest
gitcontribute setup

To remove a global npm installation later, run npm uninstall --global gitcontribute. The gitcontribute remove command only removes MCP registrations; it does not uninstall the terminal app.

Pin a project version
npm install --save-dev gitcontribute
npx gitcontribute setup --codex --yes

The npm package has no install lifecycle and performs no download during installation. Native binaries are included for macOS ARM64/x64, Linux ARM64/x64, and Windows x64.

Build from source

Developers with Go 1.26 or newer can install or build the CLI directly:

go install github.com/morluto/gitcontribute/cmd/gitcontribute@latest
go build -o gitcontribute ./cmd/gitcontribute

You need git. The gh CLI is optional and can provide authentication through gh auth token; ripgrep is optional and adds an extra doctor check.

🧩 How it works

 GitHub read APIs                  Local checkout
       β”‚                                β”‚
       β”‚ explicit sync / hydrate        β”‚ explicit index / acquire
       β–Ό                                β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚          Local SQLite corpus             β”‚
  β”‚ observations Β· projections Β· coverage   β”‚
  β”‚ investigations Β· evidence Β· outcomes    β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ offline reads
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό            β–Ό             β–Ό
       CLI / TUI    MCP agents    JSON exports
1. Discover

Track explicit repositories, GitHub search results, or GH Archive event streams. Sync only when you ask, then search locally as often as you like.

gitcontribute source add repos --name my-go "golang/go" "cli/cli" --json
gitcontribute crawl my-go --since 720h --budget 500 --json
gitcontribute radar golang/go --limit 20 --json
gitcontribute search issues "data race" --repo golang/go --state open --json
gitcontribute search code "context.WithTimeout" --repo golang/go
2. Investigate

Build a dossier or per-thread research brief, inspect repository health, record a hypothesis, and check for duplicate or competing work before committing time.

gitcontribute dossier build owner/repo
gitcontribute research brief issue:owner/repo#42 --format markdown
gitcontribute health owner/repo --json
gitcontribute investigation start-thread issue:owner/repo#42 --json
gitcontribute duplicates check <hypothesis-id>
gitcontribute collisions check <hypothesis-id>
3. Validate

Promote promising research into an opportunity, create an isolated worktree, record evidence, and compare a baseline with your candidate change.

gitcontribute opportunity promote --problem="Retry can hang indefinitely" \
  --scope=small --impact="reduces flakes" --effort=1h \
  --confidence=0.8 <hypothesis-id>
gitcontribute workspace create <investigation-id>
gitcontribute validation define --kind=test --command="go test ./..." \
  --working-dir=/path/to/workspace <investigation-id>
gitcontribute validation run <validation-id> --kind=base --execute
gitcontribute validation run <validation-id> --kind=candidate --execute
gitcontribute validation compare <base-run-id> <candidate-run-id>
4. Check readiness

Run a deterministic local readiness gate before turning a candidate into a public submission:

gitcontribute readiness opportunity <opportunity-id>
gitcontribute readiness explain <opportunity-id>:evidence_freshness

Readiness reports pass, warn, block, or unknown per rule. It only reads stored corpus and draft metadata: it does not fetch GitHub, execute validation, write state, or infer that missing coverage is a hard blocker.

5. Prepare

Create a local contribution draft from the evidence and workspace diff:

gitcontribute prepare issue <opportunity-id>
gitcontribute prepare pr --approach="Bound retries with context" \
  --workspace <workspace-id> <opportunity-id>
gitcontribute prepare review <opportunity-id>

Nothing is posted. You decide what leaves your machine.

πŸ€– Use with AI agents

The MCP server gives agents structured access to the same corpus and workflow:

gitcontribute setup --codex --yes
gitcontribute setup --all-clients --yes

Or start the stdio server directly:

gitcontribute mcp serve --transport=stdio

MCP capabilities are deliberately separate:

Tool names use the gitcontribute.<capability>.<action> namespace. The server advertises one canonical name per operation; unnamespaced compatibility aliases are not registered.

Capability Examples
Offline reads Search, inspect repositories and threads, build research briefs, read dossiers, explain matches, inspect evidence, opportunities, readiness checks, and workflow resources.
Network reads Sync repositories, hydrate threads, start crawls, and acquire workspaces.
Local writes Start investigations, record hypotheses, promote opportunities, define validations, and prepare drafts.
Execution Run a validation only when the request includes execute: true.

Contribution workflow resources and prompts are available for agents:

  • gitcontribute.corpus.get_readiness and gitcontribute://readiness/<opportunity-id> expose the same offline readiness report as the CLI.
  • gitcontribute://workflow/contribution/<opportunity-id> links the local opportunity, evidence, readiness report, and safe workflow prompts.
  • Prompts such as review_contribution_readiness instruct agents to treat repository and GitHub-sourced text as untrusted data and to ask before any network read, local write, or validation execution.

Resources are published under gitcontribute:// and github-index:// URI schemes. See the architecture guide for the complete application and adapter boundaries.

πŸ›‘οΈ Safety by design

Operation Network Local write Runs a process GitHub write
Search, health, dossier, research-brief, and readiness inspection β€” β€” β€” β€”
Investigations, evidence, lenses β€” βœ“ β€” β€”
Sync, crawl, hydrate βœ“ βœ“ β€” β€”
Acquire or create a workspace remote-dependent βœ“ git only β€”
Validation with explicit execution β€” by default βœ“ βœ“ β€”
  • No GitHub writes. GitContribute does not open issues, create pull requests, push commits, or mutate GitHub.
  • No hidden network access. Corpus reads never fetch data.
  • No hosted service or telemetry. Your corpus and research remain local.
  • No automatic repository execution. Crawling and indexing never execute repository-controlled code.
  • No implied sandbox. Explicit validation commands run on your host with the permissions of your user and only the environment variables you allowlist.
  • No opaque semantic ranking. Search uses SQLite FTS5 and reports signals such as text matches, freshness, and coverage.

πŸ“š CLI guide

The sections below are a task-oriented reference. Run gitcontribute --help or gitcontribute <command> --help for every flag.

Setup, configuration, and authentication
gitcontribute setup                              # interactive
gitcontribute setup --codex --yes               # configure Codex
gitcontribute setup --all-clients --yes          # configure supported clients
gitcontribute setup --codex --mcp-version latest --yes
gitcontribute setup --token-source env \
  --token-source-key GITHUB_TOKEN --yes
gitcontribute setup --codex --dry-run --json     # inspect without writing
gitcontribute remove --all-clients --yes         # remove MCP registrations only
gitcontribute upgrade --check
gitcontribute upgrade --yes

gitcontribute init creates the default database and directories without contacting GitHub. gitcontribute configure updates config.toml atomically:

gitcontribute configure --database /path/to/corpus.db
gitcontribute configure --token-source env --token-source-key GITHUB_TOKEN
gitcontribute configure --token-source gh-cli
gitcontribute configure --output-format json

Authentication sources are none, env, gh-cli, and keyring. Tokens are resolved at runtime and are never stored in the corpus or logs. Use gitcontribute status, metadata, and doctor to inspect the local setup.

See the onboarding design for the full contract and environment-variable reference.

Sources, crawling, sync, and hydration

Add a source:

gitcontribute source add repos --name my-go "golang/go" "cli/cli" --json
gitcontribute source add search --name go-network \
  --query "language:go stars:>100" --json
gitcontribute source add gharchive --name golang-events \
  --events "IssuesEvent,PullRequestEvent" --json

Run it once or continuously:

gitcontribute crawl golang-events --since 720h --budget 500 --json
gitcontribute tail golang-events --since 2h --budget 500 --interval 1h

Sync and selectively hydrate repository archives:

gitcontribute sync owner/repo
gitcontribute archive sync owner/repo --since 168h --state open
gitcontribute archive sync owner/repo --numbers 42,108
gitcontribute archive refresh owner/repo
gitcontribute archive hydrate owner/repo#42 --with issue_comments
gitcontribute archive hydrate owner/repo#108 \
  --with pr_reviews,pr_review_comments
gitcontribute archive coverage owner/repo

Hydration supports issue_comments, pr_details, pr_reviews, and pr_review_comments. Fetches are paginated and cancellation-aware; a complete facet replaces its previous snapshot atomically.

Code indexing and acquisition

Index a clean local checkout at its current commit:

gitcontribute index owner/repo /path/to/checkout --json

Or acquire a repository into a managed mirror, index a clean temporary worktree, and remove that worktree afterward:

gitcontribute acquire owner/repo \
  --remote https://github.com/owner/repo.git --json

The indexer reads blobs directly from Git, skips binaries and non-UTF-8 content, enforces size limits, and rejects dirty worktrees.

Radar, research briefs, search, dossiers, health, seeds, and lenses
gitcontribute radar owner/repo --limit 20
gitcontribute search repos "cli" --limit 20 --json
gitcontribute search issues "data race" --repo owner/repo --state open --json
gitcontribute search prs "flaky" --repo owner/repo --label bug --json
gitcontribute search threads "memory leak" --repo owner/repo
gitcontribute search code "context.WithTimeout" --repo owner/repo
gitcontribute search all "retry" --repo owner/repo

gitcontribute dossier build owner/repo
gitcontribute dossier export owner/repo --format markdown \
  --output owner-repo-dossier.md
gitcontribute research brief owner/repo#42
gitcontribute research brief pr:owner/repo#108 --json
gitcontribute health owner/repo --stale-after 336h --json
gitcontribute seeds owner/repo --json

radar is a strict offline corpus read. It ranks a bounded population of the newest stored open issues and separates objective eligibility from the numeric score. Every candidate reports positive signals, risks, blockers, confidence, linked open PRs, evidence coverage, and unknowns. Missing comment coverage is reported as unknown and does not lower the score; hydrate comments explicitly when you want that evidence:

gitcontribute archive hydrate owner/repo#42 --with issue_comments
gitcontribute radar owner/repo --json

Radar scores carry a version (radar.v1) so saved JSON remains auditable when ranking semantics evolve. It never syncs, hydrates, executes repository code, or writes to GitHub.

research brief is also a strict offline read. Its versioned research-brief.v1 output has fixed sections for state, stored problem fields, acceptance hints, participants, timeline, explicit/duplicate references, linked PRs, indexed code, contribution guidance, health, coverage gaps, and next commands. Every section carries source references or an explicit unknown reason. Checkboxes and maintainer phrases remain source extractsβ€”not fabricated or complete acceptance criteria. Markdown output redacts common credentials and quotes untrusted source text; JSON ordering is deterministic.

Missing child facets and code stay visible instead of triggering hidden work:

gitcontribute archive hydrate owner/repo#42 --with issue_comments
gitcontribute index owner/repo /path/to/clean-checkout
gitcontribute research brief issue:owner/repo#42 --json

Use a lens to apply saved filters and weighted ranking to a bounded population:

gitcontribute lens add my-lens --file lens.json
gitcontribute search issues "retry" --lens my-lens
gitcontribute lens explain my-lens issue:owner/repo#42 --query "retry"

Search results explain their scores. Most typed searches support opaque cursor pagination; search all and lens-ranked searches do not.

Investigations, evidence, tracking, and collections

Start an investigation and its initial hypothesis from one exact stored thread revision:

gitcontribute investigation start-thread issue:owner/repo#42 --json

This is a local-write operation with no network or process execution. The investigation saves the immutable observation ID, source update time, sequence, and source reference used for its title and bounded description. Repeating the command returns the existing open pair with "created": false; it never updates that baseline silently. The seed category is other because the command does not infer scope or defect type from untrusted issue text.

The manual two-command path remains available when no stored thread should be the baseline:

gitcontribute investigation start owner/repo --json
gitcontribute hypothesis add --title="Fix retry timeout" \
  --description="Reproduce and isolate the timeout." \
  --category=bug <investigation-id>

Record supporting or contradicting evidence:

gitcontribute evidence add --type=manual_observation --relation=supporting \
  --description="Reproduced on the current default branch." \
  --opportunity <opportunity-id>

Evidence shown through the CLI, exports, and MCP includes a derived freshness status. github_source evidence recorded from a started thread carries the exact corpus source revision it used, so later issue, pull request, facet, or guidance updates can mark it stale. Missing source projections are unknown; local/manual evidence is not_applicable. Freshness is evaluated from local corpus reads only, and stale evidence is a prompt to re-check, not a claim that the evidence is invalid.

Group typed references and record local decisions:

gitcontribute collection create interesting
gitcontribute collection add interesting \
  repo:owner/repo issue:owner/repo#42
gitcontribute triage record issue:owner/repo#42 viewed --reason "..."
gitcontribute contribution record <opportunity-id> issue \
  "Draft title" --body "..."
gitcontribute contribution outcome <contribution-id> submitted

Export and restore tracking metadata:

gitcontribute tracking export --output tracking.json
gitcontribute tracking import --file tracking.json

Tracking exports use schema version 2 for portable evidence provenance and remain backward compatible with older unversioned tracking bundles. Exports are redacted: they exclude credentials, tokens, and absolute local paths.

Workspaces, jobs, runs, and TUI
gitcontribute workspace show <workspace-id>
gitcontribute diff <workspace-id>
gitcontribute runs --limit 20
gitcontribute jobs
gitcontribute job show <id>
gitcontribute job cancel <id>
gitcontribute tui owner/repo

diff returns the patch, changed files, and suggested review order. The TUI is local-only; add --json to emit a non-interactive snapshot.

JSON and output behavior

Most non-interactive commands accept --json. Machine-readable output goes to stdout; progress and status messages go to stderr. List commands accept --limit, and paginated searches return an opaque next_cursor where supported.

dossier export, export dossier, export evidence, and tracking export accept --output <file>.

πŸ’Ύ Storage locations

Platform Config Data Cache Logs
Linux / Unix $XDG_CONFIG_HOME/gitcontribute or ~/.config/gitcontribute $XDG_DATA_HOME/gitcontribute or ~/.local/share/gitcontribute $XDG_CACHE_HOME/gitcontribute or ~/.cache/gitcontribute $XDG_STATE_HOME/gitcontribute or ~/.local/state/gitcontribute/logs
macOS ~/Library/Application Support/gitcontribute ~/Library/Application Support/gitcontribute/Data ~/Library/Caches/gitcontribute ~/Library/Logs/gitcontribute
Windows %APPDATA%\gitcontribute %LOCALAPPDATA%\gitcontribute\Data %LOCALAPPDATA%\gitcontribute\Cache %LOCALAPPDATA%\gitcontribute\Logs

The default database is gitcontribute.db in the data directory. The configuration file is config.toml in the config directory.

πŸ–₯️ Platform support

Linux and macOS are the primary development and test targets. Windows builds are expected to work with Git for Windows and standard %APPDATA% and %LOCALAPPDATA% paths. For platform-specific problems, open a bug report with the output of gitcontribute doctor --json.

πŸ› οΈ Development

go test ./...
go build -o gitcontribute ./cmd/gitcontribute
./gitcontribute --help

Before changing package boundaries or side effects, read docs/architecture.md. See CONTRIBUTING.md for the complete development and testing workflow.


Built for contributors who want to understand the problem before writing the patch.

Architecture Β· Onboarding Β· Runbooks Β· Security Β· Contributing Β· License

Directories ΒΆ

Path Synopsis
cmd
gitcontribute command
internal
acquire
Package acquire manages explicit, native-git clone/fetch operations into a local cache.
Package acquire manages explicit, native-git clone/fetch operations into a local cache.
app
Package app owns GitContribute use cases and capability composition.
Package app owns GitContribute use cases and capability composition.
cli
Package cli parses command-line input and renders stable human and JSON output for GitContribute application services.
Package cli parses command-line input and renders stable human and JSON output for GitContribute application services.
codeindex
Package codeindex indexes a bounded snapshot of tracked UTF-8 text files from a clean Git checkout using the native git executable and the standard library.
Package codeindex indexes a bounded snapshot of tracked UTF-8 text files from a clean Git checkout using the native git executable and the standard library.
corpus
Package corpus provides the product-owned SQLite system of record.
Package corpus provides the product-owned SQLite system of record.
crawl
Package crawl executes bounded batches from the durable crawl frontier.
Package crawl executes bounded batches from the durable crawl frontier.
discovery
Package discovery turns explicit repositories, GitHub repository searches, and GH Archive events into bounded discovery signals.
Package discovery turns explicit repositories, GitHub repository searches, and GH Archive events into bounded discovery signals.
github
Package github adapts read-only GitHub APIs to product-owned values.
Package github adapts read-only GitHub APIs to product-owned values.
health
Package health computes deterministic repository health and community metrics from already stored public corpus facts.
Package health computes deterministic repository health and community metrics from already stored public corpus facts.
lens
Package lens applies transparent, reusable filters and weighted signals to local corpus candidates.
Package lens applies transparent, reusable filters and weighted signals to local corpus candidates.
log
Package log provides structured logging for gitcontribute using log/slog.
Package log provides structured logging for gitcontribute using log/slog.
mcpserver
Package mcpserver exposes GitContribute application capabilities through the Model Context Protocol.
Package mcpserver exposes GitContribute application capabilities through the Model Context Protocol.
radar
Package radar ranks locally stored contribution candidates with transparent, deterministic signals.
Package radar ranks locally stored contribution candidates with transparent, deterministic signals.
redaction
Package redaction removes common credential forms from content crossing a publication boundary.
Package redaction removes common credential forms from content crossing a publication boundary.
repository
Package repository defines narrow, product-owned repository read contracts shared by offline research builders.
Package repository defines narrow, product-owned repository read contracts shared by offline research builders.
research
Package research builds deterministic, source-backed thread research briefs.
Package research builds deterministic, source-backed thread research briefs.
setup
Package setup owns local coding-client detection and MCP registration.
Package setup owns local coding-client detection and MCP registration.
terminalinstall
Package terminalinstall owns the external package-manager capability used to make the GitContribute CLI and TUI persistently available.
Package terminalinstall owns the external package-manager capability used to make the GitContribute CLI and TUI persistently available.
tracking
Package tracking models local contribution research history.
Package tracking models local contribution research history.
tui
Package tui provides an offline terminal UI for browsing local corpus data.
Package tui provides an offline terminal UI for browsing local corpus data.
workspace
Package workspace manages Git mirrors and detached worktrees used to inspect candidate contributions.
Package workspace manages Git mirrors and detached worktrees used to inspect candidate contributions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL