Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f9d9efc
Implements zsh autosuggest for good ghost text
joaquinalmora Aug 26, 2025
e35d9e4
Update Makefile, bla.txt (+3 more)
joaquinalmora Aug 26, 2025
c1f347c
added doctor command, removed redundtant command init shell and insta…
joaquinalmora Aug 26, 2025
a12be08
fixed docs
joaquinalmora Aug 26, 2025
d744e03
Update DOCS/AI_IMPLEMENTATION.md, DOCS/AI_READY_STATUS.md (+11 more)
joaquinalmora Aug 26, 2025
db6efb2
added AI commit message conventions, improved heuristic
joaquinalmora Aug 26, 2025
38c18be
git add .gitignore
joaquinalmora Aug 26, 2025
59ed4da
docs: add initial documentation for auto-cache testing system
joaquinalmora Aug 26, 2025
8692faa
docs(test-autocache): update testing documentation to include
joaquinalmora Aug 26, 2025
f5eb083
feat(docs): update documentation for AI implementation completion
joaquinalmora Aug 26, 2025
90aa66b
feat(cache): add caching functionality for commit messages
joaquinalmora Aug 26, 2025
009fa0d
feat(docs): add new documentation files for truncation testing
joaquinalmora Aug 26, 2025
5a7b355
fix(openai): improve message truncation to preserve word boundaries
joaquinalmora Aug 26, 2025
890e432
style: remove unnecessary blank lines in cache and commitgen files
joaquinalmora Aug 26, 2025
f6a15fd
feat(ollama): implement complete Ollama provider with documentation
joaquinalmora Aug 26, 2025
4837ff3
style: fix Go formatting issues identified by CI
joaquinalmora Aug 26, 2025
8cd08ad
./bin/commitgen doctor
joaquinalmora Aug 27, 2025
c6c5293
feat(docs): update environment configuration and remove outdated AI
joaquinalmora Aug 27, 2025
fa7e19e
refactor: reorganize documentation and improve shell script logic
joaquinalmora Aug 27, 2025
d3101db
feat(shell): improve commit suggestion strategy to avoid duplicates
joaquinalmora Aug 27, 2025
fbf2015
feat(shell): enhance commit suggestion functionality
joaquinalmora Aug 27, 2025
b762ea6
fix: update DOCS/README.MD, DOCS/USAGE.md and 12 more files
joaquinalmora Sep 3, 2025
dc879e6
feat(ci): enhance CI workflow for cross-platform testing and coverage
joaquinalmora Sep 6, 2025
acfe523
style: format logger files with gofmt
joaquinalmora Sep 6, 2025
f04f22f
fix(ci): specify bash shell for gofmt check on Windows
joaquinalmora Sep 7, 2025
39d1e2e
fix(ci): update golangci-lint action to v4 for Go 1.25 compatibility
joaquinalmora Sep 7, 2025
6a881e9
fix(ci): downgrade to Go 1.23 for golangci-lint compatibility
joaquinalmora Sep 7, 2025
222bcaf
fix(lint): resolve golangci-lint errors and remove unused function
joaquinalmora Sep 7, 2025
25c6a65
fix(ci): add .gitattributes for consistent line endings across platforms
joaquinalmora Sep 7, 2025
a426b81
fix(test): improve cross-platform compatibility for Windows CI
joaquinalmora Sep 7, 2025
d0676f9
style: fix gofmt formatting in shell_test.go
joaquinalmora Sep 7, 2025
1235420
fix(ci): use bash shell for test commands on Windows
joaquinalmora Sep 7, 2025
3801c1c
docs: update documentation for commitgen with new features and setup
joaquinalmora Sep 7, 2025
fb5383f
ls -la README.md && file README.md
joaquinalmora Sep 7, 2025
eb5c38a
docs: add comprehensive status report and clean README
joaquinalmora Sep 8, 2025
01f28ea
fix(ci): use bash shell for test commands on Windows
joaquinalmora Sep 8, 2025
c01c753
feat(cache): implement cache clear functionality and fix duplicate me…
joaquinalmora Sep 8, 2025
17f5a35
fix(ci): update GoReleaser to v2 for version 2 config support
joaquinalmora Sep 8, 2025
03638f0
fix: resolve shell history conflicts and clean up duplicate docs
joaquinalmora Sep 8, 2025
3612b7d
style: fix gofmt formatting in main.go
joaquinalmora Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# commitgen Environment Configuration
# Copy this file to .env and add your actual API keys

# OpenAI Configuration (Primary AI Provider)
# Get your API key from: https://platform.openai.com/api-keys
OPENAI_API_KEY=your-openai-api-key-here

