This document describes how the DataRobot CLI plugin system works and how to build a plugin.
See more information on Confluence at DataRobot CLI Integration Analysis.
Plugins are external executables that extend the dr CLI with additional top-level commands.
- A plugin executable is discovered under the name pattern
dr-*. - When discovered, the CLI queries the executable for a JSON manifest.
- The manifest declares the command name and metadata shown in
dr plugin list. - When a user runs
dr <plugin-command> ..., the CLI executes the plugin binary and forwards all arguments.
At CLI startup, plugins are discovered from:
- Project-local
.dr/plugins/directory (highest priority) - Every directory on your
PATH
Only files whose filename begins with dr- are considered.
The CLI also verifies the candidate is executable (via Go's runtime exec.LookPath).
Plugins are deduplicated by manifest.name (not by filename). If multiple binaries report the same manifest.name, the first discovered one wins and later ones are skipped.
- Overall discovery is bounded by the global flag
--plugin-discovery-timeout(default2s).- Set to
0sto disable plugin discovery entirely.
- Set to
- Manifest retrieval is bounded by
plugin.manifest_timeout_ms(default500ms).
To be recognized as a plugin, the executable must respond to the special argument:
dr-myplugin --dr-plugin-manifestThe command must write a single JSON object to stdout and exit with code 0.
The CLI currently understands the following fields:
{
"name": "my-plugin",
"version": "1.2.3",
"description": "Adds extra commands to dr",
"authentication": true
}name(string): The command name the CLI will register.- Example:
{"name":"my-plugin",...}becomes the top-level commanddr my-plugin. - Must be non-empty (plugins missing this field are rejected).
- Example:
version(string): Displayed indr plugin list(shown as-if empty).description(string): Displayed indr plugin listand used as the command short help when registered asdr <name>.authentication(boolean): Whentrue, the CLI will check for valid DataRobot authentication before executing the plugin.- If no valid credentials exist, the user will be prompted to log in.
- Respects the global
--skip-authflag. - Defaults to
falseif omitted.
- Keep manifest output small and fast; it is called during discovery.
- The manifest should be deterministic and should not require network access.
- The plugin should handle
--dr-plugin-manifestbefore doing any other work (and should not print extra output in this mode).
When a user runs:
dr <plugin-name> [args...]The CLI:
- Prints a short info line indicating which plugin is being run.
- If the plugin manifest has
"authentication": true, checks for valid authentication and prompts for login if needed. - Executes the plugin binary.
- Passes all remaining arguments to the plugin verbatim.
- Exits with the same exit code as the plugin.
Because plugin commands are registered as top-level commands, a plugin cannot conflict with an existing built-in command name.
If your plugin needs to interact with the DataRobot API, set "authentication": true in your manifest. This ensures users are authenticated before your plugin runs.
Example manifest with authentication:
{
"name": "assist",
"version": "0.1.6",
"description": "AI agent design, coding, and deployment assistant",
"authentication": true
}When authentication is enabled:
- The CLI checks for valid credentials from environment variables (
DATAROBOT_ENDPOINT,DATAROBOT_API_TOKEN) or the config file. - If no valid credentials exist, the user is automatically prompted to log in via
dr auth login. - Authentication can be bypassed with the global
--skip-authflag (for advanced users). - Your plugin will receive a clean environment with authentication already validated
Minimum requirements:
- Name the executable
dr-<something>. - Ensure it is executable (
chmod +x). - Implement
--dr-plugin-manifestto print valid JSON with at leastname. - Put it in
.dr/plugins/or onPATH.
If you run dr <command> expecting <command> to be provided by a plugin, but the CLI reports it as an unknown command, check:
-
Is the plugin discoverable? Run:
dr plugin list
If the plugin is not listed, it was not discovered during startup.
-
Is the plugin executable accessible on
PATH? The CLI discovers plugins from.dr/plugins/and fromPATH.-
Ensure the plugin binary is named
dr-<something>and is executable. -
Ensure the directory containing
dr-<something>is on yourPATH. -
You can verify with your shell, e.g.:
which dr-<something>
-
-
Did you disable or time out discovery? If
--plugin-discovery-timeoutis0s(disabled) or too low, plugins may not be registered.
dr plugin list/dr plugins list: show discovered plugins and their manifest metadata.
The CLI provides tools to help package and publish plugins to a plugin registry.
The easiest way to package and publish a plugin is the all-in-one publish command:
dr self plugin publish <plugin-dir> [flags]This command does everything in one step:
- Validates the plugin manifest
- Creates a
.tar.xzarchive - Copies it to
plugins/<plugin-name>/<plugin-name>-<version>.tar.xz - Updates the registry file (
index.json)
Example:
# Publish to default location (docs/plugins/)
dr self plugin publish ./my-plugin
# Publish to custom location
dr self plugin publish ./my-plugin --plugins-dir dist/plugins --index dist/plugins/index.json
# Output:
# ✅ Published my-plugin version 1.0.0
# Archive: docs/plugins/my-plugin/my-plugin-1.0.0.tar.xz
# SHA256: abc123...
# Registry: docs/plugins/index.jsonFor more control over the packaging process, you can use the individual commands:
Use dr self plugin package to create a distributable .tar.xz archive:
dr self plugin package <plugin-dir> [flags]Flags:
-o, --output: Output file path or directory (default: current directory)- If path ends with
.tar.xz, uses exact filename - Otherwise treats as directory and creates
<plugin-name>-<version>.tar.xzinside
- If path ends with
--index-output: Save registry JSON fragment to file for use withdr self plugin add --from-file
Requirements:
- Plugin directory must contain a valid
manifest.jsonwithnameandversionfields
The command will:
- Validate the manifest
- Create a compressed
.tar.xzarchive - Calculate SHA256 checksum
- Optionally save metadata to a file for easy registry updates
- Output a JSON snippet ready for your plugin registry
Examples:
# Package to current directory (creates my-plugin-1.0.0.tar.xz)
dr self plugin package ./my-plugin
# Package to specific directory
dr self plugin package ./my-plugin -o dist/
# Package with custom filename
dr self plugin package ./my-plugin -o dist/custom-name.tar.xz
# Package and save metadata for later
dr self plugin package ./my-plugin -o dist/ --index-output /tmp/my-plugin.json
# Output:
# ✅ Package created: dist/my-plugin-1.0.0.tar.xz
# SHA256: abc123...
# 📝 Registry fragment saved to: /tmp/my-plugin.json
#
# Add to registry (index.json):
# ```json
# {
# "version": "1.0.0",
# "url": "my-plugin/my-plugin-1.0.0.tar.xz",
# "sha256": "abc123...",
# "releaseDate": "2026-01-28"
# }
# ```Use dr self plugin add to add the packaged version to your plugin registry.
Option 1: Using saved metadata (recommended):
# Package and save metadata
dr self plugin package ./my-plugin --index-output /tmp/my-plugin.json
# Add to registry using the saved file
dr self plugin add docs/plugins/index.json --from-file /tmp/my-plugin.jsonOption 2: Manual entry:
dr self plugin add <path-to-index.json> \
--name my-plugin \
--version 1.0.0 \
--url my-plugin/my-plugin-1.0.0.tar.xz \
--sha256 abc123... \
--release-date 2026-01-28The add command will:
- Create the registry file if it doesn't exist
- Add a new plugin entry or append a new version to an existing plugin
- Validate that the version doesn't already exist
- Format the registry with proper JSON indentation
Complete workflow example:
# Quick: One command to do it all
dr self plugin publish ./my-plugin
# Or manual workflow:
# 1. Package the plugin and save metadata
dr self plugin package ./my-plugin -o docs/plugins/ --index-output /tmp/my-plugin.json
# 2. Add to registry using saved metadata
dr self plugin add docs/plugins/index.json --from-file /tmp/my-plugin.json
# 3. Commit and publish
git add docs/plugins/
git commit -m "Add my-plugin v1.0.0"
git push