🌐 English | 한국어 | 日本語 | हिन्दी | Deutsch
Package your codebase for AI comprehension.
50 tokens → 8 tokens— Same information, fewer tokens.
A CLI tool and MCP server that extracts function signatures, type definitions, and documentation from your codebase using Tree-sitter — producing compact XML/Markdown context for LLMs like Claude, GPT, and Gemini. Supports 19 languages including Go, TypeScript, Python, Rust, Java, C/C++, and more.
Installation · Quick Start · Supported Languages
Instead of feeding raw code to AI assistants:
| Before (50+ tokens) | After with brfit (8 tokens) |
|---|---|
export async function fetchUser(
id: string
): Promise<User> {
const response = await fetch(
`${API_URL}/users/${id}`
);
if (!response.ok) {
throw new Error('User not found');
}
const data = await response.json();
return {
id: data.id,
name: data.name,
email: data.email,
createdAt: new Date(data.created_at)
};
} |
<function>
export async function fetchUser(
id: string
): Promise<User>
</function> |
macOS (Homebrew)
brew install indigo-net/tap/brfitLinux / macOS (Script)
curl -fsSL https://raw.githubusercontent.com/indigo-net/Brf.it/main/install.sh | shWindows (PowerShell)
irm https://raw.githubusercontent.com/indigo-net/Brf.it/main/install.ps1 | iexFrom Source
git clone https://github.com/indigo-net/Brf.it.git
cd Brf.it
go build -o brfit ./cmd/brfitbrfit . # Analyze current directory
brfit . -f md # Output in Markdown
brfit . -o briefing.xml # Save to fileThis project, packaged by brfit itself. Auto-generated on every commit.
| Feature | Description |
|---|---|
| Tree-sitter Based | Accurate AST parsing for language structure analysis |
| Multiple Formats | XML and Markdown output support |
| Token Counting | Automatic output token calculation |
| Gitignore Aware | Automatically excludes unnecessary files |
| Cross-Platform | Linux, macOS, and Windows support |
| Security Check | Detects and redacts secrets (AWS keys, GitHub tokens, API keys, etc.) in extracted code |
| Call Graph | Extracts function/method call relationships using Tree-sitter queries (Go, TS, Python, Java, Rust, C) |
| Language | Extensions | Documentation |
|---|---|---|
| Go | .go |
Go Guide |
| TypeScript | .ts, .tsx |
TypeScript Guide |
| JavaScript | .js, .jsx |
TypeScript Guide |
| Python | .py |
Python Guide |
| C | .c |
C Guide |
| C++ | .cpp, .hpp, .h |
C++ Guide |
| Java | .java |
Java Guide |
| Rust | .rs |
Rust Guide |
| Swift | .swift |
Swift Guide |
| Kotlin | .kt, .kts |
Kotlin Guide |
| C# | .cs |
C# Guide |
| Lua | .lua |
Lua Guide |
| PHP | .php |
PHP Guide |
| Ruby | .rb |
Ruby Guide |
| Scala | .scala, .sc |
Scala Guide |
| Elixir | .ex, .exs |
Elixir Guide |
| SQL | .sql |
SQL Guide |
| YAML | .yaml, .yml |
YAML Guide |
| TOML | .toml |
TOML Guide |
brfit [path] [options]| Option | Short | Description | Default |
|---|---|---|---|
--format |
-f |
Output format (xml, md) |
xml |
--output |
-o |
Output file path | stdout |
--include-body |
Include function bodies | false |
|
--include-imports |
Include import statements | false |
|
--include-private |
Include non-exported/private symbols | false |
|
--ignore |
-i |
Ignore file path (can be specified multiple times) | .gitignore |
--include |
Glob pattern(s) to include (can be specified multiple times) | ||
--exclude |
Glob pattern(s) to exclude (can be specified multiple times) | ||
--include-hidden |
Include hidden files | false |
|
--no-tree |
Skip directory tree | false |
|
--no-tokens |
Disable token counting | false |
|
--max-size |
Max file size (bytes) | 512000 |
|
--changed |
Only scan git-modified files | false |
|
--since |
Only scan files changed since commit/tag | ||
--token-tree |
Show per-file token count tree | false |
|
--security-check / --no-security-check |
Detect and redact secrets (API keys, tokens, etc.) | true |
|
--call-graph |
Extract function call relationships per file | false |
|
--version |
-v |
Show version |
# Copy to clipboard for AI assistants
brfit . | pbcopy # macOS
brfit . | xclip # Linux
brfit . | clip # Windows
# Analyze project and save
brfit ./my-project -o briefing.xml
# Include function bodies (full code)
brfit . --include-body
# Skip directory tree output
brfit . --no-tree
# Only scan git-modified files
brfit . --changed
# Only scan files changed since a tag
brfit . --since v1.0.0
# Include imports (verbatim)
brfit . --include-importsbrfit-mcp is a standalone Model Context Protocol server that exposes brfit's code analysis as tools for AI agents. It communicates over stdio (JSON-RPC).
| Tool | Description |
|---|---|
summarize_project |
Extract signatures from a project directory. Options: path, format, include_body, include_imports, call_graph |
summarize_file |
Extract signatures from files matching a glob pattern. Options: path, include, format |
brfit-mcp --root /path/to/project{
"mcpServers": {
"brfit": {
"command": "brfit-mcp",
"args": ["--root", "/path/to/project"]
}
}
}MIT License — Use freely in personal and commercial projects.
See LICENSE for details.
