code2prompt
all
Generate AI-ready prompts from a codebase (extract, filter, and format code for LLMs).
More info →Options (5)
-i, --includebooleanInclude only specific files and exclude a directory
Example:
code2prompt {{path/to/project}} {{[-i|--include]}} "{{**/*.rs}}" {{[-e|--exclude]}} "{{tests/**}}"-e, --excludebooleanInclude only specific files and exclude a directory
Example:
code2prompt {{path/to/project}} {{[-i|--include]}} "{{**/*.rs}}" {{[-e|--exclude]}} "{{tests/**}}"-O, --output-filebooleanWrite the prompt to a file instead of the clipboard
Example:
code2prompt {{path/to/project}} {{[-O|--output-file]}} {{my_prompt.txt}}-F, --output-formatbooleanProduce structured JSON output
Example:
code2prompt {{path/to/project}} {{[-F|--output-format]}} json-t, --templatebooleanUse a custom Handlebars template when generating the prompt
Example:
code2prompt {{path/to/project}} {{[-t|--template]}} {{my_template.hbs}}Examples (5)
Generate a prompt for the current project and copy it to the clipboard (default behavior)
code2prompt path/to/projectInclude only specific files and exclude a directory
code2prompt path/to/project [-i|--include] "**/*.rs" [-e|--exclude] "tests/**"Write the prompt to a file instead of the clipboard
code2prompt path/to/project [-O|--output-file] my_prompt.txtProduce structured JSON output
code2prompt path/to/project [-F|--output-format] jsonUse a custom Handlebars template when generating the prompt
code2prompt path/to/project [-t|--template] my_template.hbsmade by @shridhargupta | data from tldr-pages