Skip to content

Latest commit

 

History

History

README.md

Development

This section provides comprehensive documentation for contributors and developers working on the DataRobot CLI.

Getting started

If you're new to developing the CLI, start here:

  1. Setup—set up your development environment, install prerequisites, and clone the repository.
  2. Building—learn how to build the CLI from source, understand the build process, and explore available development tasks.
  3. Structure—understand the codebase organization, key packages, and design patterns used throughout the project.

Development guides

Core concepts

  • Project structure—understand the codebase organization, command structure, internal packages, and key design patterns.
  • Building—detailed guide on building the CLI, available tasks, and build configuration.
  • Authentication—learn about the OAuth authentication implementation, token management, and API integration.

Advanced topics

  • Plugins—develop and test CLI plugins, understand the plugin system architecture.
  • Remote plugins—create and distribute remote plugins, plugin registry management.
  • Releasing—release process, versioning strategy, and GoReleaser configuration.

Quick reference

Essential commands

# Setup development environment
task dev-init

# Build the CLI
task build

# Run tests
task test

# Run linters
task lint

# Run CLI without building
task run -- templates list

Development workflow

  1. Clone the repository and run task dev-init
  2. Create a feature branch
  3. Make your changes
  4. Run task lint to format and lint code
  5. Run task test to verify tests pass
  6. Commit and push your changes
  7. Open a pull request

See Building for detailed workflow documentation.

Prerequisites

Before you begin development:

  • Go 1.25.7 or later—required for building the CLI.
  • Git—version control.
  • Task—task runner for development commands.
  • golangci-lint—installed automatically via task dev-init.

See Setup for detailed installation instructions.

Project structure overview

cli/
├── cmd/                    # Command implementations
│   ├── auth/              # Authentication commands
│   ├── component/         # Component management
│   ├── dotenv/            # Environment variable management
│   ├── plugin/            # Plugin management
│   ├── self/              # CLI utility commands
│   ├── start/             # Quickstart command
│   ├── task/              # Task execution
│   └── templates/         # Template management
├── internal/              # Private packages
│   ├── auth/              # Authentication logic
│   ├── config/            # Configuration management
│   ├── drapi/             # DataRobot API client
│   ├── envbuilder/        # Environment configuration
│   └── task/              # Task runner integration
├── tui/                   # Terminal UI components
├── docs/                  # Documentation
├── main.go                # Application entry point
├── Taskfile.yaml          # Task definitions
└── goreleaser.yaml        # Release configuration

See Structure for comprehensive documentation.

Coding standards

All code must:

  • Pass golangci-lint with zero errors
  • Follow Go whitespace rules (wsl linter)
  • Include tests for new functionality
  • Use the Taskfile for build operations

See Building for detailed requirements.

Testing

# Run all tests
task test

# Run tests with coverage
task test-coverage

# Run specific package tests
go test ./cmd/auth/...

# Run with race detection (included in task test)
go test -race ./...

See Building for comprehensive testing documentation.

Getting help

See also