codeprompts
v1.0.0
命令行(和TUI)工具,用於使用車把模板從代碼中創建LLM提示。
這是一個可以在Rust上進行刷新的項目,並且基於Code2Prompt,並具有一些我發現有用的其他功能。
手動將代碼和代碼片段複製到LLMS有幾個問題:
為了充分利用LLM,提示必須是清晰,全面和一致的。代碼如何提示解決這些問題:

該項目還包括一個可選的TUI包裝器,您可以在其中提供一個配置文件來覆蓋各種標誌,並在運行之前查看命令的結構。
要下載並使用CodePrompts命令行工具,您有兩個選擇:您可以從源中下載版本二進製或編譯。有關更詳細的步驟,包括設置選項卡的完成,請參見“設置指南”。
要下載版本的二進製文件,請轉到發行版並為操作系統下載二進製文件。
注意:為了使用TUI二進制,您必須將CLI二進制添加到您的路徑上,並且要么:
codeprompt要從源構建,您需要安裝git,生鏽和貨物(將用鏽蝕安裝)。
首先克隆存儲庫:
git clone [email protected]:seankim658/codeprompts.git然後編譯釋放二進制:
cd codeprompts/
cargo build --release可以在此處找到更多詳細的用法指南。
有關選項的更廣泛的文檔,請參見此處。代碼提示命令行工具具有以下參數:
Create standardized LLM prompts from your code
Usage: codeprompt [OPTIONS] [PATH] [COMMAND]
Commands:
completion Generate shell completion scripts.
help Print this message or the help of the given subcommand(s)
Arguments:
[PATH] Path to project directory
Options:
--include <INCLUDE> Glob patterns to include
--exclude <EXCLUDE> Glob patterns to exclude
--exclude-priority Change pattern priority in case of conflict to prioritize the exclusion pattern
--exclude-from-tree Eclude files/folders from the source tree based on exclude patterns
--gitignore Don't respect .gitignore file
-d, --diff-staged Capture the git diff for staged changes only (equivalent to running `git diff --cached` or `git diff --staged`
-u, --diff-unstaged Capture the git diff for unstaged changes only (equivalent to running `git diff`)
--no-tokens Don't display approximate token count of the genrated prompt
-c, --encoding <ENCODING> Tokenizer to use for token count [default: cl100k]
-o, --output <OUTPUT> Redirect output to file
-l, --no-line-numbers Turn off line numbers in source code blocks
--no-codeblock Disable wrapping code inside markdown code blocks
--relative-paths Use relative paths instead of absolute paths, including parent directory
--no-clipboard Disable copying to clipboard
-t, --template <TEMPLATE> Optional path to Handlebars template
--no-spinner Whether to render the spinner
--json Whether to print the output as JSON. Defaults to False
--issue <ISSUE> Fetch a specific Github issue for the repository
--verbose Run in verbose mode to investigate glob pattern matching
-h, --help Print help (see more with '--help')
-V, --version Print version這些模板使用一種稱為車把的簡單模板語言。
可以從項目發布中下載預定義的模板。下載templates.zip 。
當前,隨附的預定義模板是:
| 模板名稱 | 描述 |
|---|---|
default_template.hbs | 這是一個簡單的默認模板,它將構建您的項目路徑,源樹和代碼塊。 |
documentation_template.hbs | 文檔模板為記錄代碼創建了一個提示。文檔指南與Hive Lab指南和文檔要求一致。 |
git_commit.hbs | 用於創建簡潔明了的git提交消息的模板。可以與diff-staged和diff-unstaged選項一起使用。 |
git_issues.hbs | 基於GitHub問題實施更改的模板。 |
code_optimization.hbs | 用於優化時間和空間複雜性代碼的模板。 |