- Go 1.21 or later
# Install dependencies (including dev tools)
go mod download
# Build for current platform
make build
# Build for all platforms (macOS ARM64/AMD64, Linux AMD64)
make build-all
# Run tests
make test
# Run tests with coverage
make test-coverage
# Run linter (uses golangci-lint as a dev dependency, no global install needed)
make lint
# Format code
make fmt
# Clean artifacts
make clean
# Install locally (default ~/.local/bin; override INSTALL_DIR if needed)
make install
# Download latest CI-built binaries (requires repo access):
# 1. git pull origin main
# 2. Go to GitHub → Actions → "Build binaries" workflow
# 3. Download gi-binaries-<sha> artifact for your platform| Target | Description |
|---|---|
make build |
Build the CLI for the current platform with embedded version info |
make build-all |
Cross-compile binaries for macOS (arm64/amd64) and Linux (amd64) |
make test / make test-coverage |
Run the test suite (optionally with coverage) |
make lint |
Run golangci-lint against the codebase |
make fmt |
Format the tree with go fmt ./... |
make clean |
Remove build artifacts and coverage reports |
make install |
Build and install to ~/.local/bin (override INSTALL_DIR as needed) |
Override VERSION to embed a specific version string:
VERSION=v1.2.3 make build
./gi --versionNote: golangci-lint is tracked as a dev dependency in tools.go and doesn't need to be installed globally. The Makefile automatically runs it via go run.
git-issue/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI workflow
├── cmd/
│ ├── root.go # Root command and global flags
│ ├── init.go # Initialize command
│ ├── create.go # Create command
│ ├── list.go # List command
│ ├── show.go # Show command
│ ├── close.go # Close command
│ ├── open.go # Open command
│ ├── edit.go # Edit command
│ └── search.go # Search command
├── pkg/
│ ├── issue.go # Issue struct and operations
│ ├── storage.go # File system operations
│ └── parser.go # Markdown/YAML parsing
├── cmd/gi/
│ └── main.go # Entry point that wires Cobra commands
├── tools.go # Dev tool dependencies
├── go.mod
├── go.sum
├── Makefile
└── README.md
require (
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.0
gopkg.in/yaml.v3 v3.0.1
github.com/fatih/color v1.16.0
github.com/olekukonko/tablewriter v0.0.5
)- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Run all tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Run tests with coverage
go test -cover ./...
# Generate coverage report
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out- Place test files alongside the code they test (e.g.,
storage.go→storage_test.go) - Use table-driven tests where appropriate
- Test both success and error cases
- Ensure proper cleanup in test setup/teardown functions
- Use descriptive test names that explain what is being tested
- Follow standard Go conventions
- Use
gofmtfor formatting - Run
golangci-lintbefore committing - Write clear comments for exported functions
- Keep functions focused and single-purpose
- Update version in
cmd/root.go - Create a git tag:
git tag -a v0.1.0 -m "Release v0.1.0" - Push tag:
git push origin v0.1.0 - GitHub Actions will automatically build and create a release
- Issues are stored as Markdown files with YAML frontmatter
- Status is determined by directory location (
.issues/open/or.issues/closed/) - File naming pattern:
{id}-{slug}.md - Counter file (
.issues/.counter) tracks the next issue ID
- YAML frontmatter is delimited by
--- - Markdown body is preserved exactly as written
- Slug generation: lowercase, spaces/special chars replaced with hyphens
- Git operations are optional (via
--commitflag) - Always check if directory is a git repository before git operations
- Never use
--forceor destructive git commands - Commit messages follow pattern: "Close issue #001" or "Reopen issue #001"
- Ensure you're in the project root directory
- Run
go mod tidyto ensure dependencies are correct - Check that temporary directories are being cleaned up properly
- Verify Go version:
go version(should be 1.21+) - Clear build cache:
go clean -cache - Update dependencies:
go get -u ./...
- Run
make fmtto auto-format code - Run
make lintto see all linting issues - Address issues one at a time