- Overview
- Platform setup and administration
- Platform setup and administration
- Platform architecture
- Data Bridge onboarding overview
- Connecting a Peak-managed data lake
- Connecting a customer-managed data lake
- Creating an AWS IAM role for Data Bridge
- Connecting a Snowflake data warehouse
- Connecting a Redshift data warehouse (public connectivity)
- Connecting a Redshift data warehouse (private connectivity)
- Reauthorizing a Snowflake OAuth connection
- Using Snowflake with Peak
- SQL Explorer overview
- Roles and permissions
- User management
- Autopilot for Retail & Supply Chain
- Inventory management solution
- Commercial pricing solution
- Merchandising solution
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:
- The plugin pulls the dashboard into a local folder.
- You edit the files with Claude.
- The plugin validates the changes with the same checks that the platform runs.
- You preview the dashboard locally.
- The plugin creates a new version on the platform.
- 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:
- Run
/plugin marketplace add PeakBI/claude-plugins. - Run
/plugin install autopilot. - 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.
| Variable | Value |
|---|---|
PEAK_AUTH_TOKEN | Your personal access token. |
STAGE | prod |
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:
- 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".
- To start a new dashboard, run
- Ask Claude to change the dashboard, or edit the files under
src/. - Run
/autopilot:canvas-validate. - Run
/autopilot:canvas-previewto preview the dashboard with live data, or add--sampleto preview it offline with sample data. Open the address that the command prints. - Run
/autopilot:canvas-createto create a new version. - Run
/autopilot:canvas-create --publishto 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
| Command | Description |
|---|---|
/autopilot:canvas-onboard | Installs the local tools, stores your credentials, and checks your access. |
/autopilot:canvas-init | Binds a folder to a dashboard, or starts a new dashboard locally. |
/autopilot:canvas-pull | Downloads a dashboard version or a template again. |
/autopilot:canvas-validate | Runs the platform checks locally. |
/autopilot:canvas-data | Plans and checks the data queries against the metrics and actions. |
/autopilot:canvas-namespaces | Lists the metrics groups that your tenant can query, or sets your default one. |
/autopilot:canvas-preview | Opens a local preview with live data, or offline with sample data. |
/autopilot:canvas-create | Creates a new version from the local files. It can also publish the version or save it as a template. |
/autopilot:canvas-sync | Finds and reconciles differences between the local files and the platform. |
/autopilot:canvas-doctor | Diagnoses problems with the setup, credentials, and access. |
/autopilot:canvas-help | Lists 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-validateagain after your last edit.