Skip to main content

Develop an extension

Development mode lets you edit the files of an installed extension in place and see each change run, without packaging or reinstalling. Edit in the Control Room, from your computer with the Extensions CLI, or through the API, then save the result in Git when you're done.

Development mode applies to one installation in one workspace. Saved changes affect everyone who uses that installation, and automatic updates pause while it is on. To experiment without affecting users, install the extension in a test workspace and develop there.

Before you begin​

  • An administrator account. Only administrators see the Development tab and can turn development on or change files. Anyone who can read the extension can list and download its files.
  • The extension installed in the workspace. To build one from scratch, see Build an extension.

Edit in the Control Room​

  1. Go to Settings → Extensions, open the installed extension, and select the Development tab.
  2. Select Enable development and confirm. The dialog warns: "Changes will run in this live installation and affect its users. Automatic updates will pause. Use a test tenant to develop separately."
  3. Select a file under Extension files, edit it, and select Save and apply. Use New file to add a file and Delete file to remove one.

Each save replaces the file in the installation and refreshes the extension's tools and widgets. If someone else changed the file since you opened it, the save is refused with "The remote file changed. Copy your unsaved text before reopening the file to review the current file." When a save changes the extension's widgets, open pages show a notice with Reload.

The editor opens text files up to 2 MiB. Edit larger or binary files with the CLI or the API.

Select Download installed extension to get a ZIP of the current files.

Some edits are refused, and the previous file stays in place:

  • A manifest.json that changes the extension's id, nameIdentifier or version. Publish a new release for that.
  • Deleting manifest.json.
  • An edit that removes an MCP server, tool or skill that a touchpoint still uses, or that breaks a touchpoint's tool parameters.
  • An edit that removes a source provider that a source still uses.

Edit from your computer​

The Extensions CLI (rationalai-cli-extensions) downloads an installation's files, pushes your changes, and watches a folder. TODO(verify): how developers get the rationalai-cli-extensions binary.

  1. Put an API key in the RATIONAL_API_TOKEN environment variable. See Create an API key.

  2. Save a profile for the workspace's API address:

    rationalai-cli-extensions extensions dev login --profile remote --url https://your-workspace.example/api

    The profile stores the variable's name, not the key. Use --token-env to read another variable, and --auth bearer to send an access token instead of an API key.

  3. Download the files and turn development on:

    rationalai-cli-extensions extensions dev download --profile remote --id EXTENSION_ID --directory ./extension
    rationalai-cli-extensions extensions dev enable --profile remote --directory ./extension
  4. Push your changes, one file at a time or continuously:

    rationalai-cli-extensions extensions dev push --profile remote --directory ./extension --file src/index.ts
    rationalai-cli-extensions extensions dev watch --profile remote --directory ./extension

push without --file uploads every changed file and deletes remote files that no longer exist locally. In a Git checkout it considers the files Git tracks or would add. It never uploads .env files or .rational-development.json. If a remote file changed since your last download, push stops and asks you to pull first.

Rational AI doesn't build anything on save. For a compiled extension, run your compiler or its watch mode locally, and push the generated files.

extensions dev status shows whether development is on. Stopping watch doesn't turn development off.

To test on another installation of Rational AI, create a second profile and install the downloaded ZIP there with extensions dev install --profile local --file downloaded.zip.

Save the result in Git​

  1. If you edited in the Control Room, pull the files into your checkout:

    rationalai-cli-extensions extensions dev pull --profile remote --directory ./extension

    pull refuses to overwrite local changes that conflict with remote ones.

  2. Review the diff with git diff, then commit and push as usual.

  3. Add .rational-development.json to .git/info/exclude. The CLI keeps it to identify the installation and the file hashes.

A download contains the files that are installed. If the extension ships compiled JavaScript, the TypeScript sources aren't in it, so keep them in your repository. To distribute your changes, raise the version and build a new package.

Turn development off​

Select Disable development on the Development tab, or run:

rationalai-cli-extensions extensions dev stop --profile remote --directory ./extension

File edits are locked and the update policy resumes. The current files stay in place until an update or reinstall replaces them, and there is no history to recover overwritten files. Download or commit your work first.

While development is on, the extension can't be updated or uninstalled.

Use the API​

These paths are relative to /api/management/v0. Reading needs read access to the extension. Turning development on or off and changing files need the administrator role.

Method and pathPurpose
GET /extensions/{id}/developmentRead {extensionId, enabled}
PUT /extensions/{id}/developmentSend {"enabled": true} or {"enabled": false}
GET /extensions/{id}/development/filesList relative paths, sizes and SHA-256 hashes
GET /extensions/{id}/development/file?path=…Download a file, with its hash as ETag. Add download=true for an attachment, or maxBytes=N to get 413 for a larger file
PUT /extensions/{id}/development/file?path=…Create or replace a file. The body is the raw file content
DELETE /extensions/{id}/development/file?path=…Delete a file
GET /extensions/{id}/development/exportDownload a ZIP of the installed files

To replace or delete a file only if it hasn't changed, send If-Match: "<sha256>" with its current hash. To create a file only if it doesn't exist, send If-None-Match: *. A failed precondition returns 412. Writing while development is off returns 409.

Paths are relative, at most 512 characters, and can't point into .git, follow a symbolic link or differ from an existing path only in letter case. The installation is limited to 2 GiB and 100,000 files, and manifest.json to 2 MiB.

To follow changes live, connect a SignalR client to /api/extensions/events. Call Subscribe(extensionId) for one installation, SubscribeAll() for all the ones you can read, and Unsubscribe(extensionId) to leave. The ExtensionChanged event carries {extensionId, path}, with path null when development is turned on or off. After you connect or reconnect, subscribe first and then read the file list, so you don't miss changes made while you were disconnected.

Troubleshooting​

SymptomWhat to check
"File edits require development mode on this installation."Development is off. Turn it on from the Development tab or with extensions dev enable.
"Development must preserve installed identity and version. Publish a new release to change them."Your manifest.json changes id, nameIdentifier or version. Restore them.
"Exit development mode before updating this extension."Turn development off before you update or uninstall the extension.
push stops and asks you to pullA remote file changed since your last download. Run extensions dev pull, resolve the changes, then push again.

Next steps​