Introduction
@livepreso/cdk is the content developer kit. It serves a deck from disk, and draws it inside replicas of the app's
screens. You can then develop a slide against every place the app will show it.
The CDK renders what the deck's build wrote to dist/. Run the build at the same time. It rewrites dist/ on every
change, and the CDK redraws.
Installing​
The CDK is a dev dependency of the deck:
npm install --save-dev @livepreso/cdk
The package installs the livepreso-cdk command. dev takes the deck directory and serves the CDK against it:
livepreso-cdk dev .
The address comes from the deck's name in package.json, so a deck keeps the same port between runs.
The pages​
Preview​
The Preview page draws the deck on a stage, inside one mode: prepping a preso, presenting it, reviewing a finished one, or a template in PresoManager. The mode sets the body classes the deck's CSS reads. It also chooses whether the stage shows the Slides tab or the Templates tab.
The dock underneath shows:
- the fields the build published
- a log of every action a slide ran
- each change to a stored value
- the slide's console output
Fixtures​
On the Fixtures page you choose what the deck renders against:
- a context
- a file per feed
- the appointment, tenancy and user envs
- a customer, with the contacts attending
- a set of CMS values
Every choice comes from a file in the .cdk folder.
Hooks​
The Hooks page runs the fieldsets hook the deck exports. That hook builds the form the app shows when a salesperson
creates a preso. An intercept in .cdk/intercepts catches each request the form makes, so you can try the form against
a missing result or a failure. The panel beside the form logs each hook call, and the context a save produced.
Commands​
| Command | What it does |
|---|---|
livepreso-cdk dev <dir> | Serves the CDK against a deck directory. |
livepreso-cdk check <dir> | Opens every slide in one mode, reports any that failed, and compares screenshots with an earlier run. |
livepreso-cdk capture <dir> | Screenshots every slide in one or more modes, and writes a page showing them side by side. |
livepreso-cdk mcp | Starts an MCP server, so an AI tool can drive the deck the CDK is serving. |
livepreso-cdk feed add <file> --name <name> | Splits one JSON file of feed payloads into a fixture per feed. |
check and capture drive the running CDK with headless Chrome, so start dev for that deck first.
| Option | On | Meaning |
|---|---|---|
--mode <path> | check | The mode to render in. Defaults to app/preso/prep/prepping. |
--mode <paths...> | capture | The modes to capture, one column each. |
--fixtures <name> | check capture | Applies the fixture with this name in every kind that has one. See One name, every kind. |
--only <targets...> | check capture | Opens only these slides. * matches any run of characters, as in pricing/*. |
--concurrency <number> | check capture | How many pages to open at once. |
--compare <dir> | check | An earlier run to compare against. A regression fails the command, so CI fails too. |
--pixel-threshold <number> | check | How much of a screenshot has to change before --compare reports it, from 0 to 1. |
check and capture write to .livepreso-check/ in the deck, unless --out names another directory.
MCP​
livepreso-cdk mcp starts an MCP server over stdio. An AI tool can then read the deck the CDK is serving, change the
mode, apply fixtures, read and edit content through the deck interface, read the dock logs, and run a check.
The AI tool starts the server itself, so register the command in its MCP config file. Claude Code reads .mcp.json in
the deck:
{
"mcpServers": {
"cdk": {
"command": "./node_modules/.bin/livepreso-cdk",
"args": ["mcp"]
}
}
}
The server connects to the deck in the directory it starts in. Give it --project-dir where the tool starts somewhere
else:
"args": ["mcp", "--project-dir", "/absolute/path/to/the/deck"]
The tools read and drive the running CDK, so start livepreso-cdk dev first. The server finds the port the same way the
CDK does, from the deck's name in package.json. A tool started outside a deck connects with connect_to_project,
which takes the absolute path.