You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-24Lines changed: 8 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,39 +4,17 @@ Command line (and TUI) tool for creating LLM prompts from your code using [Handl
4
4
5
5
This was a project to brush up on Rust and is based on [code2prompt](https://github.com/mufeedvh/code2prompt) with some additional functionality that I found useful.
6
6
7
-
-[Why Code Prompts?](#why-code-prompts)
8
-
-[Terminal User Interface](#terminal-user-interface)
9
7
-[Installation](#installation)
10
8
-[Release Binary](#release-binary)
11
9
-[Building From Source](#building-from-source)
12
10
-[Usage](#usage)
13
11
-[Arguments](#arguments)
14
12
-[Templates](#templates)
15
13
-[Usage Guides](./docs/README.md)
14
+
-[Terminal User Interface](#terminal-user-interface)
16
15
17
16
---
18
17
19
-
## Why Code Prompts?
20
-
21
-
Manually copy and pasting code and code snippets to LLMs has several issues:
22
-
23
-
1.**You lose formatting and structure**. For a language like Python that uses whitespace, the formatting and structure of the code is important for the LLM to accurately and comprehensively understand the code for your request.
24
-
2.**You lose context**. In order for the LLM to provide the best responses, it requires the context from all of your code. This includes your code snippet's dependencies, other user defined modules/objects, and other scope variables and concepts.
25
-
3.**You lose prompt standardization**: If you are using LLMs to perform repeated tasks like documenting code, you have to make sure that your documentation styling guidelines are consistent across every request.
26
-
4.**Line numbers!**: On large inputs, LLMs tend to provide code changes to precise lines, making it difficult to pin down exactly where to apply/review the changes proposed. Line numbers help alleviate this for better code provenance.
27
-
28
-
To get the most out of LLMs, prompting has to be clear, comprehensive, and consistent. How code prompts fixes these issues:
29
-
30
-
1. Code prompts will ensure the inherent structure of your code is retained to limit any possible misinterpretation or inferrence required from the LLM.
31
-
2. The complete context required for understanding the code is enclosed in a standardized format. This includes the project directory tree and file pathing.
32
-
3. By using Handlebar templates, the prompts will be comprehensive and consistent. If your preferred style guide and/or coding practices are updated in the future, there is no need to remember to update all future manually typed prompts. Instead, just update the target Handlebars template once.
33
-
34
-
## Terminal User Interface
35
-
36
-

37
-
38
-
The project also includes an optional TUI wrapper where you can provide a [config file](./docs/tui_config_file.md) to override various flags and see how the command is structured before running it.
39
-
40
18
## Installation
41
19
42
20
To download and use the codeprompts command-line tool, you have two options: you can download the release binary or compile from source. For more detailed steps, including setting up tab completions, see the [setup](/docs/setup.md) guide.
@@ -47,7 +25,7 @@ To download a release binary, go to the [releases](https://github.com/seankim658
47
25
48
26
**Note**: In order to use the TUI binary, you will have to add the CLI binary to your path and either:
49
27
50
-
- Rename the CLI release binary to `codeprompt`
28
+
- Rename the CLI release binary to `codeprompt`, or
51
29
- Update the config file for the command to run the CLI binary
52
30
53
31
### Building From Source
@@ -127,3 +105,9 @@ Currently, the included pre-defined templates are:
127
105
|[`git_commit.hbs`](./src/templates/git_commit.hbs)| Template for creating a concise and accurate git commit message. Can be used with both the `diff-staged` and `diff-unstaged` options. |
128
106
|[`git_issues.hbs`](./src/templates/git_issue.hbs)| Template for implementing changes based on a Github issue. |
129
107
|[`code_optimization.hbs`](./src/templates/code_optimization.hbs)| Template for optimizing code in time and space complexity. |
108
+
109
+
## Terminal User Interface
110
+
111
+

112
+
113
+
The project also includes an optional TUI wrapper where you can provide a [config file](./docs/tui_config_file.md) to override various flags and see how the command is structured before running it.
0 commit comments