Acquia Source customers can use external AI-powered code editors such as Cursor, Claude Code, Replit, or Lovable to quickly create components of a page in Drupal Canvas.
Use the following checklist to create components of a page with AI:
S.No. | Task |
1 | Configure an API client in Acquia Source |
2 | Create a local codebase |
3 | Create components with an AI agent |
In a terminal window, run the following command to install the CLI tool:
npm install @drupal-canvas/cli -gClick Add API client to start creating a new client.
If you do not want to create a new client, you can edit an existing client.
In the Client ID field, enter a client ID.
Make a note of the client ID and save it to a secure location.
canvas:asset_library and canvas:js_component as scopes.In the User field, configure a user to serve as the author of actions made by this client.
In a terminal window, run the following command to invoke the latest version of the Drupal Canvas create tool published on npm:
npx @drupal-canvas/create@latestScaffold a template repository called Nebula.
This repository contains the default UI components for Acquia Source and is located at [email protected]:acquia/nebula.git.
Verify that the scaffolded repository contains all the folders from the template repository.
The repository includes the ruler/rules folder, which contains AI instructions written to build code components and provide context and prompts for AI coding agents.
From the scaffolded repository, run the following command to apply the Ruler tool with Cursor as the preferred AI coding agent:
npx ruler apply --agents=cursorThe command creates an agents.md file compatible with Cursor.
Run the following command to open Cursor.
cursor .Cursor displays all files and folders of the local codebase, which include:
In the AI Sidebar of Cursor, type Build this page: <page URL>.
<page URL> is the URL of the page whose components are to be created in Drupal Canvas.
Press Enter.
The AI agent builds the components, validates them against the rules defined in the eslint.config file, and fixes any linting errors.
In the AI Sidebar of Cursor, type Upload all these components to Drupal Canvas.
The components are created in the new Acquia Source site and are displayed in the Components panel.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.