Skip to content

Commit

Permalink
docs: type flag/config for Conventional Commits (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
WiegerWolf committed May 12, 2023
1 parent 7631c2f commit 578572b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ aicommits --generate <i> # or -g <i>

> Warning: this uses more tokens, meaning it costs more.
#### Generating Conventional Commits

If you'd like to generate [Conventional Commits](https://conventionalcommits.org/), you can use the `--type` flag followed by `conventional`. This will prompt `aicommits` to format the commit message according to the Conventional Commits specification:

```sh
aicommits --type conventional # or -t conventional
```

This feature can be useful if your project follows the Conventional Commits standard or if you're using tools that rely on this commit format.

### Git hook

You can also integrate _aicommits_ with Git via the [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. This lets you use Git like you normally would, and edit the commit message before committing.
Expand Down Expand Up @@ -203,6 +213,22 @@ Default: `50`
aicommits config set max-length=100
```

#### type

Default: `""` (Empty string)

The type of commit message to generate. Set this to "conventional" to generate commit messages that follow the Conventional Commits specification:

```sh
aicommits config set type=conventional
```

You can clear this option by setting it to an empty string:

```sh
aicommits config set type=
```

## How it works

This CLI tool runs `git diff` to grab all your latest code changes, sends them to OpenAI's GPT-3, then returns the AI generated commit message.
Expand Down

0 comments on commit 578572b

Please sign in to comment.