commitai 0.1.14__py3-none-any.whl → 0.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- commitai/cli.py +104 -58
- commitai/template.py +25 -0
- commitai-0.1.16.dist-info/METADATA +119 -0
- commitai-0.1.16.dist-info/RECORD +9 -0
- {commitai-0.1.14.dist-info → commitai-0.1.16.dist-info}/WHEEL +1 -1
- commitai-0.1.16.dist-info/entry_points.txt +3 -0
- commitai-0.1.14.dist-info/METADATA +0 -100
- commitai-0.1.14.dist-info/RECORD +0 -8
- commitai-0.1.14.dist-info/entry_points.txt +0 -3
- {commitai-0.1.14.dist-info → commitai-0.1.16.dist-info}/top_level.txt +0 -0
commitai/cli.py
CHANGED
|
@@ -15,6 +15,11 @@ from commitai.git import (
|
|
|
15
15
|
save_commit_template,
|
|
16
16
|
stage_all_changes,
|
|
17
17
|
)
|
|
18
|
+
from commitai.template import (
|
|
19
|
+
adding_template,
|
|
20
|
+
build_user_message,
|
|
21
|
+
default_system_message,
|
|
22
|
+
)
|
|
18
23
|
|
|
19
24
|
|
|
20
25
|
@click.group(context_settings=dict(help_option_names=["-h", "--help"]))
|
|
@@ -22,8 +27,8 @@ def cli():
|
|
|
22
27
|
pass
|
|
23
28
|
|
|
24
29
|
|
|
25
|
-
@cli.command()
|
|
26
|
-
@click.argument("
|
|
30
|
+
@cli.command(name="generate")
|
|
31
|
+
@click.argument("description", nargs=-1, type=click.UNPROCESSED)
|
|
27
32
|
@click.option(
|
|
28
33
|
"--commit",
|
|
29
34
|
"-c",
|
|
@@ -48,93 +53,134 @@ def cli():
|
|
|
48
53
|
default="claude-opus",
|
|
49
54
|
help="Set the engine model to be used",
|
|
50
55
|
)
|
|
51
|
-
def
|
|
52
|
-
|
|
53
|
-
description_or_command_exists = len(description_or_command) > 1
|
|
54
|
-
is_command = (
|
|
55
|
-
description_or_command[0] == "create-template"
|
|
56
|
-
if description_or_command_exists
|
|
57
|
-
else False
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
if is_command:
|
|
61
|
-
if len(description_or_command) > 1:
|
|
62
|
-
template_content = " ".join(description_or_command[1:])
|
|
63
|
-
save_commit_template(template_content)
|
|
64
|
-
click.echo("Template saved successfully.")
|
|
65
|
-
return
|
|
66
|
-
else:
|
|
67
|
-
click.echo("Please provide the template content.")
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
explanation = " ".join(description_or_command)
|
|
56
|
+
def generate_message(description, commit, template, add, model):
|
|
57
|
+
explanation = " ".join(description)
|
|
71
58
|
if model == "gpt-4":
|
|
72
59
|
llm = ChatOpenAI(model_name="gpt-4")
|
|
73
60
|
elif model == "claude-opus":
|
|
74
61
|
llm = ChatAnthropic(model="claude-3-opus-20240229")
|
|
75
62
|
else:
|
|
76
|
-
click.
|
|
63
|
+
click.secho(f"🚫 Unsupported model: {model}", fg="red", bold=True)
|
|
77
64
|
return
|
|
78
65
|
|
|
79
66
|
if add:
|
|
80
67
|
stage_all_changes()
|
|
81
68
|
|
|
69
|
+
click.secho(
|
|
70
|
+
"\n🔍 Looking for a native pre-commit hook and running it\n",
|
|
71
|
+
fg="blue",
|
|
72
|
+
bold=True,
|
|
73
|
+
)
|
|
74
|
+
|
|
82
75
|
if not run_pre_commit_hook():
|
|
83
|
-
click.
|
|
76
|
+
click.secho(
|
|
77
|
+
"🚫 Pre-commit hook failed. Aborting commit.",
|
|
78
|
+
fg="red",
|
|
79
|
+
bold=True,
|
|
80
|
+
)
|
|
84
81
|
return
|
|
85
82
|
|
|
86
83
|
diff = get_staged_changes_diff()
|
|
87
84
|
if not diff:
|
|
88
|
-
click.
|
|
85
|
+
click.secho(
|
|
86
|
+
"⚠️ Warning: No staged changes found. Exiting.",
|
|
87
|
+
fg="yellow",
|
|
88
|
+
bold=True,
|
|
89
|
+
)
|
|
89
90
|
return
|
|
90
91
|
|
|
92
|
+
# Clear the terminal using click
|
|
93
|
+
click.clear()
|
|
94
|
+
|
|
91
95
|
repo_name = get_repository_name()
|
|
92
96
|
branch_name = get_current_branch_name()
|
|
93
97
|
formatted_diff = f"{repo_name}/{branch_name}\n\n{diff}"
|
|
94
98
|
|
|
95
99
|
if not template:
|
|
96
100
|
template = get_commit_template()
|
|
97
|
-
|
|
98
|
-
system_message = (
|
|
99
|
-
"You are a helpful git commit assistant. "
|
|
100
|
-
"You will receive a git diff and generate a commit message."
|
|
101
|
-
"Try to be meaningful and avoid generic messages."
|
|
102
|
-
)
|
|
101
|
+
system_message: str = ""
|
|
103
102
|
if template:
|
|
104
|
-
system_message +=
|
|
103
|
+
system_message += default_system_message
|
|
104
|
+
system_message += adding_template
|
|
105
105
|
system_message += template
|
|
106
106
|
|
|
107
|
-
user_message = formatted_diff
|
|
108
107
|
if explanation:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
diff = build_user_message(explanation, formatted_diff)
|
|
109
|
+
|
|
110
|
+
input_message = f"{system_message}\n\n{diff}"
|
|
111
|
+
click.secho(
|
|
112
|
+
"\n\n🧠 Analyzing the changes and generating a commit message...\n\n",
|
|
113
|
+
fg="blue",
|
|
114
|
+
bold=True,
|
|
115
|
+
),
|
|
117
116
|
ai_message = llm.invoke(input=input_message)
|
|
118
117
|
commit_message = ai_message.content
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
repo_path = get_repository_name()
|
|
120
|
+
commit_msg_path = os.path.join(repo_path, ".git", "COMMIT_EDITMSG")
|
|
121
|
+
with open(commit_msg_path, "w") as f:
|
|
122
|
+
f.write(commit_message)
|
|
123
|
+
|
|
124
|
+
if not commit:
|
|
125
|
+
click.edit(filename=commit_msg_path)
|
|
126
|
+
|
|
127
|
+
with open(commit_msg_path, "r") as f:
|
|
128
|
+
final_commit_message = f.read().strip()
|
|
129
|
+
|
|
130
|
+
create_commit(final_commit_message)
|
|
131
|
+
click.secho(
|
|
132
|
+
f"\n\n✅ Committed message:\n\n{final_commit_message}\n\n",
|
|
133
|
+
fg="green",
|
|
134
|
+
bold=True,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@cli.command(name="create-template")
|
|
139
|
+
@click.argument("template_content", nargs=-1, type=click.UNPROCESSED)
|
|
140
|
+
def create_template_command(template_content):
|
|
141
|
+
template_content = " ".join(template_content)
|
|
142
|
+
if template_content:
|
|
143
|
+
save_commit_template(template_content)
|
|
144
|
+
click.secho("📝 Template saved successfully.", fg="green")
|
|
123
145
|
else:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
146
|
+
click.secho("❗ Please provide the template content.", fg="red")
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@click.command(name="commitai")
|
|
150
|
+
@click.argument("description", nargs=-1, type=click.UNPROCESSED)
|
|
151
|
+
@click.option(
|
|
152
|
+
"--add",
|
|
153
|
+
"-a",
|
|
154
|
+
is_flag=True,
|
|
155
|
+
help="Stage all changes before generating the commit message",
|
|
156
|
+
)
|
|
157
|
+
@click.option(
|
|
158
|
+
"--commit",
|
|
159
|
+
"-c",
|
|
160
|
+
is_flag=True,
|
|
161
|
+
help="Commit the changes with the generated message",
|
|
162
|
+
)
|
|
163
|
+
@click.pass_context
|
|
164
|
+
def commitai(ctx, description, add, commit):
|
|
165
|
+
if add:
|
|
166
|
+
stage_all_changes()
|
|
167
|
+
ctx.invoke(
|
|
168
|
+
generate_message,
|
|
169
|
+
description=description,
|
|
170
|
+
add=add,
|
|
171
|
+
commit=commit,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@click.command(name="commitai-create-template")
|
|
176
|
+
@click.argument("template_content", nargs=-1, type=click.UNPROCESSED)
|
|
177
|
+
@click.pass_context
|
|
178
|
+
def commitai_create_template(ctx, template_content):
|
|
179
|
+
ctx.invoke(create_template_command, template_content=template_content)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
cli.add_command(commitai)
|
|
183
|
+
cli.add_command(commitai_create_template)
|
|
138
184
|
|
|
139
185
|
|
|
140
186
|
if __name__ == "__main__":
|
commitai/template.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# flake8: noqa: E501
|
|
4
|
+
|
|
5
|
+
default_system_message = (
|
|
6
|
+
"You are a helpful git commit assistant. "
|
|
7
|
+
"You will receive a git diff and generate a clear, concise, and meaningful commit message."
|
|
8
|
+
"The commit message should strictly follow the conventional commit format: "
|
|
9
|
+
"<type>(<scope>): <subject>\n\n<body>\n\n<footer>"
|
|
10
|
+
"Types can be: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert."
|
|
11
|
+
"Scope is optional and represents the section of the codebase affected by the changes."
|
|
12
|
+
"Subject should be a short summary of the changes, in present tense and imperative mood."
|
|
13
|
+
"Body should provide more details about the changes, if necessary."
|
|
14
|
+
"Footer can contain references to issues, pull requests, or breaking changes."
|
|
15
|
+
"Avoid generic messages like 'update', 'fix bugs', or 'improve code'."
|
|
16
|
+
"Focus on the specific changes made and their impact."
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
adding_template = " The message should follow this template: "
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def build_user_message(explanation, diff):
|
|
23
|
+
return (
|
|
24
|
+
f"Here is a high-level explanation of the commit: {explanation}" f"\n\n{diff}"
|
|
25
|
+
)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: commitai
|
|
3
|
+
Version: 0.1.16
|
|
4
|
+
Summary: Commitai helps you generate git commit messages using AI
|
|
5
|
+
Home-page: https://github.com/lguibr/commitai
|
|
6
|
+
Author: Luis Guilherme
|
|
7
|
+
Author-email: lgpelin92@gmail.com
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/lguibr/commitai/issues
|
|
9
|
+
Project-URL: Documentation, https://github.com/lguibr/commitai/blob/main/README.md
|
|
10
|
+
Project-URL: Source Code, https://github.com/lguibr/commitai
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Requires-Python: >=3.6
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: langchain
|
|
23
|
+
Requires-Dist: click
|
|
24
|
+
Requires-Dist: langchain-community
|
|
25
|
+
Requires-Dist: langchain-anthropic
|
|
26
|
+
Requires-Dist: langchain-openai
|
|
27
|
+
Requires-Dist: setuptools
|
|
28
|
+
|
|
29
|
+
# CommitAi - Your AI-Powered Commit Assistant
|
|
30
|
+
|
|
31
|
+
[](https://github.com/lguibr/commitai/actions)
|
|
32
|
+
[](https://codecov.io/gh/lguibr/commitai)
|
|
33
|
+
[](https://pypi.org/project/CommitAi/)
|
|
34
|
+
[](https://pypi.org/project/CommitAi/)
|
|
35
|
+
[](https://github.com/lguibr/CommitAi/blob/main/LICENSE)
|
|
36
|
+
|
|
37
|
+
**CommitAi** simplifies the Git commit message creation process by leveraging AI technologies, including GPT-4 and Claude. Designed for developers who value clarity and precision in commit histories, **CommitAi** offers a streamlined workflow that transforms your staged changes and high-level explanations into informative commit messages. Enhance your project documentation and streamline your development process with commit messages that truly reflect your changes.
|
|
38
|
+
|
|
39
|
+
## Demo
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
This demo GIF shows CommitAi in action, demonstrating how it generates a commit without any additional input, using Claude 3 Opus.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **Intelligent Commit Generation**: Leverages state-of-the-art AI models to generate meaningful commit messages from your changes.
|
|
48
|
+
- **Pre-commit Checks**: Automatically runs configured pre-commit hooks to ensure quality and consistency before generating messages.
|
|
49
|
+
- **Template Support**: Utilizes both global and repository-specific commit message templates to maintain a consistent style across your projects.
|
|
50
|
+
- **AI Model Integration**: Supports multiple AI models, including GPT-4 by OpenAI and Claude by Anthropic, ensuring versatility in natural language processing capabilities.
|
|
51
|
+
|
|
52
|
+
## Getting Started
|
|
53
|
+
|
|
54
|
+
### Prerequisites
|
|
55
|
+
|
|
56
|
+
- Python 3.6 or later
|
|
57
|
+
- API keys for GPT-4 and Claude, as required
|
|
58
|
+
|
|
59
|
+
### Installation
|
|
60
|
+
|
|
61
|
+
Install **CommitAi** directly from PyPI:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install commitai
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Configuration
|
|
68
|
+
|
|
69
|
+
#### API Keys
|
|
70
|
+
|
|
71
|
+
Set the necessary API keys as environment variables:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export OPENAI_API_KEY="your_openai_api_key"
|
|
75
|
+
export ANTHROPIC_API_KEY="your_anthropic_api_key"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Commit Templates
|
|
79
|
+
|
|
80
|
+
Set a global commit template environment variable:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
export TEMPLATE_COMMIT="My global custom template: {message}"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or, create a repository-specific template using:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
commitai-create-template "My repository-specific template: {message}"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This creates a hidden template file within the `.git` directory of your repository.
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
To generate a commit message, provide a high-level explanation of your changes:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
commitai "This is a high-level explanation of my commit"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### Options
|
|
103
|
+
|
|
104
|
+
- `-a, --add`: Stage all changes before generating the commit message.
|
|
105
|
+
- `-c, --commit`: Automatically create the commit using the generated message.
|
|
106
|
+
- `-t, --template`: Specify a commit template. Defaults to the global template if available.
|
|
107
|
+
- `-m, --model`: Choose the AI model (`gpt-4` by default).
|
|
108
|
+
|
|
109
|
+
### Additional Commands
|
|
110
|
+
|
|
111
|
+
- `commitai-create-template`: Set a custom template specific to your repository.
|
|
112
|
+
|
|
113
|
+
## Contributing
|
|
114
|
+
|
|
115
|
+
Contributions are welcome! Feel free to fork the repository, push your changes to a branch, and open a pull request. For bugs, questions, or feature requests, please open an issue through the GitHub issue tracker.
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
**CommitAi** is open-source software licensed under the MIT License. See the [LICENSE](https://github.com/lguibr/CommitAi/blob/main/LICENSE) file for more details.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
commitai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
commitai/cli.py,sha256=e6AxBnTBRW4yjl8lmzYBYWaVDdpZQ97UV3k81IvjLzY,4766
|
|
3
|
+
commitai/git.py,sha256=XWAloZWQuLrFHUyfh3SkOgLsL4kfKRtgj3fzuJjcL2A,1649
|
|
4
|
+
commitai/template.py,sha256=KlAhYUgea1rXpih6TyFeZ2rU8qN1H-VfZpMt7Wi8dZA,1137
|
|
5
|
+
commitai-0.1.16.dist-info/METADATA,sha256=b4NT4tsnKlVFoyH3SrJyjeHG2ctwJdms7H9ngh2xvvM,4711
|
|
6
|
+
commitai-0.1.16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
7
|
+
commitai-0.1.16.dist-info/entry_points.txt,sha256=KS-RBWo8XGrU1a11k6FgRCIwjGq8X5Zs-OuY8ri9BYU,116
|
|
8
|
+
commitai-0.1.16.dist-info/top_level.txt,sha256=X76OfoBOic7IkaMkIgobuZxsVlsmcY_WMtBrtXtfn_w,9
|
|
9
|
+
commitai-0.1.16.dist-info/RECORD,,
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: commitai
|
|
3
|
-
Version: 0.1.14
|
|
4
|
-
Summary: Commitai helps you generate git commit messages using AI
|
|
5
|
-
Home-page: https://github.com/lguibr/commitai
|
|
6
|
-
Author: Luis Guilherme
|
|
7
|
-
Author-email: lgpelin92@gmail.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/lguibr/commitai/issues
|
|
10
|
-
Project-URL: Documentation, https://github.com/lguibr/commitai/blob/main/README.md
|
|
11
|
-
Project-URL: Source Code, https://github.com/lguibr/commitai
|
|
12
|
-
Platform: UNKNOWN
|
|
13
|
-
Classifier: Development Status :: 3 - Alpha
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
-
Requires-Python: >=3.6
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
Requires-Dist: click
|
|
25
|
-
Requires-Dist: langchain
|
|
26
|
-
Requires-Dist: langchain-anthropic
|
|
27
|
-
Requires-Dist: langchain-community
|
|
28
|
-
Requires-Dist: langchain-openai
|
|
29
|
-
Requires-Dist: setuptools
|
|
30
|
-
|
|
31
|
-
# CommitAi - Commit Message AI
|
|
32
|
-
|
|
33
|
-
[](https://github.com/lguibr/commitai/actions)
|
|
34
|
-
[](https://pypi.org/project/CommitAi/)
|
|
35
|
-
[](https://pypi.org/project/CommitAi/)
|
|
36
|
-
[](https://github.com/lguibr/CommitAi/blob/main/LICENSE)
|
|
37
|
-
|
|
38
|
-
commitai is a command-line tool that helps you generate informative and relevant commit messages for your Git repositories using AI language models like GPT-4 and Claude. It analyzes your staged changes, combines them with a high-level explanation provided by you, and creates a commit message based on this information. Additionally, it supports custom commit message templates. This not only saves you time and effort but also ensures a consistent and meaningful commit history.
|
|
39
|
-
|
|
40
|
-
## Features
|
|
41
|
-
|
|
42
|
-
- Automatically runs the repository's pre-commit hook (if it exists) before generating the commit message to avoid discarded commit costs.
|
|
43
|
-
- Generates informative and relevant commit messages based on staged changes and user-provided explanations.
|
|
44
|
-
- Supports custom commit message templates.
|
|
45
|
-
- Integrates with AI language models like GPT-4 and Claude for intelligent commit message generation.
|
|
46
|
-
|
|
47
|
-
## Prerequisites
|
|
48
|
-
|
|
49
|
-
- Python 3.x
|
|
50
|
-
- API keys for the desired language models (e.g., OpenAI API key for GPT-4, Anthropic API key for Claude)
|
|
51
|
-
|
|
52
|
-
## Installation
|
|
53
|
-
|
|
54
|
-
You can install commitai using pip:
|
|
55
|
-
|
|
56
|
-
pip install commitai
|
|
57
|
-
|
|
58
|
-
## Configuration
|
|
59
|
-
|
|
60
|
-
### Environment Variables
|
|
61
|
-
|
|
62
|
-
Before using commitai, you need to set the API key environment variables for the language models you want to use. For example:
|
|
63
|
-
|
|
64
|
-
export OPENAI_API_KEY="your_openai_api_key"
|
|
65
|
-
export ANTHROPIC_API_KEY="your_anthropic_api_key"
|
|
66
|
-
|
|
67
|
-
You can also set the `TEMPLATE_COMMIT` environment variable to define a global template for your commit messages:
|
|
68
|
-
|
|
69
|
-
export TEMPLATE_COMMIT="My global custom template: {message}"
|
|
70
|
-
|
|
71
|
-
### Template Configuration
|
|
72
|
-
|
|
73
|
-
#### Creating a Template for the Repository
|
|
74
|
-
|
|
75
|
-
You can create a custom template specific to the repository using the `create-template` command. This template will override the global template set in the `TEMPLATE_COMMIT` environment variable if present.
|
|
76
|
-
|
|
77
|
-
commitai create-template "My repository-specific template: {message}"
|
|
78
|
-
|
|
79
|
-
This command will create a hidden file inside the `.git` directory to store the template.
|
|
80
|
-
|
|
81
|
-
## Usage
|
|
82
|
-
|
|
83
|
-
### Generating Commit Messages
|
|
84
|
-
|
|
85
|
-
commitai generate "This is a high-level explanation of my commit"
|
|
86
|
-
|
|
87
|
-
- Use the `-a` or `--add` flag to stage all changes.
|
|
88
|
-
- Use the `-c` or `--commit` flag to automatically create the commit.
|
|
89
|
-
- Use the `-t` or `--template` flag for custom templates or utilize the `TEMPLATE_COMMIT` environment variable. If no template is provided, a default or global template will be used.
|
|
90
|
-
- Use the `-m` or `--model` flag to specify the language model to use (default: `gpt-4`).
|
|
91
|
-
|
|
92
|
-
## Contributing
|
|
93
|
-
|
|
94
|
-
We welcome contributions to the commitai project! Please feel free to submit issues, feature requests, or pull requests.
|
|
95
|
-
|
|
96
|
-
## License
|
|
97
|
-
|
|
98
|
-
This project is released under the MIT License.
|
|
99
|
-
|
|
100
|
-
|
commitai-0.1.14.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
commitai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
commitai/cli.py,sha256=2iBGpOOg74v0LeUWTf0GpKtcPr8MKizZ91dny-Svyz0,3950
|
|
3
|
-
commitai/git.py,sha256=XWAloZWQuLrFHUyfh3SkOgLsL4kfKRtgj3fzuJjcL2A,1649
|
|
4
|
-
commitai-0.1.14.dist-info/METADATA,sha256=GmeHM8d2NnHur_OXHcV746Lp7UM8O9NAXUe18mHxn14,4295
|
|
5
|
-
commitai-0.1.14.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
6
|
-
commitai-0.1.14.dist-info/entry_points.txt,sha256=QbzYbxAVd7mBu9YlY9Q0KglNrWU-41feTmG7EvyvBhQ,48
|
|
7
|
-
commitai-0.1.14.dist-info/top_level.txt,sha256=X76OfoBOic7IkaMkIgobuZxsVlsmcY_WMtBrtXtfn_w,9
|
|
8
|
-
commitai-0.1.14.dist-info/RECORD,,
|
|
File without changes
|