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 | 用于优化时间和空间复杂性代码的模板。 |