commitwise 0.1.1__tar.gz → 0.1.3__tar.gz
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.
- commitwise-0.1.3/PKG-INFO +145 -0
- commitwise-0.1.3/README.md +131 -0
- commitwise-0.1.3/commitwise/__init__.py +1 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/cli.py +16 -30
- commitwise-0.1.3/commitwise/cli_utils.py +87 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/git_utils.py +34 -1
- commitwise-0.1.3/commitwise.egg-info/PKG-INFO +145 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise.egg-info/SOURCES.txt +1 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/pyproject.toml +1 -1
- commitwise-0.1.1/PKG-INFO +0 -85
- commitwise-0.1.1/README.md +0 -71
- commitwise-0.1.1/commitwise/ai/__init__.py +0 -0
- commitwise-0.1.1/commitwise.egg-info/PKG-INFO +0 -85
- {commitwise-0.1.1/commitwise → commitwise-0.1.3/commitwise/ai}/__init__.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/ai/base.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/ai/local_engine.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/ai/openai_engine.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/ai_source.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/config.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise/file_source.py +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise.egg-info/dependency_links.txt +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise.egg-info/entry_points.txt +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise.egg-info/requires.txt +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/commitwise.egg-info/top_level.txt +0 -0
- {commitwise-0.1.1 → commitwise-0.1.3}/setup.cfg +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: commitwise
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Generate clean git commit messages from files or AI
|
|
5
|
+
Author-email: Abolfazl Hassan Zade <abolfazl.hassanzade.81@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: homepage, https://github.com/hasssan-hasssan/commitwise
|
|
8
|
+
Project-URL: repository, https://github.com/hasssan-hasssan/commitwise
|
|
9
|
+
Project-URL: issues, https://github.com/hasssan-hasssan/commitwise/issues
|
|
10
|
+
Keywords: git,commit,cli,ai
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests>=2.31.0
|
|
14
|
+
|
|
15
|
+
CommitWise
|
|
16
|
+
===========
|
|
17
|
+
CommitWise is a smart and simple tool for generating clean Git commit messages.
|
|
18
|
+
It can create commit messages from a text file or using AI models.
|
|
19
|
+
|
|
20
|
+
**With CommitWise, your commits are always:**
|
|
21
|
+
- **Clean and readable**
|
|
22
|
+
- **Following Git best practices**
|
|
23
|
+
- **Well-structured and informative**
|
|
24
|
+
<br>
|
|
25
|
+
|
|
26
|
+
Features
|
|
27
|
+
--------
|
|
28
|
+
- Generate commits from text files, preserving exact formatting, spacing, and paragraphs
|
|
29
|
+
|
|
30
|
+
- Generate commits using AI (local with Ollama or OpenAI API)
|
|
31
|
+
|
|
32
|
+
- Simple and easy-to-use CLI with only a few flags
|
|
33
|
+
|
|
34
|
+
- Works seamlessly in any Git project
|
|
35
|
+
<br>
|
|
36
|
+
|
|
37
|
+
Requirements
|
|
38
|
+
------------
|
|
39
|
+
- Python >= **`3.9`**
|
|
40
|
+
|
|
41
|
+
- For local AI : **`Ollama`** installed and the desired model downloaded
|
|
42
|
+
|
|
43
|
+
- For online AI : **`OpenAI API Key`** (if using OpenAI)
|
|
44
|
+
<br>
|
|
45
|
+
|
|
46
|
+
Installation
|
|
47
|
+
------------
|
|
48
|
+
```
|
|
49
|
+
$> pip install commitwise
|
|
50
|
+
```
|
|
51
|
+
<br>
|
|
52
|
+
|
|
53
|
+
AI Configuration
|
|
54
|
+
----------------
|
|
55
|
+
CommitWise supports two AI modes:
|
|
56
|
+
- Local AI using Ollama (recommended)
|
|
57
|
+
|
|
58
|
+
- OpenAI API
|
|
59
|
+
|
|
60
|
+
**You only need to configure ONE of them**.
|
|
61
|
+
|
|
62
|
+
<br>
|
|
63
|
+
|
|
64
|
+
>Local AI (Ollama)
|
|
65
|
+
>----------------
|
|
66
|
+
>
|
|
67
|
+
>1. Install Ollama:
|
|
68
|
+
> https://ollama.com
|
|
69
|
+
>
|
|
70
|
+
>2. Download a model :
|
|
71
|
+
> ```
|
|
72
|
+
> $> ollama pull llama3
|
|
73
|
+
> ```
|
|
74
|
+
>
|
|
75
|
+
>3. Make sure Ollama is running:
|
|
76
|
+
> ```
|
|
77
|
+
> $> ollama serve
|
|
78
|
+
> ```
|
|
79
|
+
>
|
|
80
|
+
>CommitWise will automatically detect Ollama at :
|
|
81
|
+
> `http://localhost:11434`
|
|
82
|
+
>
|
|
83
|
+
>**No additional configuration is required.**
|
|
84
|
+
|
|
85
|
+
<br>
|
|
86
|
+
|
|
87
|
+
>OpenAI Configuration
|
|
88
|
+
>--------------------
|
|
89
|
+
>
|
|
90
|
+
>- If you prefer using OpenAI instead of local AI, set your `API-KEY` as an environment variable.
|
|
91
|
+
>
|
|
92
|
+
> - Windows :
|
|
93
|
+
> ```
|
|
94
|
+
> $> setx OPENAI_API_KEY "your_api_key_here"
|
|
95
|
+
> ```
|
|
96
|
+
>
|
|
97
|
+
> - Linux / macOS :
|
|
98
|
+
> ```
|
|
99
|
+
> $> export OPENAI_API_KEY="your_api_key_here"
|
|
100
|
+
> ```
|
|
101
|
+
>
|
|
102
|
+
>**CommitWise will automatically use OpenAI when the API key is available.**
|
|
103
|
+
|
|
104
|
+
<br>
|
|
105
|
+
|
|
106
|
+
Usage
|
|
107
|
+
-----
|
|
108
|
+
Generate commit from AI (local or OpenAI):
|
|
109
|
+
```
|
|
110
|
+
$> commitwise --ai
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Generate commit from a text file:
|
|
114
|
+
```
|
|
115
|
+
$> commitwise --file ./my_commit.txt
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Show help:
|
|
119
|
+
```
|
|
120
|
+
$> commitwise --help
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
<br>
|
|
124
|
+
|
|
125
|
+
Professional Note
|
|
126
|
+
-----------------
|
|
127
|
+
CommitWise ensures that AI-generated commit messages are clean and Git-ready,
|
|
128
|
+
without extra explanations, markdown, or educational text.
|
|
129
|
+
This is guaranteed through strict prompting and output cleaning.
|
|
130
|
+
|
|
131
|
+
<br>
|
|
132
|
+
|
|
133
|
+
Links
|
|
134
|
+
-----
|
|
135
|
+
|
|
136
|
+
[GitHub](https://github.com/hasssan-hasssan/commitwise "GitHub repository") |
|
|
137
|
+
[PyPi](https://pypi.org/project/commitwise)
|
|
138
|
+
|
|
139
|
+
<br>
|
|
140
|
+
|
|
141
|
+
Support
|
|
142
|
+
-------
|
|
143
|
+
If CommitWise is helpful, please give it a star on [GitHub](https://github.com/hasssan-hasssan/commitwise "GitHub repository") so others can find it!
|
|
144
|
+
|
|
145
|
+
<br>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
CommitWise
|
|
2
|
+
===========
|
|
3
|
+
CommitWise is a smart and simple tool for generating clean Git commit messages.
|
|
4
|
+
It can create commit messages from a text file or using AI models.
|
|
5
|
+
|
|
6
|
+
**With CommitWise, your commits are always:**
|
|
7
|
+
- **Clean and readable**
|
|
8
|
+
- **Following Git best practices**
|
|
9
|
+
- **Well-structured and informative**
|
|
10
|
+
<br>
|
|
11
|
+
|
|
12
|
+
Features
|
|
13
|
+
--------
|
|
14
|
+
- Generate commits from text files, preserving exact formatting, spacing, and paragraphs
|
|
15
|
+
|
|
16
|
+
- Generate commits using AI (local with Ollama or OpenAI API)
|
|
17
|
+
|
|
18
|
+
- Simple and easy-to-use CLI with only a few flags
|
|
19
|
+
|
|
20
|
+
- Works seamlessly in any Git project
|
|
21
|
+
<br>
|
|
22
|
+
|
|
23
|
+
Requirements
|
|
24
|
+
------------
|
|
25
|
+
- Python >= **`3.9`**
|
|
26
|
+
|
|
27
|
+
- For local AI : **`Ollama`** installed and the desired model downloaded
|
|
28
|
+
|
|
29
|
+
- For online AI : **`OpenAI API Key`** (if using OpenAI)
|
|
30
|
+
<br>
|
|
31
|
+
|
|
32
|
+
Installation
|
|
33
|
+
------------
|
|
34
|
+
```
|
|
35
|
+
$> pip install commitwise
|
|
36
|
+
```
|
|
37
|
+
<br>
|
|
38
|
+
|
|
39
|
+
AI Configuration
|
|
40
|
+
----------------
|
|
41
|
+
CommitWise supports two AI modes:
|
|
42
|
+
- Local AI using Ollama (recommended)
|
|
43
|
+
|
|
44
|
+
- OpenAI API
|
|
45
|
+
|
|
46
|
+
**You only need to configure ONE of them**.
|
|
47
|
+
|
|
48
|
+
<br>
|
|
49
|
+
|
|
50
|
+
>Local AI (Ollama)
|
|
51
|
+
>----------------
|
|
52
|
+
>
|
|
53
|
+
>1. Install Ollama:
|
|
54
|
+
> https://ollama.com
|
|
55
|
+
>
|
|
56
|
+
>2. Download a model :
|
|
57
|
+
> ```
|
|
58
|
+
> $> ollama pull llama3
|
|
59
|
+
> ```
|
|
60
|
+
>
|
|
61
|
+
>3. Make sure Ollama is running:
|
|
62
|
+
> ```
|
|
63
|
+
> $> ollama serve
|
|
64
|
+
> ```
|
|
65
|
+
>
|
|
66
|
+
>CommitWise will automatically detect Ollama at :
|
|
67
|
+
> `http://localhost:11434`
|
|
68
|
+
>
|
|
69
|
+
>**No additional configuration is required.**
|
|
70
|
+
|
|
71
|
+
<br>
|
|
72
|
+
|
|
73
|
+
>OpenAI Configuration
|
|
74
|
+
>--------------------
|
|
75
|
+
>
|
|
76
|
+
>- If you prefer using OpenAI instead of local AI, set your `API-KEY` as an environment variable.
|
|
77
|
+
>
|
|
78
|
+
> - Windows :
|
|
79
|
+
> ```
|
|
80
|
+
> $> setx OPENAI_API_KEY "your_api_key_here"
|
|
81
|
+
> ```
|
|
82
|
+
>
|
|
83
|
+
> - Linux / macOS :
|
|
84
|
+
> ```
|
|
85
|
+
> $> export OPENAI_API_KEY="your_api_key_here"
|
|
86
|
+
> ```
|
|
87
|
+
>
|
|
88
|
+
>**CommitWise will automatically use OpenAI when the API key is available.**
|
|
89
|
+
|
|
90
|
+
<br>
|
|
91
|
+
|
|
92
|
+
Usage
|
|
93
|
+
-----
|
|
94
|
+
Generate commit from AI (local or OpenAI):
|
|
95
|
+
```
|
|
96
|
+
$> commitwise --ai
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Generate commit from a text file:
|
|
100
|
+
```
|
|
101
|
+
$> commitwise --file ./my_commit.txt
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Show help:
|
|
105
|
+
```
|
|
106
|
+
$> commitwise --help
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
<br>
|
|
110
|
+
|
|
111
|
+
Professional Note
|
|
112
|
+
-----------------
|
|
113
|
+
CommitWise ensures that AI-generated commit messages are clean and Git-ready,
|
|
114
|
+
without extra explanations, markdown, or educational text.
|
|
115
|
+
This is guaranteed through strict prompting and output cleaning.
|
|
116
|
+
|
|
117
|
+
<br>
|
|
118
|
+
|
|
119
|
+
Links
|
|
120
|
+
-----
|
|
121
|
+
|
|
122
|
+
[GitHub](https://github.com/hasssan-hasssan/commitwise "GitHub repository") |
|
|
123
|
+
[PyPi](https://pypi.org/project/commitwise)
|
|
124
|
+
|
|
125
|
+
<br>
|
|
126
|
+
|
|
127
|
+
Support
|
|
128
|
+
-------
|
|
129
|
+
If CommitWise is helpful, please give it a star on [GitHub](https://github.com/hasssan-hasssan/commitwise "GitHub repository") so others can find it!
|
|
130
|
+
|
|
131
|
+
<br>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__='0.1.3'
|
|
@@ -1,47 +1,27 @@
|
|
|
1
|
-
import argparse
|
|
2
1
|
import sys
|
|
3
2
|
|
|
3
|
+
from commitwise import __version__
|
|
4
|
+
from commitwise.cli_utils import (
|
|
5
|
+
build_parser,
|
|
6
|
+
)
|
|
4
7
|
from commitwise.git_utils import (
|
|
5
8
|
get_staged_diff,
|
|
6
9
|
git_commit_with_message,
|
|
10
|
+
confirm_commit,
|
|
7
11
|
)
|
|
8
12
|
from commitwise.file_source import read_commit_file
|
|
9
13
|
from commitwise.ai_source import generate_ai_commit_message
|
|
10
14
|
|
|
11
15
|
|
|
12
|
-
def build_parser() -> argparse.ArgumentParser:
|
|
13
|
-
parser = argparse.ArgumentParser(
|
|
14
|
-
prog="commitwise",
|
|
15
|
-
description="CommitWise - Smart Git commits, wisely.",
|
|
16
|
-
formatter_class=argparse.RawTextHelpFormatter,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
parser.add_argument(
|
|
20
|
-
"--ai",
|
|
21
|
-
action="store_true",
|
|
22
|
-
help=(
|
|
23
|
-
"Generate commit message using AI.\n"
|
|
24
|
-
"Automatically uses OpenAI if OPENAI_APP_KEY is set,\n"
|
|
25
|
-
"otherwise falls back to a local model (Ollama)."
|
|
26
|
-
),
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
parser.add_argument(
|
|
30
|
-
"--file",
|
|
31
|
-
metavar="PATH",
|
|
32
|
-
help=(
|
|
33
|
-
"Read commit message from a text file and commit it\n"
|
|
34
|
-
"exactly as written (preserves formatting)."
|
|
35
|
-
),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
return parser
|
|
39
|
-
|
|
40
|
-
|
|
41
16
|
def main() -> None:
|
|
42
17
|
parser = build_parser()
|
|
43
18
|
args = parser.parse_args()
|
|
44
19
|
|
|
20
|
+
# version flag
|
|
21
|
+
if args.version:
|
|
22
|
+
print(f"commitwise {__version__}")
|
|
23
|
+
sys.exit(0)
|
|
24
|
+
|
|
45
25
|
# [X] both flags used
|
|
46
26
|
if args.ai and args.file:
|
|
47
27
|
parser.error("Use either --ai or --file, not both.")
|
|
@@ -56,6 +36,11 @@ def main() -> None:
|
|
|
56
36
|
if args.ai:
|
|
57
37
|
diff = get_staged_diff()
|
|
58
38
|
message = generate_ai_commit_message(diff)
|
|
39
|
+
|
|
40
|
+
if not confirm_commit(message):
|
|
41
|
+
print("\n\nCommit aborted.")
|
|
42
|
+
sys.exit(0)
|
|
43
|
+
|
|
59
44
|
git_commit_with_message(message)
|
|
60
45
|
return
|
|
61
46
|
|
|
@@ -64,6 +49,7 @@ def main() -> None:
|
|
|
64
49
|
message = read_commit_file(args.file)
|
|
65
50
|
git_commit_with_message(message)
|
|
66
51
|
return
|
|
52
|
+
|
|
67
53
|
except Exception as e:
|
|
68
54
|
print(f"\n [X] Error: {e}", file=sys.stderr)
|
|
69
55
|
sys.exit(1)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
7
|
+
"""
|
|
8
|
+
Defines and return all command-line flags for the CommitWise CLI.
|
|
9
|
+
|
|
10
|
+
Flags:
|
|
11
|
+
--version, -V
|
|
12
|
+
Display the currently installed commitwise version.
|
|
13
|
+
|
|
14
|
+
--ai
|
|
15
|
+
Generate a commit message using AI.
|
|
16
|
+
|
|
17
|
+
--file PATH
|
|
18
|
+
Read a commit message from a text file and commit it
|
|
19
|
+
exactly as written, preserving formatting.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
argparser.ArgumentParser: Configured parser with all CLI flags.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
parser = argparse.ArgumentParser(
|
|
26
|
+
prog="commitwise",
|
|
27
|
+
description="CommitWise - Smart Git commits, wisely.",
|
|
28
|
+
formatter_class=argparse.RawTextHelpFormatter,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
"--version",
|
|
33
|
+
"-V",
|
|
34
|
+
action="store_true",
|
|
35
|
+
help="Display the version of commitwise that is currently installed.",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
parser.add_argument(
|
|
39
|
+
"--ai",
|
|
40
|
+
action="store_true",
|
|
41
|
+
help=(
|
|
42
|
+
"Generate commit message using AI.\n"
|
|
43
|
+
"Automatically uses OpenAI if OPENAI_APP_KEY is set,\n"
|
|
44
|
+
"otherwise falls back to a local model (Ollama)."
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
parser.add_argument(
|
|
49
|
+
"--file",
|
|
50
|
+
metavar="PATH",
|
|
51
|
+
help=(
|
|
52
|
+
"Read commit message from a text file and commit it\n"
|
|
53
|
+
"exactly as written (preserves formatting)."
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
return parser
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def read_single_key() -> str:
|
|
61
|
+
"""
|
|
62
|
+
Reads a single keypress from the user without requiring Enter.
|
|
63
|
+
|
|
64
|
+
Works cross-platform:
|
|
65
|
+
- Windows: uses msvcrt.getch()
|
|
66
|
+
- Linux/macOS: uses termios and tty to set raw input mode.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
str: The pressed key as a lowercase string.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
if os.name == "nt":
|
|
73
|
+
import msvcrt
|
|
74
|
+
|
|
75
|
+
return msvcrt.getch().decode("utf-8", errors="ignore").lower()
|
|
76
|
+
else:
|
|
77
|
+
import termios
|
|
78
|
+
import tty
|
|
79
|
+
|
|
80
|
+
fd = sys.stdin.fileno()
|
|
81
|
+
old_settings = termios.tcgetattr(fd)
|
|
82
|
+
try:
|
|
83
|
+
tty.setraw(fd)
|
|
84
|
+
ch = sys.stdin.read(1).lower()
|
|
85
|
+
finally:
|
|
86
|
+
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
|
87
|
+
return ch
|
|
@@ -2,6 +2,8 @@ import subprocess
|
|
|
2
2
|
import tempfile
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
+
from commitwise.cli_utils import read_single_key
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
def get_staged_diff() -> str:
|
|
7
9
|
"""
|
|
@@ -41,7 +43,38 @@ def git_commit_with_message(message: str) -> None:
|
|
|
41
43
|
tmp.write(message.rstrip() + "\n")
|
|
42
44
|
temp_file_path = tmp.name
|
|
43
45
|
|
|
44
|
-
subprocess.run(["git", "commit", "-F", temp_file_path], check=True)
|
|
46
|
+
# subprocess.run(["git", "commit", "-F", temp_file_path], check=True)
|
|
47
|
+
result = subprocess.run(
|
|
48
|
+
["git", "commit", "-F", temp_file_path],
|
|
49
|
+
capture_output=True,
|
|
50
|
+
text=True,
|
|
51
|
+
).stdout.strip()
|
|
52
|
+
|
|
53
|
+
output_message = (
|
|
54
|
+
f"\n\n[✔] Commit created successfully. More details:\n\n{result}"
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
print(output_message)
|
|
58
|
+
|
|
45
59
|
finally:
|
|
46
60
|
if temp_file_path and os.path.exists(temp_file_path):
|
|
47
61
|
os.remove(temp_file_path)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def confirm_commit(message: str) -> bool:
|
|
65
|
+
"""
|
|
66
|
+
Confirm the suggested commit message.
|
|
67
|
+
"""
|
|
68
|
+
print("\nProposed commit message:\n")
|
|
69
|
+
print("-" * 40)
|
|
70
|
+
print(message.strip())
|
|
71
|
+
print("-" * 40)
|
|
72
|
+
print("\nCommit this message? [y/n] ", end="", flush=True)
|
|
73
|
+
|
|
74
|
+
while True:
|
|
75
|
+
key = read_single_key()
|
|
76
|
+
if key == "y":
|
|
77
|
+
return True
|
|
78
|
+
|
|
79
|
+
if key == "n":
|
|
80
|
+
return False
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: commitwise
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Generate clean git commit messages from files or AI
|
|
5
|
+
Author-email: Abolfazl Hassan Zade <abolfazl.hassanzade.81@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: homepage, https://github.com/hasssan-hasssan/commitwise
|
|
8
|
+
Project-URL: repository, https://github.com/hasssan-hasssan/commitwise
|
|
9
|
+
Project-URL: issues, https://github.com/hasssan-hasssan/commitwise/issues
|
|
10
|
+
Keywords: git,commit,cli,ai
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests>=2.31.0
|
|
14
|
+
|
|
15
|
+
CommitWise
|
|
16
|
+
===========
|
|
17
|
+
CommitWise is a smart and simple tool for generating clean Git commit messages.
|
|
18
|
+
It can create commit messages from a text file or using AI models.
|
|
19
|
+
|
|
20
|
+
**With CommitWise, your commits are always:**
|
|
21
|
+
- **Clean and readable**
|
|
22
|
+
- **Following Git best practices**
|
|
23
|
+
- **Well-structured and informative**
|
|
24
|
+
<br>
|
|
25
|
+
|
|
26
|
+
Features
|
|
27
|
+
--------
|
|
28
|
+
- Generate commits from text files, preserving exact formatting, spacing, and paragraphs
|
|
29
|
+
|
|
30
|
+
- Generate commits using AI (local with Ollama or OpenAI API)
|
|
31
|
+
|
|
32
|
+
- Simple and easy-to-use CLI with only a few flags
|
|
33
|
+
|
|
34
|
+
- Works seamlessly in any Git project
|
|
35
|
+
<br>
|
|
36
|
+
|
|
37
|
+
Requirements
|
|
38
|
+
------------
|
|
39
|
+
- Python >= **`3.9`**
|
|
40
|
+
|
|
41
|
+
- For local AI : **`Ollama`** installed and the desired model downloaded
|
|
42
|
+
|
|
43
|
+
- For online AI : **`OpenAI API Key`** (if using OpenAI)
|
|
44
|
+
<br>
|
|
45
|
+
|
|
46
|
+
Installation
|
|
47
|
+
------------
|
|
48
|
+
```
|
|
49
|
+
$> pip install commitwise
|
|
50
|
+
```
|
|
51
|
+
<br>
|
|
52
|
+
|
|
53
|
+
AI Configuration
|
|
54
|
+
----------------
|
|
55
|
+
CommitWise supports two AI modes:
|
|
56
|
+
- Local AI using Ollama (recommended)
|
|
57
|
+
|
|
58
|
+
- OpenAI API
|
|
59
|
+
|
|
60
|
+
**You only need to configure ONE of them**.
|
|
61
|
+
|
|
62
|
+
<br>
|
|
63
|
+
|
|
64
|
+
>Local AI (Ollama)
|
|
65
|
+
>----------------
|
|
66
|
+
>
|
|
67
|
+
>1. Install Ollama:
|
|
68
|
+
> https://ollama.com
|
|
69
|
+
>
|
|
70
|
+
>2. Download a model :
|
|
71
|
+
> ```
|
|
72
|
+
> $> ollama pull llama3
|
|
73
|
+
> ```
|
|
74
|
+
>
|
|
75
|
+
>3. Make sure Ollama is running:
|
|
76
|
+
> ```
|
|
77
|
+
> $> ollama serve
|
|
78
|
+
> ```
|
|
79
|
+
>
|
|
80
|
+
>CommitWise will automatically detect Ollama at :
|
|
81
|
+
> `http://localhost:11434`
|
|
82
|
+
>
|
|
83
|
+
>**No additional configuration is required.**
|
|
84
|
+
|
|
85
|
+
<br>
|
|
86
|
+
|
|
87
|
+
>OpenAI Configuration
|
|
88
|
+
>--------------------
|
|
89
|
+
>
|
|
90
|
+
>- If you prefer using OpenAI instead of local AI, set your `API-KEY` as an environment variable.
|
|
91
|
+
>
|
|
92
|
+
> - Windows :
|
|
93
|
+
> ```
|
|
94
|
+
> $> setx OPENAI_API_KEY "your_api_key_here"
|
|
95
|
+
> ```
|
|
96
|
+
>
|
|
97
|
+
> - Linux / macOS :
|
|
98
|
+
> ```
|
|
99
|
+
> $> export OPENAI_API_KEY="your_api_key_here"
|
|
100
|
+
> ```
|
|
101
|
+
>
|
|
102
|
+
>**CommitWise will automatically use OpenAI when the API key is available.**
|
|
103
|
+
|
|
104
|
+
<br>
|
|
105
|
+
|
|
106
|
+
Usage
|
|
107
|
+
-----
|
|
108
|
+
Generate commit from AI (local or OpenAI):
|
|
109
|
+
```
|
|
110
|
+
$> commitwise --ai
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Generate commit from a text file:
|
|
114
|
+
```
|
|
115
|
+
$> commitwise --file ./my_commit.txt
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Show help:
|
|
119
|
+
```
|
|
120
|
+
$> commitwise --help
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
<br>
|
|
124
|
+
|
|
125
|
+
Professional Note
|
|
126
|
+
-----------------
|
|
127
|
+
CommitWise ensures that AI-generated commit messages are clean and Git-ready,
|
|
128
|
+
without extra explanations, markdown, or educational text.
|
|
129
|
+
This is guaranteed through strict prompting and output cleaning.
|
|
130
|
+
|
|
131
|
+
<br>
|
|
132
|
+
|
|
133
|
+
Links
|
|
134
|
+
-----
|
|
135
|
+
|
|
136
|
+
[GitHub](https://github.com/hasssan-hasssan/commitwise "GitHub repository") |
|
|
137
|
+
[PyPi](https://pypi.org/project/commitwise)
|
|
138
|
+
|
|
139
|
+
<br>
|
|
140
|
+
|
|
141
|
+
Support
|
|
142
|
+
-------
|
|
143
|
+
If CommitWise is helpful, please give it a star on [GitHub](https://github.com/hasssan-hasssan/commitwise "GitHub repository") so others can find it!
|
|
144
|
+
|
|
145
|
+
<br>
|
commitwise-0.1.1/PKG-INFO
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: commitwise
|
|
3
|
-
Version: 0.1.1
|
|
4
|
-
Summary: Generate clean git commit messages from files or AI
|
|
5
|
-
Author-email: Abolfazl Hassan Zade <abolfazl.hassanzade.81@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: homepage, https://github.com/hasssan-hasssan/commitwise
|
|
8
|
-
Project-URL: repository, https://github.com/hasssan-hasssan/commitwise
|
|
9
|
-
Project-URL: issues, https://github.com/hasssan-hasssan/commitwise/issues
|
|
10
|
-
Keywords: git,commit,cli,ai
|
|
11
|
-
Requires-Python: >=3.9
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: requests>=2.31.0
|
|
14
|
-
|
|
15
|
-
CommitWise
|
|
16
|
-
===========
|
|
17
|
-
|
|
18
|
-
CommitWise is a smart and simple tool for generating clean Git commit messages.
|
|
19
|
-
It can create commit messages from a text file or using AI models.
|
|
20
|
-
|
|
21
|
-
With CommitWise, your commits are always:
|
|
22
|
-
- Clean and readable
|
|
23
|
-
- Following Git best practices
|
|
24
|
-
- Well-structured and informative
|
|
25
|
-
|
|
26
|
-
Features
|
|
27
|
-
--------
|
|
28
|
-
|
|
29
|
-
- Generate commits from text files, preserving exact formatting, spacing, and paragraphs
|
|
30
|
-
- Generate commits using AI (local with Ollama or OpenAI API)
|
|
31
|
-
- Simple and easy-to-use CLI with only a few flags
|
|
32
|
-
- Works seamlessly in any Git project
|
|
33
|
-
|
|
34
|
-
Installation
|
|
35
|
-
------------
|
|
36
|
-
|
|
37
|
-
pip install commitwise
|
|
38
|
-
|
|
39
|
-
Usage
|
|
40
|
-
-----
|
|
41
|
-
|
|
42
|
-
Generate commit from AI (local or OpenAI):
|
|
43
|
-
commitwise --ai
|
|
44
|
-
|
|
45
|
-
Generate commit from a text file:
|
|
46
|
-
commitwise --file ./my_commit.txt
|
|
47
|
-
|
|
48
|
-
Show help:
|
|
49
|
-
commitwise --help
|
|
50
|
-
|
|
51
|
-
Requirements
|
|
52
|
-
------------
|
|
53
|
-
|
|
54
|
-
- Python >= 3.9
|
|
55
|
-
- For local AI: Ollama installed and the desired model downloaded
|
|
56
|
-
- For online AI: OpenAI API Key (if using OpenAI)
|
|
57
|
-
|
|
58
|
-
Professional Note
|
|
59
|
-
-----------------
|
|
60
|
-
|
|
61
|
-
CommitWise ensures that AI-generated commit messages are clean and Git-ready,
|
|
62
|
-
without extra explanations, markdown, or educational text.
|
|
63
|
-
This is guaranteed through strict prompting and output cleaning.
|
|
64
|
-
|
|
65
|
-
Links
|
|
66
|
-
-----
|
|
67
|
-
|
|
68
|
-
GitHub Repository: https://github.com/hasssan-hasssan/commitwise
|
|
69
|
-
|
|
70
|
-
PyPI: https://pypi.org/project/commitwise
|
|
71
|
-
|
|
72
|
-
Support
|
|
73
|
-
-------
|
|
74
|
-
|
|
75
|
-
If CommitWise is helpful, please give it a star on GitHub so others can find it!
|
|
76
|
-
|
|
77
|
-
GitHub About Section
|
|
78
|
-
-------------------
|
|
79
|
-
|
|
80
|
-
CommitWise: Generate clean Git commit messages from files or AI.
|
|
81
|
-
|
|
82
|
-
Supports local AI (Ollama) or OpenAI API for automatic commit generation.
|
|
83
|
-
|
|
84
|
-
Simple CLI with --ai and --file modes.
|
|
85
|
-
|
commitwise-0.1.1/README.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
CommitWise
|
|
2
|
-
===========
|
|
3
|
-
|
|
4
|
-
CommitWise is a smart and simple tool for generating clean Git commit messages.
|
|
5
|
-
It can create commit messages from a text file or using AI models.
|
|
6
|
-
|
|
7
|
-
With CommitWise, your commits are always:
|
|
8
|
-
- Clean and readable
|
|
9
|
-
- Following Git best practices
|
|
10
|
-
- Well-structured and informative
|
|
11
|
-
|
|
12
|
-
Features
|
|
13
|
-
--------
|
|
14
|
-
|
|
15
|
-
- Generate commits from text files, preserving exact formatting, spacing, and paragraphs
|
|
16
|
-
- Generate commits using AI (local with Ollama or OpenAI API)
|
|
17
|
-
- Simple and easy-to-use CLI with only a few flags
|
|
18
|
-
- Works seamlessly in any Git project
|
|
19
|
-
|
|
20
|
-
Installation
|
|
21
|
-
------------
|
|
22
|
-
|
|
23
|
-
pip install commitwise
|
|
24
|
-
|
|
25
|
-
Usage
|
|
26
|
-
-----
|
|
27
|
-
|
|
28
|
-
Generate commit from AI (local or OpenAI):
|
|
29
|
-
commitwise --ai
|
|
30
|
-
|
|
31
|
-
Generate commit from a text file:
|
|
32
|
-
commitwise --file ./my_commit.txt
|
|
33
|
-
|
|
34
|
-
Show help:
|
|
35
|
-
commitwise --help
|
|
36
|
-
|
|
37
|
-
Requirements
|
|
38
|
-
------------
|
|
39
|
-
|
|
40
|
-
- Python >= 3.9
|
|
41
|
-
- For local AI: Ollama installed and the desired model downloaded
|
|
42
|
-
- For online AI: OpenAI API Key (if using OpenAI)
|
|
43
|
-
|
|
44
|
-
Professional Note
|
|
45
|
-
-----------------
|
|
46
|
-
|
|
47
|
-
CommitWise ensures that AI-generated commit messages are clean and Git-ready,
|
|
48
|
-
without extra explanations, markdown, or educational text.
|
|
49
|
-
This is guaranteed through strict prompting and output cleaning.
|
|
50
|
-
|
|
51
|
-
Links
|
|
52
|
-
-----
|
|
53
|
-
|
|
54
|
-
GitHub Repository: https://github.com/hasssan-hasssan/commitwise
|
|
55
|
-
|
|
56
|
-
PyPI: https://pypi.org/project/commitwise
|
|
57
|
-
|
|
58
|
-
Support
|
|
59
|
-
-------
|
|
60
|
-
|
|
61
|
-
If CommitWise is helpful, please give it a star on GitHub so others can find it!
|
|
62
|
-
|
|
63
|
-
GitHub About Section
|
|
64
|
-
-------------------
|
|
65
|
-
|
|
66
|
-
CommitWise: Generate clean Git commit messages from files or AI.
|
|
67
|
-
|
|
68
|
-
Supports local AI (Ollama) or OpenAI API for automatic commit generation.
|
|
69
|
-
|
|
70
|
-
Simple CLI with --ai and --file modes.
|
|
71
|
-
|
|
File without changes
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: commitwise
|
|
3
|
-
Version: 0.1.1
|
|
4
|
-
Summary: Generate clean git commit messages from files or AI
|
|
5
|
-
Author-email: Abolfazl Hassan Zade <abolfazl.hassanzade.81@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: homepage, https://github.com/hasssan-hasssan/commitwise
|
|
8
|
-
Project-URL: repository, https://github.com/hasssan-hasssan/commitwise
|
|
9
|
-
Project-URL: issues, https://github.com/hasssan-hasssan/commitwise/issues
|
|
10
|
-
Keywords: git,commit,cli,ai
|
|
11
|
-
Requires-Python: >=3.9
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: requests>=2.31.0
|
|
14
|
-
|
|
15
|
-
CommitWise
|
|
16
|
-
===========
|
|
17
|
-
|
|
18
|
-
CommitWise is a smart and simple tool for generating clean Git commit messages.
|
|
19
|
-
It can create commit messages from a text file or using AI models.
|
|
20
|
-
|
|
21
|
-
With CommitWise, your commits are always:
|
|
22
|
-
- Clean and readable
|
|
23
|
-
- Following Git best practices
|
|
24
|
-
- Well-structured and informative
|
|
25
|
-
|
|
26
|
-
Features
|
|
27
|
-
--------
|
|
28
|
-
|
|
29
|
-
- Generate commits from text files, preserving exact formatting, spacing, and paragraphs
|
|
30
|
-
- Generate commits using AI (local with Ollama or OpenAI API)
|
|
31
|
-
- Simple and easy-to-use CLI with only a few flags
|
|
32
|
-
- Works seamlessly in any Git project
|
|
33
|
-
|
|
34
|
-
Installation
|
|
35
|
-
------------
|
|
36
|
-
|
|
37
|
-
pip install commitwise
|
|
38
|
-
|
|
39
|
-
Usage
|
|
40
|
-
-----
|
|
41
|
-
|
|
42
|
-
Generate commit from AI (local or OpenAI):
|
|
43
|
-
commitwise --ai
|
|
44
|
-
|
|
45
|
-
Generate commit from a text file:
|
|
46
|
-
commitwise --file ./my_commit.txt
|
|
47
|
-
|
|
48
|
-
Show help:
|
|
49
|
-
commitwise --help
|
|
50
|
-
|
|
51
|
-
Requirements
|
|
52
|
-
------------
|
|
53
|
-
|
|
54
|
-
- Python >= 3.9
|
|
55
|
-
- For local AI: Ollama installed and the desired model downloaded
|
|
56
|
-
- For online AI: OpenAI API Key (if using OpenAI)
|
|
57
|
-
|
|
58
|
-
Professional Note
|
|
59
|
-
-----------------
|
|
60
|
-
|
|
61
|
-
CommitWise ensures that AI-generated commit messages are clean and Git-ready,
|
|
62
|
-
without extra explanations, markdown, or educational text.
|
|
63
|
-
This is guaranteed through strict prompting and output cleaning.
|
|
64
|
-
|
|
65
|
-
Links
|
|
66
|
-
-----
|
|
67
|
-
|
|
68
|
-
GitHub Repository: https://github.com/hasssan-hasssan/commitwise
|
|
69
|
-
|
|
70
|
-
PyPI: https://pypi.org/project/commitwise
|
|
71
|
-
|
|
72
|
-
Support
|
|
73
|
-
-------
|
|
74
|
-
|
|
75
|
-
If CommitWise is helpful, please give it a star on GitHub so others can find it!
|
|
76
|
-
|
|
77
|
-
GitHub About Section
|
|
78
|
-
-------------------
|
|
79
|
-
|
|
80
|
-
CommitWise: Generate clean Git commit messages from files or AI.
|
|
81
|
-
|
|
82
|
-
Supports local AI (Ollama) or OpenAI API for automatic commit generation.
|
|
83
|
-
|
|
84
|
-
Simple CLI with --ai and --file modes.
|
|
85
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|