Guidelines for contributing to GitScrum CLI.
- Fork the repository
- Clone your fork
git clone https://github.com/YOUR_USERNAME/cli.git cd cli - Install dependencies
go mod download
- Build the project
make build
make build # Build binary to ./bin/gitscrum
make install # Build and install to $GOPATH/binmake test # Run all tests
make test-cover # Run tests with coverage
make lint # Run linter./bin/gitscrum --help
./bin/gitscrum taskscli/
├── cmd/gitscrum/ # Main entry point
├── pkg/
│ ├── api/ # HTTP client and API utilities
│ ├── auth/ # Authentication (OAuth, token storage)
│ ├── cmd/ # Command implementations
│ │ ├── analytics/
│ │ ├── auth/
│ │ ├── chat/
│ │ ├── clients/
│ │ ├── config/
│ │ ├── crm/
│ │ ├── hooks/
│ │ ├── init/
│ │ ├── invoices/
│ │ ├── notifications/
│ │ ├── projects/
│ │ ├── proposals/
│ │ ├── sprints/
│ │ ├── standup/
│ │ ├── tasks/
│ │ ├── timer/
│ │ ├── wiki/
│ │ └── workspaces/
│ ├── config/ # Configuration management
│ ├── git/ # Git utilities
│ ├── i18n/ # Internationalization
│ ├── interactive/ # Interactive prompts
│ ├── output/ # Output formatting (table, JSON)
│ ├── services/ # Business logic services
│ └── spinner/ # CLI spinner
├── docs/ # Documentation
│ ├── commands/ # Command documentation
│ └── examples/ # CI/CD and automation examples
└── install.sh # Installation script
- Create directory under
pkg/cmd/<command>/ - Implement the command using Cobra
- Register in
pkg/cmd/root/root.go - Add tests in
pkg/cmd/<command>/<command>_test.go - Update documentation
Example structure:
// pkg/cmd/example/example.go
package example
import (
"github.com/spf13/cobra"
"github.com/gitscrum-core/cli/pkg/cmd/factory"
)
func NewCmdExample(f *factory.Factory) *cobra.Command {
return &cobra.Command{
Use: "example",
Short: "Example command",
Long: `Detailed description of the example command.`,
Example: ` gitscrum example
gitscrum example --flag value`,
RunE: func(cmd *cobra.Command, args []string) error {
// Implementation
return nil
},
}
}- Follow standard Go conventions
- Use
gofmtfor formatting - Run
make lintbefore committing - Add comments for exported functions
- Keep functions focused and testable
Follow Conventional Commits:
feat: add sprint burndown command
fix: resolve timer not stopping on branch switch
docs: update README with installation instructions
refactor: simplify API client error handling
test: add unit tests for config package
chore: update dependencies
| Prefix | Use case |
|---|---|
feature/ |
New features |
bugfix/ |
Bug fixes |
docs/ |
Documentation changes |
refactor/ |
Code refactoring |
test/ |
Test additions |
-
Create a feature branch
git checkout -b feature/your-feature
-
Make changes with tests
-
Run tests locally
make test make lint -
Commit with descriptive message
git commit -m "feat: description of changes" -
Push and create PR
git push origin feature/your-feature
-
Fill out PR template
- Describe changes
- Link related issues
- Add screenshots if applicable
make test # All tests
go test ./pkg/cmd/tasks/... # Specific package
go test -v ./... # Verbose output- Place tests in
*_test.gofiles - Use table-driven tests
- Mock HTTP responses for API tests
- Aim for >80% coverage on new code
Include:
- CLI version (
gitscrum --version) - Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error messages
Open an issue with:
- Clear description
- Use case and motivation
- Example usage
By contributing, you agree that your contributions will be licensed under the MIT License.