Skip to content

indigo-net/Brf.it

Brf.it logo

Brf.it

🌐 English | 한국어 | 日本語 | हिन्दी | Deutsch

Release Downloads Go Report Card Coverage Languages License: MIT

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



How It Works

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>


Quick Start

Installation

macOS (Homebrew)

brew install indigo-net/tap/brfit

Linux / macOS (Script)

curl -fsSL https://raw.githubusercontent.com/indigo-net/Brf.it/main/install.sh | sh

Windows (PowerShell)

irm https://raw.githubusercontent.com/indigo-net/Brf.it/main/install.ps1 | iex

From Source

git clone https://github.com/indigo-net/Brf.it.git
cd Brf.it
go build -o brfit ./cmd/brfit

First Run

brfit .                    # Analyze current directory
brfit . -f md              # Output in Markdown
brfit . -o briefing.xml    # Save to file


See It In Action

SAMPLE.md | SAMPLE.xml

This project, packaged by brfit itself. Auto-generated on every commit.



Features

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)


Supported Languages

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


CLI Reference

brfit [path] [options]

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

Examples

# 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-imports


MCP Server

brfit-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).

Tools

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

Usage

brfit-mcp --root /path/to/project

Claude Desktop Configuration

{
  "mcpServers": {
    "brfit": {
      "command": "brfit-mcp",
      "args": ["--root", "/path/to/project"]
    }
  }
}


License

MIT License — Use freely in personal and commercial projects.

See LICENSE for details.