ollama-git-commit 0.1.0__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.
- ollama_git_commit-0.1.0/.github/FUNDING.yml +4 -0
- ollama_git_commit-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
- ollama_git_commit-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +31 -0
- ollama_git_commit-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +51 -0
- ollama_git_commit-0.1.0/.github/workflows/ci.yml +66 -0
- ollama_git_commit-0.1.0/.github/workflows/publish.yml +39 -0
- ollama_git_commit-0.1.0/.gitignore +44 -0
- ollama_git_commit-0.1.0/CHANGELOG.md +33 -0
- ollama_git_commit-0.1.0/CONTRIBUTING.md +198 -0
- ollama_git_commit-0.1.0/DOCUMENTATION.md +204 -0
- ollama_git_commit-0.1.0/LICENSE +21 -0
- ollama_git_commit-0.1.0/MANIFEST.in +4 -0
- ollama_git_commit-0.1.0/PKG-INFO +394 -0
- ollama_git_commit-0.1.0/PYPI_QUICK_GUIDE.md +120 -0
- ollama_git_commit-0.1.0/README.md +360 -0
- ollama_git_commit-0.1.0/ai_commit.py +342 -0
- ollama_git_commit-0.1.0/install.sh +147 -0
- ollama_git_commit-0.1.0/ollama_git_commit.egg-info/PKG-INFO +394 -0
- ollama_git_commit-0.1.0/ollama_git_commit.egg-info/SOURCES.txt +26 -0
- ollama_git_commit-0.1.0/ollama_git_commit.egg-info/dependency_links.txt +1 -0
- ollama_git_commit-0.1.0/ollama_git_commit.egg-info/entry_points.txt +2 -0
- ollama_git_commit-0.1.0/ollama_git_commit.egg-info/requires.txt +1 -0
- ollama_git_commit-0.1.0/ollama_git_commit.egg-info/top_level.txt +1 -0
- ollama_git_commit-0.1.0/publish.sh +43 -0
- ollama_git_commit-0.1.0/pyproject.toml +44 -0
- ollama_git_commit-0.1.0/requirements.txt +1 -0
- ollama_git_commit-0.1.0/setup.cfg +4 -0
- ollama_git_commit-0.1.0/setup.py +47 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug to help us improve
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: himanshu231204
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Bug Description
|
|
11
|
+
A clear and concise description of the bug.
|
|
12
|
+
|
|
13
|
+
## Steps to Reproduce
|
|
14
|
+
1. Go to '...'
|
|
15
|
+
2. Run command '...'
|
|
16
|
+
3. See error
|
|
17
|
+
|
|
18
|
+
## Expected Behavior
|
|
19
|
+
What you expected to happen.
|
|
20
|
+
|
|
21
|
+
## Actual Behavior
|
|
22
|
+
What actually happened.
|
|
23
|
+
|
|
24
|
+
## Screenshots
|
|
25
|
+
If applicable, add screenshots to help explain your problem.
|
|
26
|
+
|
|
27
|
+
## Environment
|
|
28
|
+
- OS: [e.g., Ubuntu 22.04, macOS 13, Windows 11]
|
|
29
|
+
- Python Version: [e.g., 3.10.5]
|
|
30
|
+
- AI Commit Version: [e.g., 0.1.0]
|
|
31
|
+
- Ollama Version: [e.g., 0.1.14]
|
|
32
|
+
- Model Used: [e.g., llama2]
|
|
33
|
+
|
|
34
|
+
## Additional Context
|
|
35
|
+
Add any other context about the problem here.
|
|
36
|
+
|
|
37
|
+
## Error Logs
|
|
38
|
+
```
|
|
39
|
+
Paste any error messages or logs here
|
|
40
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest a new feature for AI Commit
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: himanshu231204
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Feature Description
|
|
11
|
+
A clear and concise description of the feature you'd like to see.
|
|
12
|
+
|
|
13
|
+
## Problem Statement
|
|
14
|
+
What problem does this feature solve? Why do you need it?
|
|
15
|
+
|
|
16
|
+
## Proposed Solution
|
|
17
|
+
How do you envision this feature working?
|
|
18
|
+
|
|
19
|
+
## Alternative Solutions
|
|
20
|
+
Have you considered any alternative approaches?
|
|
21
|
+
|
|
22
|
+
## Use Cases
|
|
23
|
+
Provide specific examples of how this feature would be used.
|
|
24
|
+
|
|
25
|
+
## Additional Context
|
|
26
|
+
Add any other context, mockups, or examples about the feature request here.
|
|
27
|
+
|
|
28
|
+
## Would you like to implement this?
|
|
29
|
+
- [ ] Yes, I'd like to work on this feature
|
|
30
|
+
- [ ] No, but I can help test it
|
|
31
|
+
- [ ] I'm just suggesting the idea
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Pull Request
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
<!-- Provide a brief description of the changes in this PR -->
|
|
5
|
+
|
|
6
|
+
## Type of Change
|
|
7
|
+
<!-- Mark the relevant option with an 'x' -->
|
|
8
|
+
- [ ] Bug fix (non-breaking change that fixes an issue)
|
|
9
|
+
- [ ] New feature (non-breaking change that adds functionality)
|
|
10
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
11
|
+
- [ ] Documentation update
|
|
12
|
+
- [ ] Code refactoring
|
|
13
|
+
- [ ] Performance improvement
|
|
14
|
+
- [ ] Other (please describe):
|
|
15
|
+
|
|
16
|
+
## Related Issues
|
|
17
|
+
<!-- Link to related issues using #issue_number -->
|
|
18
|
+
Closes #
|
|
19
|
+
|
|
20
|
+
## Changes Made
|
|
21
|
+
<!-- List the specific changes made in this PR -->
|
|
22
|
+
-
|
|
23
|
+
-
|
|
24
|
+
-
|
|
25
|
+
|
|
26
|
+
## Testing
|
|
27
|
+
<!-- Describe the tests you ran to verify your changes -->
|
|
28
|
+
- [ ] Tested on local machine
|
|
29
|
+
- [ ] All existing tests pass
|
|
30
|
+
- [ ] Added new tests (if applicable)
|
|
31
|
+
- [ ] Tested with different Ollama models
|
|
32
|
+
- [ ] Tested on multiple operating systems
|
|
33
|
+
|
|
34
|
+
## Screenshots/Output
|
|
35
|
+
<!-- If applicable, add screenshots or command output to demonstrate the changes -->
|
|
36
|
+
|
|
37
|
+
## Checklist
|
|
38
|
+
- [ ] My code follows the project's code style (PEP 8)
|
|
39
|
+
- [ ] I have commented my code where necessary
|
|
40
|
+
- [ ] I have updated the documentation (README, etc.)
|
|
41
|
+
- [ ] My changes generate no new warnings
|
|
42
|
+
- [ ] I have tested my changes thoroughly
|
|
43
|
+
- [ ] All tests pass locally
|
|
44
|
+
- [ ] I have added myself to contributors (if applicable)
|
|
45
|
+
|
|
46
|
+
## Additional Notes
|
|
47
|
+
<!-- Any additional information that reviewers should know -->
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
Thank you for contributing to AI Commit! 🎉
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
15
|
+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install -r requirements.txt
|
|
29
|
+
|
|
30
|
+
- name: Lint with flake8
|
|
31
|
+
run: |
|
|
32
|
+
pip install flake8
|
|
33
|
+
# Stop the build if there are Python syntax errors or undefined names
|
|
34
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
35
|
+
# Exit-zero treats all errors as warnings
|
|
36
|
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
37
|
+
|
|
38
|
+
- name: Test import
|
|
39
|
+
run: |
|
|
40
|
+
python -c "from ai_commit import OllamaClient, GitService, CommitGenerator"
|
|
41
|
+
|
|
42
|
+
- name: Check script execution
|
|
43
|
+
run: |
|
|
44
|
+
python ai_commit.py --help || true
|
|
45
|
+
|
|
46
|
+
lint:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
|
|
52
|
+
- name: Set up Python
|
|
53
|
+
uses: actions/setup-python@v5
|
|
54
|
+
with:
|
|
55
|
+
python-version: '3.11'
|
|
56
|
+
|
|
57
|
+
- name: Install dependencies
|
|
58
|
+
run: |
|
|
59
|
+
python -m pip install --upgrade pip
|
|
60
|
+
pip install black isort flake8
|
|
61
|
+
|
|
62
|
+
- name: Check formatting with black
|
|
63
|
+
run: black --check . || true
|
|
64
|
+
|
|
65
|
+
- name: Check import sorting with isort
|
|
66
|
+
run: isort --check-only . || true
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch: # Manual trigger option
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
pypi-publish:
|
|
10
|
+
name: Upload release to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: pypi
|
|
14
|
+
url: https://pypi.org/p/ai-commit-cli
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.11'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install build twine
|
|
29
|
+
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Check package
|
|
34
|
+
run: twine check dist/*
|
|
35
|
+
|
|
36
|
+
- name: Publish to PyPI
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
38
|
+
with:
|
|
39
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
|
|
24
|
+
# Virtual environments
|
|
25
|
+
.env
|
|
26
|
+
.venv
|
|
27
|
+
env/
|
|
28
|
+
venv/
|
|
29
|
+
ENV/
|
|
30
|
+
|
|
31
|
+
# IDE
|
|
32
|
+
.vscode/
|
|
33
|
+
.idea/
|
|
34
|
+
*.swp
|
|
35
|
+
*.swo
|
|
36
|
+
|
|
37
|
+
# OS
|
|
38
|
+
.DS_Store
|
|
39
|
+
Thumbs.db
|
|
40
|
+
|
|
41
|
+
# Testing
|
|
42
|
+
.pytest_cache/
|
|
43
|
+
.coverage
|
|
44
|
+
htmlcov/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to AI Commit will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2024-03-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Initial release
|
|
9
|
+
- AI-powered commit message generation using local Ollama
|
|
10
|
+
- Support for multiple commit styles (Conventional, Semantic, Detailed)
|
|
11
|
+
- Interactive CLI with colored output
|
|
12
|
+
- Multiple Ollama model support
|
|
13
|
+
- Cross-platform support (Linux, macOS, Windows)
|
|
14
|
+
- Privacy-first local AI processing
|
|
15
|
+
- Offline capability
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
- Command-line interface
|
|
19
|
+
- Beautiful terminal UI
|
|
20
|
+
- Error handling and validation
|
|
21
|
+
- Git repository validation
|
|
22
|
+
- Interactive user prompts
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## How to Update Version
|
|
27
|
+
|
|
28
|
+
1. Update version in `setup.py` and `pyproject.toml`
|
|
29
|
+
2. Add changes to this CHANGELOG
|
|
30
|
+
3. Commit: `git commit -m "chore: bump version to X.Y.Z"`
|
|
31
|
+
4. Tag: `git tag -a vX.Y.Z -m "Release vX.Y.Z"`
|
|
32
|
+
5. Push: `git push origin main --tags`
|
|
33
|
+
6. Build and publish to PyPI
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Contributing to AI Commit
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to AI Commit! 🎉
|
|
4
|
+
|
|
5
|
+
## Ways to Contribute
|
|
6
|
+
|
|
7
|
+
- 🐛 Report bugs
|
|
8
|
+
- 💡 Suggest new features
|
|
9
|
+
- 📝 Improve documentation
|
|
10
|
+
- 🔧 Submit code changes
|
|
11
|
+
- ⭐ Star the repository
|
|
12
|
+
- 🌐 Translate documentation
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
1. **Fork the repository**
|
|
17
|
+
```bash
|
|
18
|
+
# Click "Fork" on GitHub, then:
|
|
19
|
+
git clone https://github.com/YOUR_USERNAME/ai-commit.git
|
|
20
|
+
cd ai-commit
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **Create a branch**
|
|
24
|
+
```bash
|
|
25
|
+
git checkout -b feature/your-feature-name
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. **Make your changes**
|
|
29
|
+
- Write clean, readable code
|
|
30
|
+
- Follow Python PEP 8 style guidelines
|
|
31
|
+
- Add comments where necessary
|
|
32
|
+
|
|
33
|
+
4. **Test your changes**
|
|
34
|
+
```bash
|
|
35
|
+
# Make sure the tool works
|
|
36
|
+
python ai_commit.py
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
5. **Commit your changes** (use ai-commit if you want! 😄)
|
|
40
|
+
```bash
|
|
41
|
+
git add .
|
|
42
|
+
git commit -m "feat: add your feature description"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
6. **Push to your fork**
|
|
46
|
+
```bash
|
|
47
|
+
git push origin feature/your-feature-name
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
7. **Create a Pull Request**
|
|
51
|
+
- Go to the original repository
|
|
52
|
+
- Click "New Pull Request"
|
|
53
|
+
- Select your fork and branch
|
|
54
|
+
- Describe your changes
|
|
55
|
+
|
|
56
|
+
## Development Setup
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Clone your fork
|
|
60
|
+
git clone https://github.com/YOUR_USERNAME/ai-commit.git
|
|
61
|
+
cd ai-commit
|
|
62
|
+
|
|
63
|
+
# Install in development mode
|
|
64
|
+
pip install -e .
|
|
65
|
+
|
|
66
|
+
# Install development dependencies
|
|
67
|
+
pip install requests pytest flake8 black
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Code Style
|
|
71
|
+
|
|
72
|
+
- Follow PEP 8 guidelines
|
|
73
|
+
- Use meaningful variable names
|
|
74
|
+
- Add docstrings to functions and classes
|
|
75
|
+
- Keep functions focused and small
|
|
76
|
+
- Comment complex logic
|
|
77
|
+
|
|
78
|
+
Example:
|
|
79
|
+
```python
|
|
80
|
+
def generate_commit_message(diff: str) -> str:
|
|
81
|
+
"""
|
|
82
|
+
Generate a commit message from git diff.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
diff: The git diff string
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Generated commit message
|
|
89
|
+
"""
|
|
90
|
+
# Your code here
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Commit Message Guidelines
|
|
94
|
+
|
|
95
|
+
Use conventional commit format:
|
|
96
|
+
|
|
97
|
+
- `feat:` - New feature
|
|
98
|
+
- `fix:` - Bug fix
|
|
99
|
+
- `docs:` - Documentation changes
|
|
100
|
+
- `style:` - Code style changes (formatting, etc.)
|
|
101
|
+
- `refactor:` - Code refactoring
|
|
102
|
+
- `test:` - Adding tests
|
|
103
|
+
- `chore:` - Maintenance tasks
|
|
104
|
+
|
|
105
|
+
Examples:
|
|
106
|
+
```
|
|
107
|
+
feat: add support for custom Ollama models
|
|
108
|
+
fix: resolve connection timeout issue
|
|
109
|
+
docs: update installation instructions
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Reporting Bugs
|
|
113
|
+
|
|
114
|
+
When reporting bugs, include:
|
|
115
|
+
|
|
116
|
+
1. **Description** - Clear description of the issue
|
|
117
|
+
2. **Steps to Reproduce** - How to reproduce the bug
|
|
118
|
+
3. **Expected Behavior** - What should happen
|
|
119
|
+
4. **Actual Behavior** - What actually happens
|
|
120
|
+
5. **Environment**:
|
|
121
|
+
- OS (Windows/Mac/Linux)
|
|
122
|
+
- Python version
|
|
123
|
+
- Ollama version
|
|
124
|
+
- AI Commit version
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
```markdown
|
|
128
|
+
**Description**
|
|
129
|
+
AI Commit fails to connect to Ollama server
|
|
130
|
+
|
|
131
|
+
**Steps to Reproduce**
|
|
132
|
+
1. Start Ollama with `ollama serve`
|
|
133
|
+
2. Run `ai-commit`
|
|
134
|
+
3. Error appears
|
|
135
|
+
|
|
136
|
+
**Expected Behavior**
|
|
137
|
+
Should connect to Ollama
|
|
138
|
+
|
|
139
|
+
**Actual Behavior**
|
|
140
|
+
Connection timeout error
|
|
141
|
+
|
|
142
|
+
**Environment**
|
|
143
|
+
- OS: Ubuntu 22.04
|
|
144
|
+
- Python: 3.10
|
|
145
|
+
- Ollama: 0.1.14
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Suggesting Features
|
|
149
|
+
|
|
150
|
+
When suggesting features:
|
|
151
|
+
|
|
152
|
+
1. **Clear Title** - Descriptive title
|
|
153
|
+
2. **Use Case** - Why is this needed?
|
|
154
|
+
3. **Proposed Solution** - How should it work?
|
|
155
|
+
4. **Alternatives** - Other solutions considered?
|
|
156
|
+
|
|
157
|
+
## Pull Request Process
|
|
158
|
+
|
|
159
|
+
1. **Update documentation** - Update README if needed
|
|
160
|
+
2. **Test thoroughly** - Make sure everything works
|
|
161
|
+
3. **One feature per PR** - Keep PRs focused
|
|
162
|
+
4. **Describe changes** - Explain what and why
|
|
163
|
+
5. **Be responsive** - Respond to review comments
|
|
164
|
+
|
|
165
|
+
## Code Review
|
|
166
|
+
|
|
167
|
+
All submissions require review. We'll:
|
|
168
|
+
|
|
169
|
+
- Check code quality
|
|
170
|
+
- Test functionality
|
|
171
|
+
- Ensure documentation is updated
|
|
172
|
+
- Verify no breaking changes
|
|
173
|
+
|
|
174
|
+
## Community Guidelines
|
|
175
|
+
|
|
176
|
+
- Be respectful and inclusive
|
|
177
|
+
- Help others learn
|
|
178
|
+
- Give constructive feedback
|
|
179
|
+
- Follow the Code of Conduct
|
|
180
|
+
|
|
181
|
+
## Questions?
|
|
182
|
+
|
|
183
|
+
- Open an [Issue](https://github.com/himanshu231204/ai-commit/issues)
|
|
184
|
+
- Start a [Discussion](https://github.com/himanshu231204/ai-commit/discussions)
|
|
185
|
+
- Email: himanshu231204@gmail.com
|
|
186
|
+
|
|
187
|
+
## Recognition
|
|
188
|
+
|
|
189
|
+
Contributors will be:
|
|
190
|
+
- Added to README
|
|
191
|
+
- Mentioned in release notes
|
|
192
|
+
- Given credit in commit messages
|
|
193
|
+
|
|
194
|
+
Thank you for contributing! 🙏
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
**Made with ❤️ by [Himanshu Kumar](https://github.com/himanshu231204)**
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# AI Commit - Project Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
AI Commit is a command-line tool that generates intelligent git commit messages using local Ollama AI models. It analyzes your staged changes and creates meaningful commit messages following best practices.
|
|
6
|
+
|
|
7
|
+
## Author Information
|
|
8
|
+
|
|
9
|
+
**Himanshu Kumar**
|
|
10
|
+
- GitHub: [@himanshu231204](https://github.com/himanshu231204)
|
|
11
|
+
- LinkedIn: [himanshu231204](https://www.linkedin.com/in/himanshu231204)
|
|
12
|
+
- Twitter/X: [@himanshu231204](https://twitter.com/himanshu231204)
|
|
13
|
+
- Email: himanshu231204@gmail.com
|
|
14
|
+
|
|
15
|
+
## Support the Project
|
|
16
|
+
|
|
17
|
+
- ⭐ Star the repository
|
|
18
|
+
- ☕ [Buy me a coffee](https://www.buymeacoffee.com/himanshu231204)
|
|
19
|
+
- 💝 [Sponsor on GitHub](https://github.com/sponsors/himanshu231204)
|
|
20
|
+
|
|
21
|
+
## Quick Links
|
|
22
|
+
|
|
23
|
+
- **Repository**: https://github.com/himanshu231204/ai-commit
|
|
24
|
+
- **Issues**: https://github.com/himanshu231204/ai-commit/issues
|
|
25
|
+
- **Discussions**: https://github.com/himanshu231204/ai-commit/discussions
|
|
26
|
+
- **Wiki**: https://github.com/himanshu231204/ai-commit/wiki
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Quick Install
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/himanshu231204/ai-commit.git
|
|
33
|
+
cd ai-commit
|
|
34
|
+
bash install.sh
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Manual Install
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/himanshu231204/ai-commit.git
|
|
40
|
+
cd ai-commit
|
|
41
|
+
pip install -e .
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Stage your changes
|
|
48
|
+
git add .
|
|
49
|
+
|
|
50
|
+
# Generate commit message
|
|
51
|
+
ai-commit
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Features
|
|
55
|
+
|
|
56
|
+
- 🤖 AI-powered commit message generation
|
|
57
|
+
- 🔒 100% local and private
|
|
58
|
+
- 💰 Free (uses local Ollama)
|
|
59
|
+
- ⚡ Fast generation
|
|
60
|
+
- 🎨 Multiple commit styles
|
|
61
|
+
- 🌐 Works offline
|
|
62
|
+
|
|
63
|
+
## Technical Stack
|
|
64
|
+
|
|
65
|
+
- **Language**: Python 3.8+
|
|
66
|
+
- **Dependencies**: requests
|
|
67
|
+
- **AI Backend**: Ollama
|
|
68
|
+
- **License**: MIT
|
|
69
|
+
|
|
70
|
+
## Project Structure
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
ai-commit/
|
|
74
|
+
├── ai_commit.py # Main application
|
|
75
|
+
├── setup.py # Package configuration
|
|
76
|
+
├── requirements.txt # Dependencies
|
|
77
|
+
├── install.sh # Installation script
|
|
78
|
+
├── README.md # User documentation
|
|
79
|
+
├── CONTRIBUTING.md # Contribution guidelines
|
|
80
|
+
├── LICENSE # MIT License
|
|
81
|
+
├── .gitignore # Git ignore rules
|
|
82
|
+
└── .github/
|
|
83
|
+
└── workflows/
|
|
84
|
+
└── ci.yml # GitHub Actions CI
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## How It Works
|
|
88
|
+
|
|
89
|
+
1. **Analyze**: Reads git diff of staged changes
|
|
90
|
+
2. **Generate**: Sends diff to local Ollama model
|
|
91
|
+
3. **Present**: Shows generated commit message
|
|
92
|
+
4. **Interactive**: User can accept, regenerate, edit, or cancel
|
|
93
|
+
5. **Commit**: Creates git commit with chosen message
|
|
94
|
+
|
|
95
|
+
## Supported Models
|
|
96
|
+
|
|
97
|
+
- llama2 (recommended)
|
|
98
|
+
- codellama (code-optimized)
|
|
99
|
+
- mistral (fast)
|
|
100
|
+
- phi (lightweight)
|
|
101
|
+
- llama3 (most powerful)
|
|
102
|
+
- Any Ollama model
|
|
103
|
+
|
|
104
|
+
## Commit Message Styles
|
|
105
|
+
|
|
106
|
+
### Conventional Commits
|
|
107
|
+
```
|
|
108
|
+
feat(auth): add user login functionality
|
|
109
|
+
fix(api): resolve timeout issue
|
|
110
|
+
docs(readme): update installation steps
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Semantic
|
|
114
|
+
```
|
|
115
|
+
Add user login functionality
|
|
116
|
+
Fix timeout issue in API
|
|
117
|
+
Update installation steps in README
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Detailed
|
|
121
|
+
```
|
|
122
|
+
Add user authentication system
|
|
123
|
+
|
|
124
|
+
- Implement JWT-based authentication
|
|
125
|
+
- Add login and logout endpoints
|
|
126
|
+
- Create user session management
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
### Setup Development Environment
|
|
132
|
+
```bash
|
|
133
|
+
git clone https://github.com/himanshu231204/ai-commit.git
|
|
134
|
+
cd ai-commit
|
|
135
|
+
pip install -e .
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Running Tests
|
|
139
|
+
```bash
|
|
140
|
+
# Coming soon
|
|
141
|
+
pytest tests/
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Code Style
|
|
145
|
+
- Follow PEP 8
|
|
146
|
+
- Use type hints
|
|
147
|
+
- Add docstrings
|
|
148
|
+
- Write clean, readable code
|
|
149
|
+
|
|
150
|
+
## Contributing
|
|
151
|
+
|
|
152
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
153
|
+
|
|
154
|
+
### Quick Contribution Guide
|
|
155
|
+
1. Fork the repository
|
|
156
|
+
2. Create a feature branch
|
|
157
|
+
3. Make your changes
|
|
158
|
+
4. Test thoroughly
|
|
159
|
+
5. Submit a pull request
|
|
160
|
+
|
|
161
|
+
## Roadmap
|
|
162
|
+
|
|
163
|
+
- [x] Basic commit message generation
|
|
164
|
+
- [x] Multiple commit styles
|
|
165
|
+
- [x] Interactive CLI
|
|
166
|
+
- [ ] Configuration file support
|
|
167
|
+
- [ ] Custom prompt templates
|
|
168
|
+
- [ ] Git hooks integration
|
|
169
|
+
- [ ] VSCode extension
|
|
170
|
+
- [ ] Multiple language support
|
|
171
|
+
- [ ] Batch commit support
|
|
172
|
+
- [ ] Commit history analysis
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
177
|
+
|
|
178
|
+
## Acknowledgments
|
|
179
|
+
|
|
180
|
+
- **Ollama** - For local LLM runtime
|
|
181
|
+
- **Git** - Version control system
|
|
182
|
+
- **Python** - Programming language
|
|
183
|
+
- **Community** - Contributors and users
|
|
184
|
+
|
|
185
|
+
## Support
|
|
186
|
+
|
|
187
|
+
- **Bug Reports**: [GitHub Issues](https://github.com/himanshu231204/ai-commit/issues)
|
|
188
|
+
- **Feature Requests**: [GitHub Discussions](https://github.com/himanshu231204/ai-commit/discussions)
|
|
189
|
+
- **Email**: himanshu231204@gmail.com
|
|
190
|
+
|
|
191
|
+
## Statistics
|
|
192
|
+
|
|
193
|
+

|
|
194
|
+

|
|
195
|
+

|
|
196
|
+

|
|
197
|
+

|
|
198
|
+

|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
**Made with ❤️ by [Himanshu Kumar](https://github.com/himanshu231204)**
|
|
203
|
+
|
|
204
|
+
If you find this project useful, please consider giving it a ⭐ on GitHub!
|