# Optional: Override default model (gpt-4o-mini)
# COMMITGEN_MODEL=gpt-4o

# Performance Tuning (optional)
# COMMITGEN_CACHE_TTL=24h
# COMMITGEN_MAX_FILES=10
# COMMITGEN_PATCH_BYTES=102400

# Advanced Options (optional)
# COMMITGEN_AI_FALLBACK=true
# COMMITGEN_CONVENTIONS_FILE=/path/to/custom-conventions.md
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Ensure consistent line endings across platforms
* text=auto eol=lf

# Go files should use LF line endings
*.go text eol=lf

# Windows specific files use CRLF
*.bat text eol=crlf
*.cmd text eol=crlf

# Binary files
*.exe binary
*.dll binary
*.so binary
*.dylib binary
42 changes: 37 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,55 @@ on:

jobs:
test:
name: Unit tests (ubuntu)
runs-on: ubuntu-latest
name: Unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: [1.21, 1.23]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
go-version: ${{ matrix.go-version }}
- name: Check gofmt
shell: bash
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "gofmt needs to be run on these files:";
gofmt -l .;
exit 1;
fi
- name: Run tests
shell: bash
run: go test ./...

- name: Run tests with coverage
shell: bash
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage to Codecov
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23'
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
fail_ci_if_error: false

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --timeout=5m

macos-manual:
name: macOS smoke (manual)
Expand All @@ -36,7 +68,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
go-version: '1.23'
- name: Run macOS smoke
run: go test ./...

Expand All @@ -49,6 +81,6 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
go-version: '1.23'
- name: Run e2e test
run: go test ./e2e -run TestSuggestPlainIntegration -v
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Run tests
run: go test ./...

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# Build artifacts
bin/
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test coverage
coverage.out
coverage.html

# Temporary test files
test.txt
test-*.txt
*_test.txt
fresh_test.*

# Go workspace files
go.work
go.work.sum

# Environment files
.env
.env.local

# IDE and editor files
.vscode/settings.json
.idea/
*.swp
*.swo
*~

# OS files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Temporary files
*.tmp
*.temp

# Deprecated documentation (cleanup remnants)
INLINE_SUGGESTIONS.md
ROADMAP.md
AI_IMPLEMENTATION.md
AI-*
company-conventions.md
69 changes: 69 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: 2

before:
hooks:
- go mod tidy
- go test ./...

builds:
- main: ./cmd/commitgen
id: "commitgen"
binary: "commitgen"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- "386"
- amd64
- arm64
ignore:
- goos: darwin
goarch: "386"
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

brews:
- name: commitgen
repository:
owner: joaquinalmora
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
directory: Formula
homepage: "https://github.com/joaquinalmora/commitgen"
description: "Intelligent Git commit message generator powered by AI"
license: "MIT"
dependencies:
- name: git
test: |
system "#{bin}/commitgen version"
install: |
bin.install "commitgen"
64 changes: 64 additions & 0 deletions DOCS/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Cache clear functionality (`commitgen cache --clear`)
- Automatic .env file loading for seamless configuration
- Simplified OpenAI-only integration (removed Ollama complexity)
- Enhanced configuration with smart defaults
- Comprehensive development documentation
- Build automation with Makefile
- MIT License for open-source compliance

### Changed

- Streamlined AI provider selection (OpenAI only)
- Improved environment variable handling
- Simplified configuration variable names
- Enhanced .env.example with better documentation

### Fixed

- Duplicate commit message suggestions (disabled shell integration conflicts)
- Environment variable loading issues
- Configuration file detection
- API key validation workflow
- Cross-platform CI/CD issues (Windows PowerShell compatibility)

### Removed

- Ollama provider support (simplified to OpenAI only)
- Complex provider switching logic
- Redundant configuration options

## [0.1.0] - Initial Development

### Added in 0.1.0

- Core AI-powered commit message generation
- OpenAI integration with gpt-4o-mini support
- High-performance caching system with git hooks
- Shell integration for zsh autosuggestions
- Git workflow integration (prepare-commit-msg hook)
- Heuristic fallback for offline usage
- Doctor command for system diagnostics
- Professional commit message conventions
- Shell installation/uninstallation commands
- Basic CI/CD pipeline
- Documentation structure

### Features

- Sub-100ms commit message retrieval via cache
- Background pre-generation on `git add`
- Ghost text suggestions in terminal
- Smart fallback chain: AI → Cache → Heuristics
- One-command setup experience
- Zero-config defaults with customization options
Loading
Loading