promptext is an intelligent code context extraction tool designed specifically for AI assistant interactions. It analyzes your codebase, filters relevant files, estimates token usage using tiktoken (GPT-3.5/4 compatible), and provides formatted output suitable for AI prompts.
Key Features
- π Smart file filtering with .gitignore support and intelligent defaults
- π Accurate token counting using tiktoken (GPT-3.5/4 compatible)
- ποΈ Comprehensive project analysis (entry points, configs, core files, tests, docs)
- π Multiple output formats (Markdown, XML)
- π§ Configurable via CLI flags or .promptext.yml
- π Project metadata extraction (language, version, dependencies)
- π Git repository information extraction
- β‘ Performance monitoring and debug logging
Quick Install
Linux/macOS:
curl -sSL https://raw.githubusercontent.com/1broseidon/promptext/main/scripts/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/1broseidon/promptext/main/scripts/install.ps1 | iex
Using Go:
go install github.com/1broseidon/promptext/cmd/promptext@latest
Windows Installation Options
- System-wide installation (requires admin): Run PowerShell as Administrator and use the command above
- User installation: Add
-UserInstall
flag to install for current user only
- Manual installation: Download the Windows binary from the releases page
Basic Usage
# Process current directory
prx
# Process specific file types
prx -e .go,.js
# Show project summary
prx -i
# Export as XML with debug logging
prx -f xml -o project.xml -D
# Process with custom exclusions and verbose output
prx -x "test/,vendor/" -v
Configuration
Create a .promptext.yml
in your project root:
extensions:
- .go
- .js
excludes:
- vendor/
- "*.test.go"
format: markdown
verbose: false
Documentation
Visit our documentation site for:
- π Getting Started Guide
- βοΈ Configuration Options
- π File Filtering Rules
- π Token Analysis
- π¬ Project Analysis Features
- π Output Format Specifications
- β‘ Performance Tips
License
MIT License - see LICENSE for details.