Skip to content

Commit 0866eb0

Browse files
committed
feat: init CLI
0 parents  commit 0866eb0

File tree

10 files changed

+1591
-0
lines changed

10 files changed

+1591
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
commitgen
2+
coverage.out

.goreleaser.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# .goreleaser.yml configuration
2+
# Install goreleaser: go install github.com/goreleaser/goreleaser@latest
3+
# Build with: goreleaser build --snapshot --clean
4+
# Release with: goreleaser release
5+
6+
version: 1
7+
8+
before:
9+
hooks:
10+
- go mod tidy
11+
12+
builds:
13+
- env:
14+
- CGO_ENABLED=0
15+
goos:
16+
- linux
17+
- windows
18+
- darwin
19+
goarch:
20+
- amd64
21+
- arm64
22+
binary: commitgen
23+
ldflags:
24+
- -s -w
25+
- -X main.version={{.Version}}
26+
- -X main.commit={{.Commit}}
27+
- -X main.date={{.Date}}
28+
- -X main.builtBy=goreleaser
29+
30+
archives:
31+
- format: tar.gz
32+
name_template: >-
33+
{{ .ProjectName }}_
34+
{{- title .Os }}_
35+
{{- if eq .Arch "amd64" }}x86_64
36+
{{- else if eq .Arch "386" }}i386
37+
{{- else }}{{ .Arch }}{{ end }}
38+
{{- if .Arm }}v{{ .Arm }}{{ end }}
39+
files:
40+
- README.md
41+
- LICENSE
42+
format_overrides:
43+
- goos: windows
44+
format: zip
45+
46+
checksum:
47+
name_template: 'checksums.txt'
48+
49+
snapshot:
50+
name_template: "{{ incpatch .Version }}-next"
51+
52+
changelog:
53+
sort: asc
54+
use: github
55+
filters:
56+
exclude:
57+
- "^docs:"
58+
- "^test:"
59+
- "^chore:"
60+
- Merge pull request
61+
Merge branch
62+
63+
# Homebrew formula
64+
brews:
65+
- name: commitgen
66+
homepage: https://github.com/FreePeak/commitgen
67+
repository:
68+
owner: FreePeak
69+
name: homebrew-tap
70+
commit_author:
71+
name: goreleaserbot
72+
73+
license: MIT
74+
description: AI-powered commit message generator
75+
76+
# GitHub release
77+
release:
78+
github:
79+
owner: FreePeak
80+
name: commitgen
81+
draft: false
82+
prerelease: auto
83+
name_template: "{{.ProjectName}} v{{.Version}}"
84+
header: |
85+
## Commitgen {{.Version}}
86+
87+
Welcome to this new release!
88+
footer: |
89+
## Docker Images
90+
91+
- `docker pull ghcr.io/freepeak/commitgen:{{.Tag}}`
92+
- `docker pull ghcr.io/freepeak/commitgen:latest` (for {{.Tag}})
93+
94+
## Installation
95+
96+
### Homebrew
97+
```bash
98+
brew install FreePeak/tap/commitgen
99+
```
100+
101+
### Go Install
102+
```bash
103+
go install github.com/FreePeak/commitgen@latest
104+
```
105+
106+
### Manual Download
107+
Download the appropriate binary from the assets below.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Free Peak
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 all
13+
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 NONINFRINGEMENT. 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 FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.PHONY: build install test clean help
2+
3+
# Build the binary
4+
build:
5+
go build -o harvey main.go
6+
7+
# Install to /usr/local/bin
8+
install: build
9+
./harvey install
10+
11+
# Run tests
12+
test:
13+
go test ./...
14+
15+
# Clean build artifacts
16+
clean:
17+
rm -f harvey
18+
19+
# Install dependencies
20+
deps:
21+
go mod tidy
22+
23+
# Development build with race detection
24+
dev:
25+
go build -race -o harvey main.go
26+
27+
# Release build
28+
release:
29+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o harvey-linux-amd64 main.go
30+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o harvey-darwin-amd64 main.go
31+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-w -s" -o harvey-darwin-arm64 main.go
32+
33+
# Show available targets
34+
help:
35+
@echo "Available targets:"
36+
@echo " build - Build the harvey binary"
37+
@echo " install - Build and install harvey to /usr/local/bin"
38+
@echo " test - Run all tests"
39+
@echo " clean - Remove build artifacts"
40+
@echo " deps - Install dependencies"
41+
@echo " dev - Build with race detection enabled"
42+
@echo " release - Build release binaries for multiple platforms"
43+
@echo " help - Show this help message"

0 commit comments

Comments
 (0)