# Development setup

> Development setup - Setting up your development environment for building and developing the
> DataRobot CLI.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.549853+00:00` (UTC).

## Primary page

- [Development setup](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html): Full documentation for this topic (HTML).

## Sections on this page

- [Prerequisites](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#prerequisites): In-page section heading.
- [Installation](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#installation): In-page section heading.
- [Installing Task](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#installing-task): In-page section heading.
- [macOS](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#macos): In-page section heading.
- [Linux](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#linux): In-page section heading.
- [Windows](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#windows): In-page section heading.
- [Setting up the development environment](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#setting-up-the-development-environment): In-page section heading.
- [Clone the repository](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#clone-the-repository): In-page section heading.
- [Install development tools](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#install-development-tools): In-page section heading.
- [Build the CLI](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#build-the-cli): In-page section heading.
- [Verify the build](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#verify-the-build): In-page section heading.
- [Available development tasks](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#available-development-tasks): In-page section heading.
- [Common tasks](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#common-tasks): In-page section heading.
- [Building](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#building): In-page section heading.
- [Running tests](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#running-tests): In-page section heading.
- [Linting and formatting](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#linting-and-formatting): In-page section heading.
- [Next steps](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/setup.html#next-steps): In-page section heading.

## Related documentation

- [Agentic AI](https://docs.datarobot.com/en/docs/agentic-ai/index.html): Linked from this page.
- [CLI](https://docs.datarobot.com/en/docs/agentic-ai/cli/index.html): Linked from this page.
- [Authentication flow](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/authentication.html): Linked from this page.
- [Project structure](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/structure.html): Linked from this page.
- [Building guide](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/building.html): Linked from this page.
- [Release process](https://docs.datarobot.com/en/docs/agentic-ai/cli/development/releasing.html): Linked from this page.

## Documentation content

This guide covers setting up your development environment for building and developing the DataRobot CLI.

## Prerequisites

- Go 1.25.3+ — Download
- Git —version control
- Task —task runner ( install )

## Installation

### Installing Task

Task is required for running development tasks.

#### macOS

```
brew install go-task/tap/go-task
```

#### Linux

```
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
```

#### Windows

```
choco install go-task
```

## Setting up the development environment

### Clone the repository

```
git clone https://github.com/datarobot-oss/cli.git
cd cli
```

### Install development tools

```
task dev-init
```

This will install all necessary development tools including linters and code formatters.

### Build the CLI

```
task build
```

The binary will be available at `./dist/dr`.

### Verify the build

```
./dist/dr version
```

## Available development tasks

View all available tasks:

```
task --list
```

### Common tasks

| Task | Description |
| --- | --- |
| task build | Build the CLI binary |
| task test | Run all tests |
| task test-coverage | Run tests with coverage report |
| task lint | Run linters and code formatters |
| task fmt | Format code |
| task clean | Clean build artifacts |
| task dev-init | Setup development environment |
| task install-tools | Install development tools |
| task run | Run CLI without building (e.g., task run -- templates list) |

## Building

Always use `task build` for building the CLI.This ensures:

- Version information from git is included
- Git commit hash is embedded
- Build timestamp is recorded
- Proper ldflags configuration is applied

```
# Standard build (recommended)
task build

# Run without building (for quick testing)
task run -- templates list
```

## Running tests

```
# Run all tests
task test

# Run tests with coverage
task test-coverage

# Run specific test
go test ./cmd/auth/...
```

## Linting and formatting

```
# Run all linters (includes formatting)
task lint

# Format code only
task fmt
```

The project uses:

- golangci-lint for comprehensive linting
- go fmt for basic formatting
- go vet for suspicious constructs
- goreleaser check for release configuration validation

## Next steps

- Project structure —understand the codebase organization
- Building guide —detailed build information and architecture
- Release process —creating releases and publishing
