AI coding agents can use the Plotly Cloud CLI to build, iterate on, and deploy Dash apps. This page covers how to set up your environment so agents can publish to Plotly Cloud.
AI agents that have shell access—such as Claude Code, Cursor, Windsurf, and GitHub Copilot—can run CLI commands on your behalf. With the Plotly Cloud CLI installed and authenticated, an agent can:
plotly app runplotly app publishplotly app statusMake sure dash[cloud] is installed in the environment your agent uses:
pip install "dash[cloud]"
Agents cannot complete the browser-based login flow on their own, so log in before starting your agent session:
plotly user login
The agent will then use your existing credentials for any CLI commands it runs. This means the agent operates with your personal permissions—it can access any apps and teams that you have edit permissions on.
Recommended: Always use personal authentication (
plotly user login) with AI agents rather than API keys. This ensures the agent’s actions are scoped to your own permissions and are traceable to your account.
A typical agent workflow looks like this:
px.data.iris()) with dropdowns to select the x and y columns.The agent writes the code and can run it locally:
bash
plotly app run
The agent runs:
bash
plotly app publish --name iris-explorer
plotly app run during development and only plotly app publish when you’re ready to deploy.plotly app status read from plotly-cloud.toml in the current directory. If the agent changes directories, these commands will fail.--name when publishing so the agent doesn’t prompt for input interactively. After the first publish, the name is saved in plotly-cloud.toml.plotly app publish waits for the deployment to finish by default, so the agent will know when the app is live without any extra steps.plotly app publish without --name to push updates to the same app.app_url in plotly-cloud.toml to a human-readable slug and re-publish. See Custom App URLs.Claude Code has shell access and can run plotly commands in its tool calls. Install and authenticate before starting your session.
These IDE-based agents run commands in the integrated terminal. Ensure dash[cloud] is installed in the Python environment selected by your IDE.
Copilot’s terminal agent can run CLI commands when you use @terminal. Make sure your VS Code terminal has dash[cloud] installed and is authenticated.
Agents running in non-interactive environments (containers, cloud VMs) cannot complete the browser-based OAuth flow required by plotly user login. Use an API key for authentication instead.
"Invalid token - credentials cleared"
This error message means that your session has expired. Run plotly user login again yourself, then resume the agent session. You can verify credentials are working with plotly user whoami.