Skip to content

Commit ca4bdc7

Browse files
committed
chore: finalize restructure and prep for PyPI packaging
1 parent 48c0986 commit ca4bdc7

File tree

12 files changed

+69
-15
lines changed

12 files changed

+69
-15
lines changed

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include LICENSE
2+
include README.md
3+
exclude .env
4+
recursive-exclude tests *

README.md

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Commit Companion
22

3+
[![PyPI version](https://badge.fury.io/py/commit-companion.svg)](https://badge.fury.io/py/commit-companion)
4+
35
**AI-powered Git commit assistant that summarizes staged changes using GPT.**
46
Save time, stay in flow, and write better commit messages — automatically.
57

@@ -18,37 +20,66 @@ Save time, stay in flow, and write better commit messages — automatically.
1820

1921
## Quick Start
2022

21-
### 1. Clone the repo and install dependencies:
23+
### 1. Install via pip (recommended):
24+
25+
```bash
26+
pip install commit-companion
27+
```
28+
29+
Or, to install from source:
2230

2331
```bash
2432
git clone https://github.com/nelson-zack/commit-companion.git
2533
cd commit-companion
26-
python3 -m venv venv
27-
source venv/bin/activate
28-
pip install -r requirements.txt
34+
pip install .
2935
```
3036

31-
### 2. Add your OpenAI key to .env:
32-
```bash
37+
### 2. Add your OpenAI API key:
38+
39+
Commit Companion requires access to the OpenAI API. You can provide your key in one of two ways:
40+
41+
#### Option 1: `.env` file (for local use)
42+
43+
```bash
3344
OPENAI_API_KEY=sk-...
3445
```
3546

47+
#### Option 2: Environment variable (for global use)
48+
49+
Add to your shell config (`~/.zshrc`, `~/.bashrc`, etc):
50+
51+
```bash
52+
export OPENAI_API_KEY="sk-..."
53+
```
54+
55+
Then run:
56+
57+
```bash
58+
source ~/.zshrc # or ~/.bashrc
59+
```
60+
3661
### 3. Install CLI tool locally:
62+
3763
```bash
3864
pip install --editable .
3965
```
4066

4167
## Usage
4268

4369
### CLI (manual):
70+
4471
```bash
4572
commit-companion suggest --tone casual --type feat
4673
```
74+
4775
Will output something like:
76+
4877
```bash
4978
feat: add basic functionality to README.md
5079
```
80+
5181
Example usage:
82+
5283
```bash
5384
git add <file>
5485
commit-companion suggest --tone casual --type feat
@@ -57,10 +88,13 @@ git push
5788
```
5889

5990
### Git Hook (auto):
91+
6092
Install the Git hook with:
93+
6194
```bash
6295
commit-companion install-hook
6396
```
97+
6498
This creates a .git/hooks/prepare-commit-msg script that auto-generates commit messages using GPT.
6599
By default, it uses --tone neutral and --type feat.
66100

@@ -75,54 +109,64 @@ git push # Push to remote
75109
#### Customize per commit:
76110

77111
Override tone or type like this:
112+
78113
```bash
79114
TYPE=fix git commit
80115
TONE=funny git commit
81116
TYPE=fix TONE=funny git commit
82117
```
83118

84119
Uninstall the hook:
120+
85121
```bash
86122
commit-companion uninstall-hook
87123
```
88124

89125
### Optional: Global Installation
90126

91127
To use commit-companion from any repo without activating a virtual environment:
128+
92129
#### 1. Install globally:
130+
93131
```bash
94132
pip install .
95133
```
96134

97-
#### 2. Add your OpenAI key to your shell config (~/.zshrc or ~/.bashrc):
135+
#### 2. Add your OpenAI key to your shell config (~/.zshrc or ~/.bashrc):
136+
98137
```bash
99138
export OPENAI_API_KEY="sk-..."
100139
```
101140

102-
#### 3. Ensure your Python bin path is on your system PATH:
141+
#### 3. Ensure your Python bin path is on your system PATH:
142+
103143
```bash
104144
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.12/bin"
105145
```
106146

107-
#### 4. Reload your shell:
147+
#### 4. Reload your shell:
148+
108149
```bash
109150
source ~/.zshrc # or ~/.bashrc
110151
```
111152

112-
#### 5. Use it anywhere:
153+
#### 5. Use it anywhere:
154+
113155
```bash
114156
commit-companion install-hook
115157
```
116158

117-
118159
## Roadmap Ideas
160+
119161
- Config file support (.commitcompanion.json)
120162
- VS Code extension
121163
- Web version / hosted API
122-
- PyPI distribution (pip install commit-companion)
164+
- PyPI distribution (available via `pip install commit-companion`)
123165

124166
## Why Use This?
167+
125168
Writing commit messages breaks flow. Commit Companion helps you:
169+
126170
- Stay focused on your code
127171
- Standardize commits with no effort
128172
- Impress your teammates with clear, consistent commit messages

commit_companion/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
from setuptools import setup
1+
from setuptools import setup, find_packages
22

33
setup(
44
name='commit-companion',
55
version='1.0.0',
6-
py_modules=['cli', 'main', 'git_utils', 'ai_utils', 'utils'],
6+
packages=find_packages(),
77
install_requires=[
88
'click',
99
'openai',
1010
'python-dotenv',
1111
],
1212
entry_points={
1313
'console_scripts': [
14-
'commit-companion=cli:cli',
14+
'commit-companion=commit_companion.cli:cli',
1515
],
1616
},
17+
author='Zack Nelson',
18+
description='Generate AI-powered Git commit messages from diffs.',
19+
long_description=open("README.md").read(),
20+
long_description_content_type='text/markdown',
21+
license='MIT',
22+
python_requires='>=3.7',
1723
)
File renamed without changes.

0 commit comments

Comments
 (0)