mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-10 14:46:59 +00:00
Update cheatsheets
This commit is contained in:
29
tldr/code2prompt
Normal file
29
tldr/code2prompt
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# code2prompt
|
||||
|
||||
> Generate AI-ready prompts from a codebase (extracts, filters and formats code for LLMs).
|
||||
> More information: <https://code2prompt.dev/docs/how_to/filter_files/>.
|
||||
|
||||
- Generate a prompt for the current project and copy it to the clipboard (default behaviour):
|
||||
|
||||
`code2prompt {{path/to/project}}`
|
||||
|
||||
- Include 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.txt}}`
|
||||
|
||||
- Produce structured JSON output:
|
||||
|
||||
`code2prompt {{path/to/project}} {{[-F|--output-format]}} json`
|
||||
|
||||
- Use a custom Handlebars template when generating the prompt:
|
||||
|
||||
`code2prompt {{path/to/project}} {{[-t|--template]}} {{my_template.hbs}}`
|
||||
Reference in New Issue
Block a user