Contributing
Prerequisites
Setup
git clone https://github.com/jjuanrivvera/adguard-cli.git
cd adguard-cli
make build
make test
Development Workflow
- Create a branch:
git checkout -b feat/my-feature
- Make changes
- Run tests:
make test
- Build:
make build
- Test against a real AdGuard Home instance
- Commit with conventional commits:
feat:, fix:, docs:, test:
- Push and open a PR
Conventional Commits
feat: add dhcp lease management commands
fix: handle nil response in query log
docs: add multi-instance guide
test: add credential encryption tests
chore: update dependencies
Code Style
- One command file per API resource group
- Keep command files under 200 lines
- Use
CLIError with hints for all user-facing errors
cmdutil.Infof for messages (stderr), output.Print for data (stdout)
- Tests use
httptest.NewServer for API mocking
- Run
go vet ./... before committing
Testing
# Run all tests
make test
# Run with race detection
go test -race ./...
# Coverage
go test -cover ./internal/...