Skip to content

Develop

This section is for people who want to change cmdAbl: fix a bug, add a command, or improve the documentation. You do not need it to use cmdAbl.

Get the Ableton Extensions SDK

cmdAbl is built on the Ableton Extensions SDK. Its license allows building and distributing extensions, but not distributing the SDK itself, so the SDK is not in this repository. Get the SDK and CLI packages from Ableton's Extensions beta and put them into the vendor/ folder, with the file names that package.json names:

  • vendor/ableton-extensions-sdk-1.0.0-beta.1.tgz
  • vendor/ableton-extensions-cli-1.0.0-beta.1.tgz

You also need Node 24.16 or newer.

Build, test and run

Run these from the repository root:

Command What it does
npm install Installs the dependencies, including the SDK from vendor/.
npm test Runs the unit tests. They need no Live.
npm run build Type-checks and builds the production bundle.
npm start Type-checks, builds and runs cmdAbl in Live's Extension Host. Turn on Developer Mode in Live first. Only one Extension Host connects at a time, so only one copy of cmdAbl runs.
npm run package Builds the .ablx into the project root.
npm run docs:reference Regenerates the reference pages (reference/commands.md, reference/remote-script.md, reference/live-api.md) from the code. Never edit those pages by hand.

An installed build is sandboxed: it may read only Live's Extensions and Extensions Data folders and its temp folder. A development run (npm start) is presumably not sandboxed (not verified), so a file access that works in development can fail once installed. Test file access with the installed .ablx. A development run can see the User Library, so it can say "Remote Script not installed" or "installed Remote Script is outdated" about the copy there. The installed build cannot, and says "not running" instead.

The terminal of npm start shows the extension's log lines with milliseconds: HH:MM:SS.mmm cmdAbl [<source>] …. Filter on cmdAbl [ there. The log lines of the Remote Script are not in that terminal; they are in Live's Log.txt (see The Remote Script).

Test the Remote Script

The Remote Script's protocol tests are Python, with the standard library only:

python3 -B -m unittest discover -s tests/remote-script

Testing in Live with MCP

A development run (npm start) can run command lines without a dialog, so a coding agent can test commands in a real Live Set. A packaged .ablx has none of this.

Warning: this changes the open Live Set. Use a test Set, and do not work in Live while a test runs.

The two routes. In a development run, cmdAbl offers two local routes on its trigger port, 127.0.0.1:27184:

  • POST /run with {"line": "…"} runs one command line without any dialog.
  • GET /log?n= returns the last n log lines.

Both need a Bearer token (an access key sent in the Authorization header). cmdAbl writes it at each start to a run-token file in its Extensions Data folder, readable by you only. Browser pages are refused. Never paste or print the token.

What a run does:

  • An ambiguous address ends with exit code 4 and lists the candidates.
  • Questions, pick lists and pages are skipped, and the answer names them.
  • Messages are captured and returned in the answer.
  • One run is one undo step.
  • A run is not added to the history.

When it says no. A run answers 409 (busy) while another run is going or a palette or dialog is open. A run that takes longer than 10 seconds answers 504. POST /reset releases a run that is stuck.

The MCP server. MCP (Model Context Protocol) lets a coding agent call tools. The server is in tools/mcp/. The project's .mcp.json registers it (npx tsx tools/mcp/main.ts); npm run mcp starts it by hand. Its tools:

Tool What it does
cmdabl_run(line) Runs one command line, like POST /run.
cmdabl_log(n) Returns the last n log lines.
cmdabl_bridge() Says whether the Remote Script is connected and how fast it answers.
cmdabl_state() Says whether a palette or dialog is open, so a run would be busy.
cmdabl_show(line) Opens a command's dialog in Live, as if typed in the palette, and returns at once. An empty line opens the empty palette.
cmdabl_keys(text, key) Brings Live to the front and types text or presses one key from a short allowed list. Needs Accessibility access for your terminal app.
cmdabl_capture(name, target) Saves one Live window to captures/<name>.png (not committed): dialog is the frontmost cmdAbl dialog, live is Live's main window.
cmdabl_record(name, seconds) Records Live's main window for 1 to 30 seconds to captures/<name>.mov (not committed). It returns at once; then do the actions with cmdabl_show and cmdabl_keys. Needs Screen Recording access for your terminal app.
cmdabl_record_status(name) Says whether the recording is still running or done, and how big the file is.
cmdabl_convert(name, format, width, crop) Turns the recording into captures/<name>.mp4 or .gif with ffmpeg. crop is w:h:x:y in source pixels.

When cmdAbl is not running, the tools say so within about 12 seconds.

How to use it:

  1. Open a test Set in Live.
  2. Start npm start.
  3. Start Claude Code in the repository and allow the project's MCP server.
  4. Run test lines with cmdabl_run and check the log lines with cmdabl_log. To look at a dialog, open it with cmdabl_show, capture it with cmdabl_capture and close it with cmdabl_keys. A capture can show private names, so check it before you use it anywhere.

Recordings. A recording is of a screen area, not of one window: whatever covers Live is recorded too, such as a notification. Turn on Do Not Disturb first, and check every frame before you use a recording. cmdabl_keys takes delayMs, a pause after each typed character, so typing in a recording reads well. Before a take, reset the Set the way it was.

Dialog screenshots. The docs site shows every image on a lighter "stage". A dialog image must therefore end exactly at the dialog window's edge, with nothing of Live around it and transparent rounded corners. Run each capture of a dialog through scripts/trim-shot.py (needs Pillow):

python3 scripts/trim-shot.py captures/palette.png docs/assets/images/palette.png

It finds the dialog's border, crops to it and makes the corners transparent, and prints the box it used. For a GIF it crops every frame the same way and gives all frames one shared palette, which keeps the file small. Check the edges of the result. If detection is wrong (a scrollbar at the edge can confuse it), give the box yourself with --box l,t,r,b. Do not use it on images of Live itself or on recordings of Live's window.

What needs eyes or hands stays manual: Cmd+Z and moving a control.

Build the docs site

The docs site is built with MkDocs:

pip install "mkdocs-material==9.*" "mkdocs<2"
mkdocs build --strict

--strict fails on a broken link. Run it before you commit a docs change.

npm run docs:check runs the same docs checks as CI: it checks that the committed command reference pages match the code (it prints the fix when one is stale), then runs mkdocs build --strict. It needs mkdocs installed (the pip install line above).

To run it automatically before every git push that touches docs/, mkdocs.yml or src/, turn on the optional hook once per clone:

git config core.hooksPath .githooks

Pull requests

Use one branch per topic and open a pull request into main. These checks run on a pull request:

  • script-tests runs the Remote Script's Python tests. It needs no SDK, so it also runs for pull requests from forks.
  • build runs the unit tests, checks that the reference pages are up to date, and packages the .ablx. It needs the private SDK, which GitHub does not give to pull requests from forks. For a fork, build fails on purpose with a clear message, and a maintainer runs it from a branch in the main repository before merging.
  • docs-build builds the docs site, when the pull request touches docs/ or mkdocs.yml.
  • gitleaks scans for secrets.

How the code is organised

The project also uses a team of Claude agents with fixed areas. How they work is in CLAUDE.md.