Skip to content

Commit 7a4a573

Browse files
author
Linus Oleander
committed
Add files.sh and LICENSE, update README, remove watch.sh
1 parent 99b7a71 commit 7a4a573

File tree

4 files changed

+65
-9
lines changed

4 files changed

+65
-9
lines changed

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2023 Linus Oleander
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+47-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
Hello World
1+
# Git AI Library
2+
3+
## Overview
4+
5+
Git AI is a Rust library that integrates with Git, leveraging OpenAI's GPT-4 model to automatically generate commit messages from code changes.
6+
7+
This crate installs a `prepare-commit-msg` Git hook in your repository. When you commit without a message, Git AI uses ChatGPT to craft a commit message based on the staged files.
8+
9+
## Installation
10+
11+
1. Ensure Rust and Cargo are installed on your system.
12+
2. Clone the Git AI repository: `git clone [repository-url]`.
13+
3. Change to the project directory: `cd git-ai`.
14+
4. Build the project with: `cargo build --release`.
15+
5. Install the Git AI binary: `cargo install --path .`.
16+
17+
## Usage
18+
19+
- Move to the Git repository where you want the hook installed.
20+
- Use `git-ai hook install` to set up the Git hook.
21+
- Set the OpenAI API key with `git-ai config set api-key <api-key>`.
22+
23+
## Configuration
24+
25+
Use `git-ai config set` followed by:
26+
27+
- `api-key <api-key>`: Set the OpenAI API key.
28+
- `max-tokens <max-tokens>`: Set the maximum characters for `git diff` passed to OpenAI (default is 5000).
29+
- `timeout <timeout>`: Set the maximum time in seconds to wait for OpenAI's response (default is 30).
30+
- `language <language>`: Choose the model language (default is `en`).
31+
32+
## Testing
33+
34+
Execute `cargo test` to run the test suite.
35+
36+
## License
37+
38+
This project is under the MIT License. For more details, see the [LICENSE](LICENSE) file.
39+
40+
## Pre-Publish Checklist
41+
42+
- Decide on an appropriate name for the binary.
43+
- Update the README with installation and testing instructions.
44+
- Ensure continuous integration (CI) passes.
45+
- Look into ways to simplify the CI process.
46+
- Define and document configuration options.
47+
- Implement a feature where CTRL-C resets the terminal.

files.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# List all files not ignored by .gitignore
4+
files=$(git ls-files)
5+
6+
# Iterate over the files and display their contents
7+
for file in $files; do
8+
echo "Contents of $file:"
9+
cat "$file"
10+
echo "--------------------------------"
11+
done

watch.sh

-8
This file was deleted.

0 commit comments

Comments
 (0)