v1.0.2 — Now with Hybrid Binary Detection

Turn Any Git Repo
into LLM Prompts

A powerful CLI tool to transform any Git repository into clean, prompt-friendly text ingests for AI analysis, training data, and search indexing.

terminal
$ codetxt https://github.com/facebook/react
→ Cloning repository...
→ Scanning 2450 files...
→ Filtering with .gitignore rules...
✓ Generated react-code.txt (1.2MB)
$ cat react-code.txt | head -n 10

Powerful Features

Everything you need to generate perfect code ingests for AI models

Remote & Local

Clone remote Git URLs or scan local directories effortlessly with a single command.

LLM-Ready Output

Generates clean, structured text ingests optimized for AI models and training data.

Advanced Filtering

Fine-grained control using powerful glob-style include and exclude patterns.

Gitignore Aware

Automatically respects your project's .gitignore rules, or override when needed.

Size Limits

Automatically skip files larger than your specified limit to keep outputs clean.

Private Repos

Access private repositories securely using GitHub Personal Access Tokens.

Get Started in Seconds

Install CodeTxt globally and start analyzing repositories

Install directly from the npm registry (recommended):

$ npm install -g codetxt

Requires Node.js v18 or higher. After installation, the codetxt command will be available globally.

Simple & Powerful Usage

From basic commands to advanced filtering, CodeTxt adapts to your workflow

Remote Repository

Clone and analyze any public GitHub repository:

$ codetxt https://github.com/expressjs/express
# Generates code.txt with all Express source files

Local Directory

Analyze your current project or any local path:

$ codetxt . -o my-project.txt
# Analyzes current directory, outputs to my-project.txt

Include Patterns

Whitelist specific file types or directories:

$ codetxt . --include-pattern "**/*.ts" --include-pattern "**/*.md"
# Only TypeScript and Markdown files

Exclude Patterns

Skip unwanted directories or file types:

$ codetxt . --exclude-pattern "tests/" --exclude-pattern "*.log"
# Skip tests directory and log files

Advanced Pipeline

Combine options for maximum control

$ codetxt https://github.com/vuejs/core \
  --branch main \
  --include-pattern "packages/**/*.ts" \
  --exclude-pattern "**/*.test.ts" \
  --max-size 50000 \
  -o vue-core-digest.txt
Specific branch Whitelist files Exclude tests Size limit Custom output

All Options & Flags

Complete reference for all available command-line options

Flag Alias Description Default
--output <file> -o Specify an output file. Use - for stdout. code.txt
--max-size <bytes> -s Skip files larger than this size in bytes. 10MB
--branch <name> -b For remote repos, specify a branch to clone. Default repo branch
--include-pattern <glob> — Only include files/directories matching the glob pattern(s). —
--exclude-pattern <glob> — Exclude files/directories matching the glob pattern(s). —
--include-gitignored — Process files normally ignored by .gitignore. false
--force -f Overwrite existing output file without confirmation. false
--token <pat> -t GitHub Personal Access Token for private repositories. —