|
23 | 23 |
|
24 | 24 | ### Download the [ai-commit](./builds/ai-commit) file |
25 | 25 |
|
26 | | -```bash |
| 26 | +```shell |
27 | 27 | curl 'https://raw.githubusercontent.com/guanguans/ai-commit/main/builds/ai-commit' -o ai-commit --progress |
28 | 28 | chmod +x ai-commit |
29 | 29 | ``` |
30 | 30 |
|
31 | 31 | ### Install via Composer |
32 | 32 |
|
33 | | -```bash |
34 | | -# Global |
| 33 | +```shell |
| 34 | +# global |
35 | 35 | composer global require guanguans/ai-commit --dev -v |
36 | 36 |
|
37 | | -# Local |
| 37 | +# local |
38 | 38 | composer require guanguans/ai-commit --dev -v |
39 | 39 | ``` |
40 | 40 |
|
41 | 41 | ## Usage |
42 | 42 |
|
43 | | -### First use requires configuration [OpenAI API key](https://platform.openai.com/account/api-keys) |
| 43 | +### Config [OpenAI API key](https://platform.openai.com/account/api-keys) |
44 | 44 |
|
45 | | -```bash |
| 45 | +```shell |
46 | 46 | ./ai-commit config set generators.openai.api_key sk-... --global |
47 | 47 | ``` |
48 | 48 |
|
49 | 49 | ### Generate and commit message |
50 | 50 |
|
51 | | -```bash |
| 51 | +```shell |
52 | 52 | ./ai-commit commit |
53 | 53 | ``` |
54 | 54 |
|
| 55 | +```shell |
| 56 | +╰─ ./ai-commit commit ─╯ |
| 57 | +1. Checking run environment: ✔ |
| 58 | +2. Generating commit messages: generating... |
| 59 | + |
| 60 | +[ |
| 61 | + { |
| 62 | + "id": 1, |
| 63 | + "subject": "Docs(README): Configure OpenAI API key", |
| 64 | + "body": "- Update README-zh_CN.md\n- Update README.md\n- Explain how to configure OpenAI API key" |
| 65 | + }, |
| 66 | + { |
| 67 | + "id": 2, |
| 68 | + "subject": "Install(Composer): Add global and local install instructions", |
| 69 | + "body": "- Update README.md\n- Add instructions for global and local install via Composer" |
| 70 | + }, |
| 71 | + { |
| 72 | + "id": 3, |
| 73 | + "subject": "Usage(Commit Messages): Add best practices", |
| 74 | + "body": "- Update README.md\n- Add best practices for writing commit messages" |
| 75 | + } |
| 76 | +] |
| 77 | + |
| 78 | +2. Generating commit messages: ✔ |
| 79 | +3. Choosing commit message: choosing... |
| 80 | + |
| 81 | + Please choice a commit message: |
| 82 | + [1] Docs(README): Configure OpenAI API key |
| 83 | + [2] Install(Composer): Add global and local install instructions |
| 84 | + [3] Usage(Commit Messages): Add best practices |
| 85 | + > |
| 86 | + |
| 87 | +``` |
| 88 | + |
55 | 89 |  |
56 | 90 |
|
57 | 91 | ## Testing |
58 | 92 |
|
59 | | -```bash |
| 93 | +```shell |
60 | 94 | composer test |
61 | 95 | ``` |
62 | 96 |
|
|
0 commit comments