Skip to content

Commit a547f43

Browse files
committed
docs(readme): rewrite documentation to reflect behavior, safety, and licensing
1 parent ac57ca8 commit a547f43

File tree

3 files changed

+113
-85
lines changed

3 files changed

+113
-85
lines changed

LICENSE

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,39 @@
1-
MIT License
2-
3-
Copyright (c) 2025 @ikramagix
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the “Software”), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21-
IN THE SOFTWARE.
1+
DUAL LICENSE AGREEMENT
2+
3+
This software is protected by copyright and is available under two distinct licensing models.
4+
Your rights to use, copy, modify, and distribute the software depend on your status as a user.
5+
6+
1. FOR INDIVIDUALS (PERSONAL USE)
7+
---------------------------------
8+
If you are an individual using this software for personal, non-commercial, or open-source projects,
9+
you are granted permission to use this software under the terms of the MIT License:
10+
11+
MIT License
12+
Copyright (c) 2025 @ikramagix
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in all
22+
copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
SOFTWARE.
31+
32+
33+
2. FOR ORGANIZATIONS AND COMMERCIAL ENTITIES
34+
--------------------------------------------
35+
Use of this software by organizations, businesses, or for commercial purposes
36+
is NOT covered by the MIT License set forth above.
37+
38+
To obtain a license for organizational or commercial use,
39+
please contact the author at: [email protected]

README.md

Lines changed: 74 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,75 @@
11
# gitmeup
22

