commitwise 0.1.1__py3-none-any.whl → 0.1.2__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.
commitwise/__init__.py CHANGED
@@ -0,0 +1 @@
1
+ __version__='0.1.2'
commitwise/cli.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import argparse
2
2
  import sys
3
3
 
4
+ from commitwise import __version__
4
5
  from commitwise.git_utils import (
5
6
  get_staged_diff,
6
7
  git_commit_with_message,
@@ -16,6 +17,13 @@ def build_parser() -> argparse.ArgumentParser:
16
17
  formatter_class=argparse.RawTextHelpFormatter,
17
18
  )
18
19
 
20
+ parser.add_argument(
21
+ "--version",
22
+ "-V",
23
+ action="store_true",
24
+ help="Display the version of commitwise that is currently installed.",
25
+ )
26
+
19
27
  parser.add_argument(
20
28
  "--ai",
21
29
  action="store_true",
@@ -42,6 +50,11 @@ def main() -> None:
42
50
  parser = build_parser()
43
51
  args = parser.parse_args()
44
52
 
53
+ # version flag
54
+ if args.version:
55
+ print(f'commitwise {__version__}')
56
+ sys.exit(0)
57
+
45
58
  # [X] both flags used
46
59
  if args.ai and args.file:
47
60
  parser.error("Use either --ai or --file, not both.")
@@ -64,6 +77,7 @@ def main() -> None:
64
77
  message = read_commit_file(args.file)
65
78
  git_commit_with_message(message)
66
79
  return
80
+
67
81
  except Exception as e:
68
82
  print(f"\n [X] Error: {e}", file=sys.stderr)
69
83
  sys.exit(1)
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: commitwise
3
+ Version: 0.1.2
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>
@@ -1,6 +1,6 @@
1
- commitwise/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1
+ commitwise/__init__.py,sha256=TcY9FEyFk-vmx4BWSp36IEQGCPwRW-VryUOXnueNUgo,19
2
2
  commitwise/ai_source.py,sha256=BD79fQQb654AaKmHH2_JzVidzwUEHd55ny5aO0e5vtU,1417
3
- commitwise/cli.py,sha256=BqHfbTrXBcyClCWloFxGeiJn5cYgSzlTqXxG1cCUpJQ,1878
3
+ commitwise/cli.py,sha256=yX4dv4PjrnAFl58vICq7Aljmd850ToMrYT-8olGCx88,2215
4
4
  commitwise/config.py,sha256=Jovf7YfV0N8CFz2jBns_UBAgfuO8un8fivezNFGSbYc,253
5
5
  commitwise/file_source.py,sha256=3pzFAsFYyXQSLQrfr_YGA5GAV-vtUP5Co4YhG-XOhnc,751
6
6
  commitwise/git_utils.py,sha256=ylqrKvsMratrHZS74cQy4xqAI6HJjJhJ_nU9amqWoUo,1289
@@ -8,8 +8,8 @@ commitwise/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  commitwise/ai/base.py,sha256=v7DoQLPOeYmOfVXtvMtDWVS7DBMOGQylDv_dvScXkBk,929
9
9
  commitwise/ai/local_engine.py,sha256=YwiusAokL_t0PiJ53gf8IAJGynHrEYAv0Cyy_QpdnpM,1007
10
10
  commitwise/ai/openai_engine.py,sha256=8_xErkmsjzXyNwlPVgrlwxumt2y5ZhhWYo1I9nUKpqE,1006
11
- commitwise-0.1.1.dist-info/METADATA,sha256=iyeWtu9JVRbRTigRNkV6h6ScADsUSrJPETZjOYCLbro,2249
12
- commitwise-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- commitwise-0.1.1.dist-info/entry_points.txt,sha256=WUow9mgob_PQfVpk5QuVpoWXYnALsOar3NCyDWJCQuk,51
14
- commitwise-0.1.1.dist-info/top_level.txt,sha256=8uL7do0ZoZw67O5fzMSxbqQcJkMH3OHeHhONQuS3D88,11
15
- commitwise-0.1.1.dist-info/RECORD,,
11
+ commitwise-0.1.2.dist-info/METADATA,sha256=sjvRgOA8IMMOegPTFDdFReZC1GYRBb5iM3riv1TmtX4,3249
12
+ commitwise-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ commitwise-0.1.2.dist-info/entry_points.txt,sha256=WUow9mgob_PQfVpk5QuVpoWXYnALsOar3NCyDWJCQuk,51
14
+ commitwise-0.1.2.dist-info/top_level.txt,sha256=8uL7do0ZoZw67O5fzMSxbqQcJkMH3OHeHhONQuS3D88,11
15
+ commitwise-0.1.2.dist-info/RECORD,,
@@ -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
-