This page outlines how to set up your development environment to build and develop with the DataRobot CLI.
Task is required for running development tasks.
brew install go-task/tap/go-tasksh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/binchoco install go-taskgit clone https://github.com/datarobot-oss/cli.git
cd clitask dev-initThis will install all necessary development tools including linters and code formatters.
task buildThe binary will be available at ./dist/dr.
./dist/dr versionTo view all available tasks:
task --list| 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). |
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# Run all tests (both unit and integration)
task test
# Run tests with coverage
task test-coverage
# Run specific test
go test ./cmd/auth/...For linting and formatting, this project uses the following tools:
golangci-lintfor comprehensive lintinggo fmtfor basic formattinggo vetfor suspicious constructsgoreleaser checkfor release configuration validation
# Run all linters (includes formatting)
task lint
# Format code only
task fmt- Project structure: Understand the codebase organization.
- Build guide: Detailed build information and architecture.
- Release process: Create and publish releases.