UiPath Documentation
industry-department-solutions
latest
false
Supply Chain & Retail Solutions user guide

Using the Autopilot plugin for Claude Code

Build and edit Canvas dashboards as local files with the Autopilot plugin for Claude Code, from installation and credentials to preview and publishing.

The Autopilot plugin for Claude Code lets developers build and edit the Canvas dashboards of Autopilot for Retail & Supply Chain as local files. You pull a dashboard into a project folder, edit it in your own editor with Claude, check it locally, and publish a new version to the platform.

How the plugin works​

A dashboard becomes a React and TypeScript project in a folder that you own. You can keep it in a Git repository and apply your own review and release process. The work follows this sequence:

  1. The plugin pulls the dashboard into a local folder.
  2. You edit the files with Claude.
  3. The plugin validates the changes with the same checks that the platform runs.
  4. You preview the dashboard locally.
  5. The plugin creates a new version on the platform.
  6. You publish the version.

Creating a version doesn't publish it. Other users see a version only after you publish it.

Prerequisites​

Before installing the plugin, ensure you have the following:

  • Claude Code.
  • Python 3, Git, and Node.js 18 or later.
  • An account on the tenant whose dashboards you want to edit.
  • A personal access token for that account. To create one, select your profile icon, then select Access Tokens.

Only the owner of a dashboard can create or publish versions of it.

Installing the plugin​

Follow these steps to install the plugin in Claude Code:

  1. Run /plugin marketplace add PeakBI/claude-plugins.
  2. Run /plugin install autopilot.
  3. Run /autopilot:canvas-onboard.

The last command installs the local tools, helps you store your credentials, and checks your access. For details on installing plugins, see Install and manage plugins in the Claude Code documentation.

Storing your credentials​

The plugin reads your credentials from a .env.peak file in the project folder, or from ~/.config/peak-canvas/env for all projects.

VariableValue
PEAK_AUTH_TOKENYour personal access token.
STAGEprod
Warning:

Never paste your personal access token into the Claude chat. Enter it only in your terminal or in the credentials file.

Building a dashboard locally​

Follow these steps to change a dashboard and publish it:

  1. In an empty folder, run /autopilot:canvas-init --conversation <conversation_id>. The conversation ID is in the address of the dashboard page.
    • To start a new dashboard, run /autopilot:canvas-init --new "My dashboard" --prompt "A sales overview with a revenue KPI and a monthly trend chart".
  2. Ask Claude to change the dashboard, or edit the files under src/.
  3. Run /autopilot:canvas-validate.
  4. Run /autopilot:canvas-preview to preview the dashboard with live data, or add --sample to preview it offline with sample data. Open the address that the command prints.
  5. Run /autopilot:canvas-create to create a new version.
  6. Run /autopilot:canvas-create --publish to publish the version.

The src/lib/ folder holds the shared platform components and is read-only. Put your own code in src/pages/, src/components/, and src/utils/.

The canvas.lock.json file records the dashboard and the version that the folder is bound to, so don't edit it. When you create a version, the plugin checks the files that it uploads and stops if a file contains what looks like a key or a token.

Command reference​

CommandDescription
/autopilot:canvas-onboardInstalls the local tools, stores your credentials, and checks your access.
/autopilot:canvas-initBinds a folder to a dashboard, or starts a new dashboard locally.
/autopilot:canvas-pullDownloads a dashboard version or a template again.
/autopilot:canvas-validateRuns the platform checks locally.
/autopilot:canvas-dataPlans and checks the data queries against the metrics and actions.
/autopilot:canvas-namespacesLists the metrics groups that your tenant can query, or sets your default one.
/autopilot:canvas-previewOpens a local preview with live data, or offline with sample data.
/autopilot:canvas-createCreates a new version from the local files. It can also publish the version or save it as a template.
/autopilot:canvas-syncFinds and reconciles differences between the local files and the platform.
/autopilot:canvas-doctorDiagnoses problems with the setup, credentials, and access.
/autopilot:canvas-helpLists the commands, or the options of one command.

Keeping local files in sync​

/autopilot:canvas-create stops when the platform has a newer version than your local files, for example after a change in the dashboard editor. Run /autopilot:canvas-sync to bring the newer version in, then validate and create again. If you also changed the local files, the plugin puts the platform version on a separate Git branch for you to merge, so keep the project folder in a Git repository.

Working with templates​

  • To start a dashboard from a template, run /autopilot:canvas-init --new "My dashboard" --template <template_id> --namespace <namespace>.
  • To save a dashboard as a template, run /autopilot:canvas-create --as-template "Name".

For details on templates, see Working with dashboard templates.

Troubleshooting​

  • The plugin finds no token: run /autopilot:canvas-doctor. It shows where the plugin looks for credentials and how to store them.
  • Validation or the preview doesn't start: install Node.js 18 or later, then run the command again.
  • Creating or publishing a version is refused after validation passed: check that your token belongs to the owner of the dashboard, and run /autopilot:canvas-validate again after your last edit.

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated