Skip to main content

🧠 RepoBrief

Pack any repo into clean LLM context, then chat with it.

Using Claude, GPT, or a fully offline Ollama model. No vector DB. No GPU. One command.

PyPI version Python 3.9+ License: MIT

InstallationQuick StartChat ModeConfigurationHow It Works


Why RepoBrief?

You need to explain your codebase to an LLM — for code review, debugging, onboarding, or docs. Today, you either:

  • Copy-paste files manually — slow, error-prone, easy to forget files or include secrets
  • Use a packing tool (Repomix, Gitingest) — great, but they just dump text. No follow-up.
  • Use a RAG chatbot (ollama-chat, etc.) — needs ChromaDB, embeddings, GPU, and 16GB+ RAM

RepoBrief does both — packing AND chatting — without the RAM cost:

Feature Repomix Gitingest RAG chatbots RepoBrief
Pack repo into LLM context
Chat with codebase
No vector DB / embeddings
Works on 8GB RAM laptop
Cloud + local LLM support Partial
Secret detection & redaction
GitHub repository pack/chat

Installation

pip install repobrief

For cloud LLM support (Claude/GPT):

pip install repobrief[cloud]

That's it. No Docker, no database, no GPU required.


Quick Start

Pack a repo (export mode)

# Pack the current directory into a markdown digest
repobrief pack .

# Save to a file, limit to 50k tokens
repobrief pack ./my-project --max-tokens 50000 -o context.md

# XML format for structured parsing
repobrief pack . --format xml -o context.xml

# Copy directly to clipboard
repobrief pack . --clipboard

# Pack directly from a GitHub URL
repobrief pack https://github.com/pallets/flask

Chat with a repo

# Ask a question using Claude
export ANTHROPIC_API_KEY=sk-ant-...
repobrief chat . --backend cloud -q "Where is user authentication handled?"

# Fully offline using Ollama (no API key needed)
repobrief chat . --backend ollama --model llama3.2:3b -q "What does the payment module do?"

# Interactive mode — ask follow-up questions
repobrief chat . --backend ollama --model llama3.2:3b
> Where is the rate limiter implemented?
> How would I add a new middleware?
> exit

Chat Mode

RepoBrief's chat mode doesn't use RAG, embeddings, or vector databases. Instead, it:

  1. Packs your repo into a token-budgeted digest (like export mode)
  2. Scores files by relevance to your question (keyword matching, git recency, import centrality)
  3. Sends the digest + your question to the chosen LLM backend
  4. Streams the answer back to your terminal with real-time markdown rendering

This means it works on any machine that can run Python — even an old laptop with 4GB of free RAM.

Supported Backends

Backend Setup Best For
Anthropic (Claude) export ANTHROPIC_API_KEY=sk-ant-... Best quality, fast streaming
OpenAI (GPT) export OPENAI_API_KEY=sk-... Great quality, widely available
Ollama (local) ollama pull llama3.2:3b Free, 100% private, offline

Configuration

CLI Flags

Flag Description Default
--max-tokens Token budget for file selection 100000
--format Output format: markdown, xml, plain markdown
-o, --output Write digest to file stdout
--clipboard Copy digest to clipboard off
--exclude Extra glob patterns to exclude (repeatable) none
--redact / --no-redact Redact secrets vs exclude files exclude
--backend LLM backend: cloud or ollama cloud
--model Model identifier claude-sonnet-4-20250514
-q, --question Question for one-shot chat mode interactive
-v, --verbose Show detailed debug output off
--quiet Suppress all output except errors off

Config File

Create .repobrief.yml in your project root for persistent settings:

backend: ollama
model: llama3.2:3b
max_tokens: 40000
format: markdown
exclude:
  - "*.test.js"
  - "docs/"

Environment Variables

Variable Purpose
ANTHROPIC_API_KEY Anthropic API key
OPENAI_API_KEY OpenAI API key
REPOBRIEF_API_KEY Generic API key (auto-detects provider)
OLLAMA_HOST Ollama server URL (default: http://localhost:11434)

How It Works

repobrief pack/chat <path>
        │
        ▼
  ┌─── SCAN ──────── Walk repo, respect .gitignore, skip binaries
  │
  ├─── SECRET SCAN ── Regex detection of API keys, tokens, passwords
  │
  ├─── SCORE ──────── Rank files by recency, size, centrality, keyword match
  │
  ├─── SELECT ─────── Greedily pick best files within token budget
  │
  ├─── PACK ───────── Build directory tree + concatenated file content
  │
  └─── OUTPUT
        ├── Export: save to file / clipboard / stdout
        └── Chat: send digest + question to Cloud API or local Ollama

Secret Detection

RepoBrief automatically detects and excludes files containing:

  • AWS access keys, GitHub PATs, OpenAI/Anthropic API keys
  • Private keys (RSA, EC, DSA, OPENSSH)
  • .env files with credentials
  • Hardcoded passwords and generic secret assignments
  • Slack tokens, Stripe keys

Use --redact to include files with secrets replaced by [REDACTED] instead of excluding them entirely.


Development

# Clone and setup
git clone https://github.com/yourusername/repobrief.git
cd repobrief
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -e ".[dev,cloud]"

# Run tests
pytest

# Lint and format
ruff check src/ tests/
ruff format src/ tests/

# Type check
mypy src/

License

MIT — see LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repobrief-0.1.1.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repobrief-0.1.1-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file repobrief-0.1.1.tar.gz.

File metadata

  • Download URL: repobrief-0.1.1.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for repobrief-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8b604fd4c531daa27beaf2a6c3cc7cd870bc4e292b96e593db837bd11d6cf885
MD5 e19fbef5abd35a2bb0167a51a044e377
BLAKE2b-256 2a1e30718ace395a130f33872311851b4a8c6169ca38aa23a79849fdc10c7cc3

See more details on using hashes here.

File details

Details for the file repobrief-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: repobrief-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for repobrief-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6abebabd560e6e8d4e9b6dd3b1cc958461ed36c1da9ec519942aeb1c674015fc
MD5 faacb5c807044aded87ad38dde75034f
BLAKE2b-256 dea4f621def7893829a619832825e49fcf33b7a292bcfed52e24135326405cfb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page