This guide explains how to integrate the Demo Time Companion app with your VS Code demos.
-
Start the Companion App
cd apps/companion-app yarn tauri:devThe app will start and launch an API server on
http://127.0.0.1:42042 -
Test the API
# Check if the app is running curl http://127.0.0.1:42042/health # Toggle blur curl -X POST http://127.0.0.1:42042/action \ -H "Content-Type: application/json" \ -d '{"action": "blur.toggle"}' # Show a message curl -X POST http://127.0.0.1:42042/action \ -H "Content-Type: application/json" \ -d '{"action": "message.show", "params": {"text": "Switching to slides..."}}'
Add terminal commands to your .demo/demo.json:
{
"demos": [
{
"title": "My Presentation",
"steps": [
{
"action": "executeCommand",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "curl -X POST http://127.0.0.1:42042/action -H 'Content-Type: application/json' -d '{\"action\": \"blur.on\"}'\n"
},
"description": "Enable blur overlay"
},
{
"action": "openSlide",
"file": "slides/intro.md",
"description": "Show intro slide"
},
{
"action": "executeCommand",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "curl -X POST http://127.0.0.1:42042/action -H 'Content-Type: application/json' -d '{\"action\": \"blur.off\"}'\n"
},
"description": "Disable blur overlay"
}
]
}
]
}Create a VS Code extension or add to your workspace settings:
// example-extension.ts
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
// Register command to toggle blur
let blurCommand = vscode.commands.registerCommand('demotime.companion.blur', async () => {
try {
const response = await fetch('http://127.0.0.1:42042/action', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action: 'blur.toggle' })
});
const result = await response.json();
vscode.window.showInformationMessage(result.message);
} catch (error) {
vscode.window.showErrorMessage('Failed to toggle blur');
}
});
context.subscriptions.push(blurCommand);
}Create a custom action type in Demo Time that calls the companion API:
{
"demos": [
{
"title": "My Demo",
"steps": [
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "blur.on"
},
"description": "Enable blur"
}
]
}
]
}The companion app provides global keyboard shortcuts:
// In your demo, mention to use the shortcuts
// Default shortcuts:
// - Cmd/Ctrl + Shift + B: Toggle Blur
// - Cmd/Ctrl + Shift + L: Toggle Spotlight
// - Cmd/Ctrl + Shift + =: Zoom In
// - Cmd/Ctrl + Shift + -: Zoom Out
// - Cmd/Ctrl + Shift + 0: Reset Zoom{
"steps": [
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "message.show",
"params": {
"text": "Switching to slides..."
}
}
},
{
"action": "wait",
"duration": 1000
},
{
"action": "openSlide",
"file": "slides/overview.md"
},
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "message.hide"
}
}
]
}{
"steps": [
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "spotlight.on"
}
},
{
"action": "highlight",
"file": "src/main.ts",
"lines": [10, 25]
},
{
"action": "wait",
"duration": 3000
},
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "spotlight.off"
}
}
]
}{
"steps": [
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "zoom.set",
"params": {
"level": 2.0
}
}
},
{
"action": "openFile",
"file": "src/details.ts",
"line": 42
},
{
"action": "wait",
"duration": 5000
},
{
"action": "http",
"url": "http://127.0.0.1:42042/action",
"method": "POST",
"body": {
"action": "zoom.reset"
}
}
]
}All available actions can be found in the README.md.
Quick reference:
blur.toggle/blur.on/blur.offspotlight.toggle/spotlight.on/spotlight.offzoom.in/zoom.out/zoom.reset/zoom.setmessage.show/message.hide
- Check if the companion app is running
- Verify the port 42042 is not in use by another application
- Check firewall settings
- Ensure the companion app has the necessary permissions
- On macOS, check System Preferences > Security & Privacy > Accessibility
- Verify overlay windows are not being blocked
- Check for conflicts with other applications
- Customize shortcuts in the companion app settings
- Ensure the app has accessibility permissions
- Start the companion app before your presentation - Add it to your pre-presentation checklist
- Test your API calls - Run through your demo once to verify all API calls work
- Keep messages short - Message overlays should be brief and clear
- Use blur sparingly - Blur is best for quick transitions, not long periods
- Customize keyboard shortcuts - Set shortcuts that don't conflict with your other tools
- Consider audience visibility - Test zoom levels and spotlight sizes with different screen sizes
Planned features for future releases:
- Drawing tools (arrows, boxes, annotations)
- Multi-screen support
- Launch on login
- Profile presets for different presentation types
- WebSocket support for real-time updates
For issues, feature requests, or questions: