- Go 1.21 or higher
- Git
- Make (optional but recommended)
- Clone the repository
git clone https://github.com/AlloraAi/AlloraCLI.git
cd AlloraCLI- Install dependencies
go mod download
go mod tidy- Build the project
make build
# or
go build -o bin/allora ./cmd/allora- Run tests
make test
# or
go test ./...- Install pre-commit hooks
# Install pre-commit (if not already installed)
pip install pre-commit
pre-commit installAlloraCLI/
├── cmd/ # Application entry points
│ └── allora/ # Main CLI application
├── pkg/ # Core packages
│ ├── agents/ # AI agent system
│ ├── cloud/ # Cloud provider integrations
│ ├── config/ # Configuration management
│ ├── monitor/ # Monitoring and metrics
│ ├── security/ # Security features
│ ├── ui/ # User interface components
│ └── utils/ # Utility functions
├── plugins/ # Plugin system
├── docs/ # Documentation
├── examples/ # Usage examples
├── test/ # Test utilities and integration tests
├── scripts/ # Build and deployment scripts
├── .github/ # GitHub workflows and templates
├── Makefile # Build automation
├── go.mod # Go module definition
└── README.md # Project overview
# Create feature branch
git checkout -b feature/your-feature-name
# Make changes
# Write tests
# Update documentation
# Run tests
make test
# Check code quality
make lint
# Commit changes
git commit -m "feat: add your feature description"
# Push and create PR
git push origin feature/your-feature-name# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Generate coverage report
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out# Run integration tests (requires setup)
go test ./test/integration/...# Run benchmarks
go test -bench=. ./...# Install golangci-lint
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Run linter
golangci-lint run# Format code
go fmt ./...
# Import organization
goimports -w .# Install gosec
go install github.com/securecodewarrior/gosec/v2/cmd/gosec@latest
# Run security scan
gosec ./...make help # Show available targets
make build # Build the application
make test # Run tests
make lint # Run linters
make clean # Clean build artifacts
make install # Install to $GOPATH/bin
make release # Create release builds# Build for all platforms
make build-all
# Build for specific platform
GOOS=linux GOARCH=amd64 make build
GOOS=windows GOARCH=amd64 make build
GOOS=darwin GOARCH=amd64 make build- Unit Tests: Test individual functions and methods
- Integration Tests: Test component interactions
- End-to-End Tests: Test complete workflows
func TestAgentQuery(t *testing.T) {
// Arrange
agent := &MockAgent{}
query := &agents.Query{Text: "test query"}
// Act
response, err := agent.Query(context.Background(), query)
// Assert
assert.NoError(t, err)
assert.NotNil(t, response)
assert.Contains(t, response.Text, "expected content")
}Use interfaces for testability:
// Good: interface allows mocking
type CloudProvider interface {
ListResources(ctx context.Context) ([]*Resource, error)
}
// Test with mock
func TestResourceListing(t *testing.T) {
mockProvider := &MockCloudProvider{}
mockProvider.On("ListResources").Return([]*Resource{}, nil)
// Test implementation
}- Follow Effective Go
- Use meaningful variable and function names
- Write comprehensive comments for public APIs
- Keep functions small and focused
Follow Conventional Commits:
feat: add new AI agent capability
fix: resolve authentication issue
docs: update API documentation
test: add integration tests for cloud providers
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Update documentation
- Submit pull request with clear description
# Enable debug logging
ALLORA_LOG_LEVEL=debug ./bin/allora <command>
# Or use flag
./bin/allora --log-level debug <command># CPU profiling
go tool pprof ./bin/allora cpu.prof
# Memory profiling
go tool pprof ./bin/allora mem.prof- Import cycles: Restructure packages to avoid circular dependencies
- Race conditions: Use
go test -raceto detect - Memory leaks: Use
go tool pprofto analyze
We follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Update version in relevant files
- Update CHANGELOG.md
- Create and push tag:
git tag v1.0.0 - GitHub Actions will automatically create release
- Check existing GitHub Issues
- Join our Discord
- Read the Contributing Guide
- Email: developers@alloracli.com