| Crates.io | toak-rs |
| lib.rs | toak-rs |
| version | 5.0.0 |
| created_at | 2025-11-17 16:56:35.726477+00 |
| updated_at | 2025-12-06 14:38:25.295554+00 |
| description | A high-performance library and CLI tool for tokenizing git repositories, cleaning code, and generating embeddings |
| homepage | |
| repository | https://github.com/geoffsee/toak |
| max_upload_size | |
| id | 1937205 |
| size | 173,047 |
A blazing-fast Rust implementation of the toak CLI tool for tokenizing git repositories into markdown files.
toak-rs processes git repository files, cleans code, redacts sensitive information, and generates a prompt.md file with token counts. This Rust version provides better performance compared to the TypeScript implementation while maintaining full feature parity.
.aiignore files at any directory levelcargo install toak-rs
git clone https://github.com/geoffsee/toak.git
cd toak/packages/toak-rs
cargo install --path .
# required for automatic downloading of the embeddings models
export HF_TOKEN=your-huggingface-api-key
# Generate prompt.md in current directory
toak
# Specify custom directory and output file
toak -d /path/to/repo -o output.md
# Run in quiet mode (no verbose output)
toak --quiet
# Show help
toak --help
-d, --dir <DIR>: Project directory to process (default: .)-o, --output-file-path <OUTPUT_FILE_PATH>: Output markdown file path (default: prompt.md)--quiet: Disable verbose output-p, --prompt <PROMPT>: Preset prompt template (currently a placeholder)-h, --help: Print help informationCreate .aiignore files to exclude patterns from processing. These work similarly to .gitignore:
# Ignore specific files
secrets.json
config.private.ts
# Ignore directories
build/
temp/
# Glob patterns
**/*.test.ts
**/._*
The tool recursively loads .aiignore files from any directory level.
The tool automatically excludes:
File Types:
.jpg, .png, .gif, .svg, .webp, etc..ttf, .woff, .eot, .otf.exe, .dll, .so, .dylib.zip, .tar, .gz, .rar, .7z.mp3, .mp4, .avi, .mov, .wav.db, .sqlite, .sqlite3Patterns:
.env*, tsconfig.json, package-lock.json).git*, .hg*, .svn*)build/, dist/, out/)node_modules/, target/)docs/, README*, CHANGELOG*).idea/, .vscode/)test/, spec/, __tests__/)git ls-files to get tracked files.aiignore and .gitignore filesThe Rust implementation provides significant performance improvements over the TypeScript version:
GNU AFFERO GENERAL PUBLIC LICENSE Version 3 (AGPL-3.0-or-later)
Contributions are welcome! Please feel free to submit pull requests.