3-
`gitmeup` looks at your current `git diff` / `git status` and turns that messy working tree into small, focused, Conventional Commit–style `git add` / `git commit` commands, with safe quoting for awkward paths. It does **not** push anything, it just helps you decide *what* to commit and *how* to phrase it.
4-
5-
---
3+
`gitmeup` leverages popular LLMs to organize changes into atomic, semantic batches, and generates precise `git add` and `git commit` commands following the [Conventional Commits 1.0.0](https://www.conventionalcommits.org/) specification.
4+
5+
> [!IMPORTANT]
6+
> It does **not** push anything, it just helps you decide *what* to commit and *how* to phrase it.
7+
> It is designed for strict safety: it runs in **dry-run mode by default**, never pushes to remotes, and handles complex file paths with POSIX-compliant quoting.
8+
9+
### Navigation
10+
* [What problem does it solve?](#what-problem-does-it-solve)
11+
* [How does it work?](#how-it-works-in-practice)
12+
* [Installation](#installation)
13+
* [Configuration](#configuration)
14+
* [Usage](#usage)
15+
* [Examples](#examples)
16+
* [Behaviour](#behaviour)
17+
* [License](#license)
18+
* [Maintainer](#maintainer)
619

720
## What problem does it solve?
821

9-
Typical flow when you have a pile of changes:
10-
11-
- You stare at `git status` and `git diff` deciding how to split changes.
12-
- You manually type `git add` commands, hoping you did not miss a file.
13-
- You spend too long crafting a commit message that fits Conventional Commits.
14-
- You worry about weird file paths breaking your shell.
22+
The typical workflow for complex changes involves significant manual overhead:
1523

16-
`gitmeup` automates that boring part:
24+
- Manually reviewing `git status` and `git diff` to determine logical split points.
25+
- Crafting specific `git add` commands, risking missing files or including unrelated changes.
26+
- Spending time formatting commit messages to adhere to Conventional Commits standards.
27+
- Handling files with spaces, brackets, or special characters that require careful shell escaping.
1728

18-
- Groups changes into **atomic, semantically focused commits** (refactor, docs, assets, etc.).
19-
- Proposes ready-to-paste `git add` / `git commit -m "type(scope): message"` sequences.
20-
- Handles **strict path quoting** so file names with spaces, brackets, unicode, etc. do not explode your shell.
21-
- Runs in **dry-run** by default, so nothing happens until you opt in.
29+
`gitmeup` automates the staging and committing process:
2230

23-
---
31+
- Groups changes into **atomic, semantically focused commits** (e.g., separating `feat` from `refactor` or `docs`).
32+
- Generates precise `git add` sequences followed by `git commit -m "type(scope): description"`.
33+
- Enforces **strict path quoting** to prevent shell expansion errors with complex filenames.
34+
- Operates safely via a default **dry-run** mode, requiring explicit confirmation to execute.
2435

2536
## How it works (in practice)
2637

27-
From inside a git repo, `gitmeup` collects:
38+
From inside a git repository, `gitmeup` aggregates the following context:
2839

29-
- `git diff --stat`
40+
- `git diff --stat HEAD`
3041
- `git status --short`
31-
- `git diff` with noisy formats excluded from the body:
32-
- `*.png`, `*.jpg`, `*.jpeg`, `*.gif`, `*.svg`, `*.webp`
42+
- `git diff HEAD` with high-noise/low-value files excluded from the context body:
43+
- Images: `*.png`, `*.jpg`, `*.svg`, etc.
44+
- Lockfiles: `package-lock.json`, `yarn.lock`, `Cargo.lock`, etc. (to prevent token exhaustion).
45+
- Minified assets and map files.
3346

34-
This context is sent to a Gemini model, which returns a single `bash` code block with:
47+
This sanitized context is transmitted to an LLM model _(default: Gemini)_, which returns a single code block containing:
3548

36-
- Batches of `git add` / `git rm` / `git mv`
37-
- Followed by matching `git commit -m "…"`, using Conventional Commits
49+
- Batches of `git add`, `git rm`, or `git mv` commands.
50+
- Corresponding `git commit -m "..."` commands following the Conventional Commits specification.
3851

3952
You can then:
4053

41-
- Inspect the proposed commands (default), or
42-
- Let `gitmeup` run them with `--apply`.
54+
- Inspect the proposed command plan (default behavior).
55+
- Execute the plan using `--apply`.
4356

44-
No `git push` is ever generated.
45-
46-
---
57+
No `git push` or remote operations are ever generated.
4758

4859
## Installation
4960

5061
### From PyPI (recommended)
5162

5263
```bash
5364
pip install gitmeup
54-
````
65+
```
5566

5667
This installs the `gitmeup` CLI into your environment.
5768

5869
### From source (editable dev install)
5970

6071
```bash
61-
git clone https://github.com/ikramagix/gitmeup
72+
git clone [https://github.com/ikramagix/gitmeup](https://github.com/ikramagix/gitmeup)
6273
cd gitmeup
6374

6475
python3 -m venv .venv
@@ -68,11 +79,9 @@ pip install --upgrade pip
6879
pip install -e .
6980
```
7081

71-
---
72-
7382
## Configuration
7483

75-
`gitmeup` talks to Google Gemini via `google-genai`. It needs:
84+
`gitmeup` interacts with Google Gemini via `google-genai`. It needs:
7685

7786
* A Gemini API key
7887
* A model name (default is `gemini-2.0-flash-lite` unless overridden)
@@ -120,26 +129,25 @@ The CLI accepts overrides:
120129

121130
```bash
122131
gitmeup --model gemini-2.0-pro # override model for this run only
123-
gitmeup --api-key "your-key-here" # override key (not recommended; leaks to history!)
132+
gitmeup --api-key "you-can-but-should-not-add-your-key-here" # override key (not recommended; leaks to history!)
124133
```
125134

126-
For security, prefer `~/.gitmeup.env` or environment variables over `--api-key`.
127-
128-
---
135+
> [!WARNING]
136+
> For security, prefer `~/.gitmeup.env` or environment variables over `--api-key`.
129137
130138
## Usage
131139

132-
From any git repository with uncommitted changes:
140+
Run the tool from the root of any git repository with uncommitted changes:
133141

134142
```bash
135143
gitmeup
136144
```
137145

138-
This:
146+
The tool performs the following checks:
139147

140-
* Ensures you are inside a git repo.
141-
* Checks `git status --porcelain`.
142-
* If there are changes, sends context to the model and prints **proposed commands**.
148+
* Verifies the current directory is a git repository.
149+
* Checks `git status --porcelain` for changes.
150+
* If changes exist, generates and displays **proposed commands**.
143151

144152
### Dry run (default)
145153

@@ -152,60 +160,60 @@ Example output:
152160
```bash
153161
Proposed commands:
154162

155-
git add -- gitmeup/stuff.py README.md
156-
git commit -m 'docs: Update README with export for GITMEUP_MODEL'
163+
git add -- gitmeup/utils.py README.md
164+
git commit -m 'docs: update README with configuration details'
157165

158166
Dry run: not executing commands. Re-run with --apply to execute.
159167
```
160168

161-
Nothing is executed until you explicitly ask.
169+
No commands are executed in this mode.
162170

163171
### Apply mode
164172

165-
To actually run the proposed `git add` and `git commit` commands:
173+
To execute the proposed `git add` and `git commit` commands:
166174

167175
```bash
168176
gitmeup --apply
169177
```
170178

171179
`gitmeup` will:
172180

173-
* Print each command as it executes.
174-
* Stop on the first failure and exit with a non-zero status.
175-
* Finally show a concise status:
181+
* Print each command to stdout as it executes.
182+
* Terminate immediately upon any command failure (non-zero exit code).
183+
* Display the final git status upon completion:
176184

177185
```bash
178186
Final git status:
179187

180188
## main...origin/main
181-
M some/file
182-
?? other/file
189+
M src/api_client.py
190+
?? tests/new_test.py
183191

184192
Review your history with:
185193
git log --oneline --graph --decorate -n 10
186194
```
187195

188-
---
189-
190196
## Examples
191197

192-
Basic flow, with everything configured via env / `.env`:
198+
Standard workflow using environment configuration:
193199

194200
```bash
195-
# inside a repo with changes
196-
gitmeup # review suggested batches
197-
gitmeup --apply # once you are happy with the plan
201+
# Review suggested batches
202+
gitmeup
203+
204+
# Execute the plan
205+
gitmeup --apply
206+
207+
# Verify history
198208
git log --oneline --graph --decorate -n 10
199209
```
200210

201-
Override model just for this run:
211+
Override the model for a specific run:
202212

203213
```bash
204214
gitmeup --model gemini-2.0-flash-lite
205215
```
206216

207-
---
208-
209217
## Behaviour
210218

211219
* **No pushing**: `gitmeup` never outputs `git push` or remote commands.
@@ -215,13 +223,16 @@ gitmeup --model gemini-2.0-flash-lite
215223

216224
You still review and decide when to run `--apply`.
217225

218-
---
219-
220226
## License
221227

222-
MIT License. See [`LICENSE`](./LICENSE) for details.
228+
This project is distributed under a **dual license** model.
229+
230+
1. **Individuals & personal use**: Free to use under the terms of the **MIT License**.
231+
2. **Organizations & businesses**: A commercial license is required.
232+
233+
Please contact **[email protected]** for commercial licensing details.
223234

224-
---
235+
See [`LICENSE`](./LICENSE) for the full legal text.
225236

226237
## Maintainer
227238

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ dependencies = [
1212
classifiers = [
1313
"Programming Language :: Python :: 3",
1414
"Programming Language :: Python :: 3 :: Only",
15-
"License :: OSI Approved :: MIT License",
1615
"Operating System :: OS Independent",
1716
]
1817

0 commit comments

Comments
 (0)