Skip to content

Commit aea5e38

Browse files
authored
Update README with detailed installation and usage instructions (#13)
This PR significantly expands the README.md file to provide more comprehensive information about the `sum-diff` tool. The changes include: 1. Enhanced project description: - Clarified that `sum-diff` analyzes both branch name and code changes 2. Improved installation instructions: - Added step-by-step commands for installation - Included option to install nightly version from GitHub 3. New API key section: - Explained the requirement for an Anthropic API key - Provided instructions on how to set the API key as an environment variable 4. Expanded usage section: - Added more context on when and how to use the tool - Included an example of the tool's output 5. Formatting improvements: - Added more code blocks and examples for better readability These updates aim to make it easier for users to understand, install, and use the `sum-diff` tool effectively. The README now provides a more complete overview of the project and its requirements.
1 parent 2ec07a8 commit aea5e38

File tree

1 file changed

+51
-4
lines changed

1 file changed

+51
-4
lines changed

README.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,64 @@
22

33
> Summarize your changes into a concise title and a detailed description.
44
5-
In this project, we provide a simple command called `sum-diff`. This command automatically generates a concise and clear title and a detailed description from the current branch's differences in a git repository.
5+
`sum-diff` is a simple command-line tool that automatically generates a concise title and a detailed description by analyzing the current git branch, including:
66

7-
## Install
7+
- Branch name
8+
- Code changes (`git diff`)
9+
10+
## Installation
11+
12+
Install using `pipx`:
813

914
```bash
15+
# Download and unzip
1016
$ unzip sum-diff.zip
11-
$ pipx ./sum-diff
17+
$ pipx install ./sum-diff
18+
19+
# Install nightly from GitHub
20+
$ pipx install git+https://github.com/ishikawa/sum-diff
1221
```
1322

14-
## How to use
23+
## API Key
24+
25+
`sum-diff` uses Anthropic's Claude 3.5 Sonnet to generate the output. Obtain an API key from [Anthropic's console](https://console.anthropic.com/) and set it as an environment variable:
26+
27+
```bash
28+
$ export ANTHROPIC_API_KEY=sk-ant-...
29+
```
30+
31+
## Usage
32+
33+
After making changes to your project and before creating a PR, run the `sum-diff` command to have the AI generate a title and description for your PR.
1534

1635
```bash
1736
$ sum-diff
1837
```
38+
39+
The command will take a few seconds to process and then output the title and description. For example:
40+
41+
````
42+
Add `while` statement support to compiler
43+
44+
This PR introduces support for `while` loops in the compiler, enhancing the language's control flow capabilities.
45+
46+
Key changes:
47+
- Add `While` token and parsing logic in `tokenizer.rs`
48+
- Implement `WhileStmt` struct and parsing in `parser.rs`
49+
- Add code generation for `while` loops in `asm.rs`
50+
- Update `LocalVarAllocator` to handle `while` statements in `allocator.rs`
51+
- Add test cases for `while` loops in `test.sh`
52+
53+
The implementation follows the existing pattern for control flow statements, such as `if` statements. The `while` loop consists of a condition and a body, which are evaluated and executed accordingly.
54+
55+
Example of the new `while` loop syntax:
56+
57+
```rust
58+
i = 0;
59+
while (i < 20)
60+
i = i + 1;
61+
return i;
62+
```
63+
64+
This PR completes the basic control flow structures for the compiler, allowing for more complex program logic to be expressed in the language.
65+
````

0 commit comments

Comments
 (0)