Thank you for your interest in contributing to the Nylas CLI! This document provides guidelines for contributing.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/cli.git - Create a branch:
git checkout -b feat/your-feature - Make your changes
- Submit a pull request
# Install dependencies
go mod download
# Build
make build
# Run tests
make test
# Run linter
make lint
# Full check (lint + test + security + build)
make checkThis project follows hexagonal architecture (ports and adapters):
internal/domain/- Business entitiesinternal/ports/- Interface definitionsinternal/adapters/- Implementationsinternal/cli/- CLI commands
- Use
gofmtfor formatting - Follow Effective Go guidelines
- Wrap errors with context:
fmt.Errorf("failed to X: %w", err) - Pass
context.Contextto blocking operations
| Change Type | Unit Tests | Integration Tests |
|---|---|---|
| New feature | Required | Required |
| Bug fix | Required | If API-related |
| New command | Required | Required |
# Run unit tests
go test ./... -short
# Run integration tests (requires credentials)
NYLAS_API_KEY="..." NYLAS_GRANT_ID="..." go test ./... -tags=integration- Create focused PRs - One feature or fix per PR
- Write tests - All new code must have tests
- Update documentation - Update docs/COMMANDS.md if CLI changes
- Pass all checks - Run
make checkbefore submitting - Write clear commit messages - Use conventional format:
feat: add calendar sync commandfix: resolve nil pointer in email senddocs: update webhook examples
- API keys, tokens, or passwords
.envfiles- Credential files (
.pem,.key, etc.) - Personal configuration
# Run security scan
make security
# Check for secrets in your changes
git diff --cached | grep -iE "(api_key|password|secret|token)" || echo "Clean"We welcome AI-assisted contributions (GitHub Copilot, Claude, ChatGPT, etc.).
- Disclose AI usage - Mention in PR description if AI assisted
- Review thoroughly - You are responsible for all submitted code
- Test everything - AI-generated code must pass all tests
- Understand the code - Don't submit code you don't understand
## Summary
Added retry logic to email send command.
## AI Assistance
Used Claude Code to help implement exponential backoff logic.
Reviewed and tested all generated code.
## Testing
- Added unit tests for retry mechanism
- Manually tested with rate-limited API responses- Open an issue for bugs or feature requests
- Check existing issues before creating new ones
Thank you for contributing!