Skip to content

DataRobot OpenCode plugin

The dr opencode plugin connects OpenCode (an open source AI coding agent that runs in your terminal) directly into the DataRobot LLM Gateway. Every model your account has access to through DataRobot is available inside a single tool, allowing you to switch models to suit the task at hand. The plugin also installs DataRobot agent skills, including the Agent Assist skill.

クイックスタート

To use the DataRobot OpenCode plugin, in a DataRobot codespace or on your local machine, ensure you have the following:

  • A DataRobot account with LLM Gateway access.

  • The DataRobot CLI.

    If you're running OpenCode locally (not in a codespace) and don't have dr yet, install it with Homebrew:

    brew install datarobot-oss/taps/dr-cli 
    

    See Getting started for other installation methods (Linux, Windows, or a specific version).

Run the commands outlined below in the terminal of your preferred environment.

First, if you are using an older version of the CLI, update it to a version that supports the opencode plugin (v0.2.76 or later):

dr self update --force 

Then, install the plugin and launch OpenCode:

# Install the OpenCode plugin
dr plugin install opencode

# Launch OpenCode
dr opencode 

If you haven't already authenticated the CLI, dr opencode runs dr auth login first, since the plugin requires DataRobot credentials to reach the LLM Gateway. From there, the first launch installs the OpenCode binary for your platform and starts the terminal UI in your current directory. A DataRobot theme is active by default the first time you launch OpenCode. If you switch to a different theme with /themes (or the keybind Ctrl+X, then T), that choice is remembered on future dr opencode launches—there's no config file to edit by hand.

Codespace terminal

Inside a codespace, open the integrated terminal and run the same three commands. If DATAROBOT_API_TOKEN and DATAROBOT_ENDPOINT are already set in that environment, you may not need to run dr auth login separately.

Plugin configuration

Each time you run dr opencode, the plugin generates a fresh OpenCode config in its own config directory—$XDG_CONFIG_HOME/datarobot/opencode (or ~/.config/datarobot/opencode if XDG_CONFIG_HOME isn't set)—and points OpenCode at it for that session.

Config separation

The plugin's config is separate from OpenCode's own default config location, so it never conflicts with an existing global OpenCode setup.

Because the plugin's manifest requires authentication, dr automatically forwards your DataRobot endpoint and API token to that process. The generated config uses them to register a datarobot provider backed by your organization's LLM Gateway catalog (defaulting to a Claude Sonnet 4.6 model from whichever provider offers one, or otherwise the first model in your catalog, until you pick one yourself).

Inside an OpenCode session, list and switch models with the /models command (or the keybind Ctrl+X, then M):

/models 

Models appear as datarobot/<model-name>. You can also cycle recently used models with F2, or pin a specific model for a single launch:

dr opencode --model datarobot/<model-name> 

This lets you pick a different model per task—for example, a fast model for quick edits and a stronger reasoning model for a tricky refactor—without leaving your terminal.

Config files are regenerated on every launch

The generated opencode.json and tui.json are rebuilt from scratch each time you run dr opencode, so don't hand-edit them—changes won't survive the next launch. The one exception is your model and theme picks: whatever you last selected with /models or /themes is read back from OpenCode's own state (~/.local/state/opencode) and carried forward automatically, instead of resetting to the DataRobot default every time.

Use DataRobot agent skills

The generated config also registers the opencode-datarobot-skills plugin, which installs the DataRobot agent skills (including Agent Assist) and DataRobot theme variants into OpenCode's skills and themes directories the first time it runs.

OpenCode surfaces installed skills to the agent automatically through its built-in skill tool—you don't need to load them manually. To see what's available or trigger one, just ask in the session, for example:

What DataRobot skills are available?
Use the datarobot-model-deployment skill to deploy this model. 

Already using Agent Assist?

If you've already configured Agent Assist's external LLM settings, dr opencode picks up the same environment variables and routes to that model instead of the LLM Gateway catalog—no extra setup required:

特徴量 Effect in dr opencode
AGENT_ASSIST_LLM_BASE_URL Adds the external model as an agent-assist provider and sets it as the default, alongside the LLM Gateway models.
AGENT_ASSIST_LLM_MODEL_NAME The model name used for that provider.
AGENT_ASSIST_LLM_API_KEY Credential for the external provider; also becomes the LLM Gateway catalog credential if no base URL is set.
AGENT_ASSIST_DISABLE_LLM_GATEWAY Skips the LLM Gateway catalog fetch entirely and uses only the external model (requires AGENT_ASSIST_LLM_BASE_URL and AGENT_ASSIST_LLM_MODEL_NAME).

See the environment and commands reference for what each variable does in Agent Assist itself.

Update or remove the plugin

To update the plugin to the latest version, run:

dr plugin update opencode 

To remove the plugin, run:

dr plugin uninstall opencode 

For more information, see the following documentation: