Development setup
This page outlines how to set up your development environment to build and develop with the DataRobot CLI.
GitHub CLI Recommendation: DataRobot recommends using the GitHub CLI (
gh) for fork management. All examples useghcommands. See the GitHub CLI installation guide if needed. If you prefer manual git workflow, you can replaceghcommands with equivalentgitoperations.
Prerequisites
Installation
Install task
Task is required for running development tasks.
macOS
Linux
Windows
Set up the development environment
Clone the repository
Install development tools
This will install all necessary development tools including linters and code formatters.
Build the CLI
The binary will be available at ./dist/dr.
Verify the build
Available development tasks
To view all available tasks:
Common tasks
| Task | Description |
|---|---|
task build |
Build the CLI binary. |
task test |
Run all tests. |
task test-coverage |
Run tests with a coverage report. |
task lint |
Run linters and code formatters. |
task fmt |
Format code. |
task clean |
Cleanly build artifacts. |
task dev-init |
Set up a development environment. |
task install-tools |
Install development tools. |
task run |
Run the CLI without building (e.g., task run -- templates list). |
Build the CLI
Always use task build for building the CLI. This ensures that:
- The version information from git is included
- The git commit hash is embedded
- The build timestamp is recorded
- The proper
ldflagsconfiguration is applied
# Standard build (recommended)
task build
# Run without building (for quick testing)
task run -- templates list
Running tests
# Run all tests (both unit and integration)
task test
# Run tests with coverage
task test-coverage
# Run specific test
go test ./cmd/auth/...
Linting and formatting
For linting and formatting, this project uses the following tools:
golangci-lintfor comprehensive lintinggo fmtfor basic formattinggo vetfor suspicious constructsgoreleaser checkfor release configuration validation
Updating golangci-lint
When upgrading the Go version in go.mod, update golangci-lint if needed:
# 1. Check available versions at https://github.com/golangci/golangci-lint/releases
# 2. Update GOLANGCI_LINT_VERSION in Taskfile.yaml
# 3. Reinstall the binary
task install-tools
# 4. Verify linting works
task lint
golangci-lint is installed as a pre-built binary, so version mismatches with your project's Go version are handled automatically.
Next steps
- Project structure: Understand the codebase organization.
- Build guide: Detailed build information and architecture.
- Release process: Create and publish releases.