cli

command module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

DataRobot CLI

Go Report Card License

The DataRobot CLI (dr) is a command-line interface for managing DataRobot custom applications. It provides an interactive experience for cloning, configuring, and deploying DataRobot application templates with built-in authentication, environment configuration, and task execution capabilities.

Features

  • 🔐 Authentication management—seamless OAuth integration with DataRobot.
  • 📦 Template management—clone and configure application templates interactively.
  • ⚙️ Interactive configuration—smart wizard for environment setup with validation.
  • 🚀 Task runner—execute application tasks with built-in Taskfile integration.
  • 🐚 Shell completions—support for Bash, Zsh, Fish, and PowerShell.
  • 🎨 Beautiful TUI—terminal UI built with Bubble Tea for an enhanced user experience.

Table of Contents

Installation

Install the latest version with a single command:

macOS/Linux
curl https://cli.datarobot.com/install | sh
Windows (PowerShell)
irm https://cli.datarobot.com/winstall | iex
Install Specific Version
macOS/Linux
curl  https://cli.datarobot.com/install | sh -s -- v0.1.0
Windows
$env:VERSION = "v0.1.0"; irm https://cli.datarobot.com/winstall | iex
Installation from source

Prerequisites
  • Go 1.25.3 or later (for building from source).
  • Git.
  • Task (for development and task running).
Build from source
# Clone the repository
git clone https://github.com/datarobot-oss/cli.git
cd cli

# Build the CLI
task build

# The binary is available at ./dist/dr
./dist/dr version

Quick start

1. Set up authentication

Configure your DataRobot credentials:

# Set your DataRobot URL (interactive)
dr auth set-url

# Or specify directly
dr auth set-url https://app.datarobot.com

# Log in to DataRobot (opens browser for OAuth)
dr auth login
2. Set up a template

Use the interactive setup wizard to clone and configure a template:

dr templates setup

Follow the prompts to select a template, clone it, and configure environment variables.

3. Start your application

Once configured, launch your application with the quickstart command:

dr start

This will either execute your template's quickstart script or guide you through the setup process if one hasn't been completed yet.

Commands

3. Run tasks

Execute tasks defined in your template Taskfile:

# List available tasks
dr run --list

# Run a specific task
dr run dev

# Run multiple tasks in parallel
dr run lint test --parallel

Documentation

Comprehensive documentation is available in the docs/ directory:

Commands

Main commands
Command Description
dr auth Authentication management (login, logout, set-url).
dr templates Template operations (list, clone, setup, status).
dr run Execute application tasks.
dr dotenv Manage environment variables interactively.
dr completion Generate shell completion scripts.
dr version Show version information.
Examples
# Authentication
dr auth login
dr auth logout
dr auth set-url https://app.datarobot.com

# Template management
dr templates list                    # List available templates.
dr templates clone TEMPLATE_NAME     # Clone a specific template.
dr templates setup                   # Interactive template setup wizard.
dr templates status                  # Show current template status.

# Environment configuration
dr dotenv                           # Interactive environment editor.
dr dotenv --wizard                  # Configuration wizard mode.

# Task execution
dr run --list                       # List available tasks.
dr run dev                          # Run development server.
dr run build deploy --parallel      # Run multiple tasks in parallel.
dr run test --watch                 # Run tests in watch mode.

# Get help
dr --help
dr templates --help
dr run --help

Shell completion

The CLI supports shell completions for Bash, Zsh, Fish, and PowerShell with automatic installation and configuration.

The easiest way to install completions is using the interactive installer:

# Install completions for your current shell
dr completion install --yes

# Preview what would be installed (default behavior)
dr completion install

# Install for a specific shell
dr completion install bash --yes
dr completion install zsh --yes

The installer will:

  • Detect your shell automatically
  • Install completions to the correct location
  • Configure your shell profile
  • Clear completion caches

Note: Installation scripts (install.sh and install.ps1) automatically prompt to install completions during initial setup.

Manual setup

If you prefer manual installation, generate the completion script:

Bash

# Linux
dr completion bash | sudo tee /etc/bash_completion.d/dr

# macOS (requires bash-completion from Homebrew)
dr completion bash > $(brew --prefix)/etc/bash_completion.d/dr

Zsh

# Oh-My-Zsh
dr completion zsh > ~/.oh-my-zsh/custom/completions/_dr

# Standard Zsh
dr completion zsh > ~/.zsh/completions/_dr

Fish

dr completion fish > ~/.config/fish/completions/dr.fish

PowerShell

dr completion powershell | Out-String | Invoke-Expression
# To persist, add to your PowerShell profile
Uninstalling completions
dr completion uninstall --yes

See the Shell Completion Guide for detailed instructions and troubleshooting.

Development

Setting up the development environment
  1. Install prerequisites
# Install Task (task runner)
# 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
  1. Clone and build
git clone https://github.com/datarobot-oss/cli.git
cd cli

# Install development tools
task dev-init

# Build the CLI
task build

# Run tests
task test

# Run linters
task lint
  1. Available development tasks
task --list           # Show all available tasks.
task test             # Run tests.
task test-coverage    # Run tests with coverage.
task lint             # Run linters.
task fmt              # Format code.
task build            # Build binary.
task clean            # Clean build artifacts.
Project structure
.
├── cmd/                    # Command implementations.
│   ├── auth/              # Authentication commands.
│   ├── completion/        # Shell completion.
│   ├── dotenv/            # Environment management.
│   ├── run/               # Task runner.
│   ├── templates/         # Template commands.
│   └── version/           # Version command.
├── internal/              # Private application code.
│   ├── config/           # Configuration management.
│   ├── drapi/            # DataRobot API client.
│   ├── envbuilder/       # Environment builder.
│   ├── task/             # Task discovery and execution.
│   └── version/          # Version information.
├── tui/                   # Terminal UI components.
├── docs/                  # Documentation.
└── main.go               # Application entry point.

Release

Creating a release

This project uses goreleaser for automated releases.

  1. Ensure all changes are merged to the main branch.

  2. Determine the next version following Semantic Versioning:

    • MAJOR.MINOR.PATCH (e.g., v1.2.3).
    • Pre-release: v1.2.3-rc.1, v1.2.3-beta.1.
  3. Create and push a tag:

# Create a new version tag.
git tag v0.1.0

# Push the tag.
git push --tags
  1. Automated release: The GitHub Actions workflow automatically:
    • Builds binaries for multiple platforms.
    • Generates release notes.
    • Creates a GitHub release.
    • Uploads artifacts.
Release testing

To test the release process without publishing:

# Dry run.
goreleaser release --snapshot --clean

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details on:

  • Code of conduct.
  • Development workflow.
  • Submitting pull requests.
  • Coding standards.
  • Testing requirements.
Quick contribution guide
  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/amazing-feature).
  3. Make your changes.
  4. Run tests and linters (task test && task lint).
  5. Commit your changes (git commit -m 'Add amazing feature').
  6. Push to the branch (git push origin feature/amazing-feature).
  7. Open a pull request.

License

Copyright 2025 DataRobot, Inc. and its affiliates. All rights reserved.

This is proprietary source code of DataRobot, Inc. See LICENSE.txt for details.

Support

Acknowledgments

Built with:

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL