๐Ÿ”ง #code2prompt: A command-line tool for converting codebases to #LLM prompts

Key features:
โ€ข ๐Ÿ“ Generates well-formatted #Markdown prompts with source tree structure
โ€ข ๐Ÿ› ๏ธ Customizable #Handlebars templates for versatile prompt generation
โ€ข ๐Ÿ” Respects .gitignore and supports file filtering with glob patterns
โ€ข ๐Ÿ”ข Displays token count using various #tokenizers (cl100k, p50k, r50k_base)
โ€ข ๐Ÿ“Š #Git diff integration for commit messages and #PullRequest descriptions
โ€ข ๐Ÿ“‹ Automatic clipboard copy and option to save output to file

Additional capabilities:
โ€ข ๐Ÿ”ข Line numbering for source code blocks
โ€ข ๐Ÿ”€ JSON output option for structured data
โ€ข ๐Ÿšซ Exclusion of files/folders from source tree
โ€ข ๐Ÿ“ Support for user-defined variables in templates

#opensource project written in #Rust, available on #crates_io and #AUR

Useful for:
โ€ข Quick #LLM prompt generation from codebases
โ€ข Code documentation and analysis
โ€ข Bug finding and security vulnerability assessment
โ€ข Performance optimization suggestions

https://github.com/mufeedvh/code2prompt

GitHub - mufeedvh/code2prompt: A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.

A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting. - mufeedvh/code2prompt

GitHub