Skip to content

Commit 1b7a2e3

Browse files
committed
Update readme
1 parent 653b97d commit 1b7a2e3

1 file changed

Lines changed: 8 additions & 24 deletions

File tree

README.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,17 @@ Command line (and TUI) tool for creating LLM prompts from your code using [Handl
44

55
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.
66

7-
- [Why Code Prompts?](#why-code-prompts)
8-
- [Terminal User Interface](#terminal-user-interface)
97
- [Installation](#installation)
108
- [Release Binary](#release-binary)
119
- [Building From Source](#building-from-source)
1210
- [Usage](#usage)
1311
- [Arguments](#arguments)
1412
- [Templates](#templates)
1513
- [Usage Guides](./docs/README.md)
14+
- [Terminal User Interface](#terminal-user-interface)
1615

1716
---
1817

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-
![TUI](./imgs/tui.png)
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-
4018
## Installation
4119

4220
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
4725

4826
**Note**: In order to use the TUI binary, you will have to add the CLI binary to your path and either:
4927

50-
- Rename the CLI release binary to `codeprompt`
28+
- Rename the CLI release binary to `codeprompt`, or
5129
- Update the config file for the command to run the CLI binary
5230

5331
### Building From Source
@@ -127,3 +105,9 @@ Currently, the included pre-defined templates are:
127105
| [`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. |
128106
| [`git_issues.hbs`](./src/templates/git_issue.hbs) | Template for implementing changes based on a Github issue. |
129107
| [`code_optimization.hbs`](./src/templates/code_optimization.hbs) | Template for optimizing code in time and space complexity. |
108+
109+
## Terminal User Interface
110+
111+
![TUI](./imgs/tui.png)
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

Comments
 (0)