DataRobot CLI (dr) - A Go-based command-line interface for managing DataRobot custom applications with OAuth integration, template management, and task execution capabilities.
Use Taskfile tasks rather than raw Go commands:
| Command | Description |
|---|---|
task build |
Build the CLI binary (outputs to ./dist/dr) |
task lint |
Lint and format all code |
task test |
Run tests with race detection and coverage |
task dev-init |
Initialize development environment |
task run |
Run CLI directly via go run |
- Run tests:
task test - Tests use
testify/assertfor assertions - Test files follow
*_test.gonaming convention - If DR_API_TOKEN is set, run smoke tests:
task smoke-test(but ask for permission before using a real API token)
Go Version Requirement: Tests run with the -race flag for data race detection. The race runtime must match your Go compiler version exactly. If you see errors like compile: version "go1.X.Y" does not match go tool version "go1.X.Z", ensure your installed Go version matches the version in go.mod (run brew upgrade go or adjust go.mod accordingly).
All code must pass golangci-lint with zero errors. Follow these whitespace rules:
- Never cuddle declarations - Always add a blank line before
var,const,typedeclarations when they follow other statements - Separate statement types - Add blank lines between different statement types (assign, if, for, return, etc.)
- Blank line after block start - Add blank line after opening braces of functions/blocks when followed by declarations
- Blank line before multi-line statements - Add blank line before if/for/switch statements
Example of correct spacing:
func example() {
x := 1
if x > 0 {
y := 2
fmt.Println(y)
}
var result string
result = "done"
return result
}- Always use
tui.Run()to execute TUI models for global Ctrl-C handling and debug logging - Always wrap new TUI models with the InterruptibleModel from the
tuipackage to ensure global Ctrl-C handling - Reuse existing TUI components from
tuipackage or Bubbles library (https://github.com/charmbracelet/bubbles) - Use styles from
tui/styles.gofor consistency - When
--debugis enabled, logs are written to.dr-tui-debug.log
All code must pass these tools without errors:
go mod tidy- dependency managementgo fmt- basic formattinggo vet- suspicious constructsgolangci-lint- comprehensive linting (includes wsl, revive, staticcheck)goreleaser check- release configuration validation
Before submitting code, mentally verify it follows wsl (whitespace) rules.
Output change summaries in Markdown format using the template in .github/PULL_REQUEST_TEMPLATE.md.