Problem
I want a "Run" command bound to CMD+R that runs my project's dev/run script (e.g. bun dev, pnpm dev) in the focused chat's worktree, so I can iterate without leaving Acepe.
Current behavior
- Keybinding registry:
packages/desktop/src/lib/keybindings/bindings/defaults.ts:16-236 defines DEFAULT_KEYBINDINGS. No binding for $mod+r / "project.run" exists.
- Current
$mod+ bindings include: t → THREAD_CREATE, w → THREAD_CLOSE, p → command palette, etc.
- Registration flow:
KeybindingManager.registerKeybindings() (keybinding-manager.ts:53) calls keybindingsService.upsertAction(); handlers wired in separate methods (e.g. setThreadCreateHandler line 223).
- No Tauri global shortcuts are registered — all shortcuts are in-app via
tinykeys.
- No "run project" infrastructure exists today (no Tauri command for running an arbitrary shell process, no UI pane for stdout/stderr of a run script).
Proposed change
1. Config
Extend .acepe.json schema + global Settings:
Auto-detect from package.json scripts (prefer dev, start, serve in that order).
2. Hotkey
Add to defaults.ts:
{ key: "$mod+r", command: KEYBINDING_ACTIONS.PROJECT_RUN, when: "threadActive && !settingsOpen && !modalOpen" }
Register corresponding handler in KeybindingManager.
3. Execution
New Tauri command project_run_start(panel_id, cwd, command):
- Spawns the run command in the worktree cwd (or main repo cwd if no worktree).
- Reuses the env-allowlist machinery from
worktree_config.rs:32-62.
- Streams stdout/stderr as Tauri events
project:run-output tagged by panel_id.
- Tracks the child PID so
project_run_stop(panel_id) can SIGTERM → SIGKILL it.
4. UI
- New "Run" pane attached to the agent panel (collapsible, like the terminal pane). Shows streaming output, status (running/stopped/crashed), exit code.
- Visual indicator in the panel header when a run is active.
CMD+R toggles: starts if idle, no-ops / focuses pane if running. CMD+SHIFT+R restarts.
- Confirmation or idempotency check to avoid spawning duplicate processes.
5. Lifecycle
- Run processes attached to a panel should be SIGTERMed when the panel is closed.
- If the worktree is deleted (
git worktree remove), the run process is stopped first.
Files to touch
packages/desktop/src-tauri/src/git/worktree_config.rs:66-80 — schema.
- New:
packages/desktop/src-tauri/src/project/run.rs (or similar) + wiring in lib.rs.
packages/desktop/src/lib/keybindings/bindings/defaults.ts:16-236 + keybinding-manager.ts:53 — new binding + handler.
packages/desktop/src/lib/acp/components/agent-panel/ — new Run pane + store.
Acceptance criteria
Problem
I want a "Run" command bound to
CMD+Rthat runs my project's dev/run script (e.g.bun dev,pnpm dev) in the focused chat's worktree, so I can iterate without leaving Acepe.Current behavior
packages/desktop/src/lib/keybindings/bindings/defaults.ts:16-236definesDEFAULT_KEYBINDINGS. No binding for$mod+r/ "project.run" exists.$mod+bindings include:t → THREAD_CREATE,w → THREAD_CLOSE,p → command palette, etc.KeybindingManager.registerKeybindings()(keybinding-manager.ts:53) callskeybindingsService.upsertAction(); handlers wired in separate methods (e.g.setThreadCreateHandlerline 223).tinykeys.Proposed change
1. Config
Extend
.acepe.jsonschema + global Settings:{ "worktree": { "runCommand": "bun dev", // single string, or "runCommands": ["bun dev"], // array for composed setups "runCwd": "." // relative to worktree root } }Auto-detect from
package.jsonscripts (preferdev,start,servein that order).2. Hotkey
Add to
defaults.ts:Register corresponding handler in
KeybindingManager.3. Execution
New Tauri command
project_run_start(panel_id, cwd, command):worktree_config.rs:32-62.project:run-outputtagged bypanel_id.project_run_stop(panel_id)can SIGTERM → SIGKILL it.4. UI
CMD+Rtoggles: starts if idle, no-ops / focuses pane if running.CMD+SHIFT+Rrestarts.5. Lifecycle
git worktree remove), the run process is stopped first.Files to touch
packages/desktop/src-tauri/src/git/worktree_config.rs:66-80— schema.packages/desktop/src-tauri/src/project/run.rs(or similar) + wiring inlib.rs.packages/desktop/src/lib/keybindings/bindings/defaults.ts:16-236+keybinding-manager.ts:53— new binding + handler.packages/desktop/src/lib/acp/components/agent-panel/— new Run pane + store.Acceptance criteria
CMD+Rin a focused chat starts the project's run script in that chat's worktree.CMD+Ris a no-op (or focuses the run pane) if already running;CMD+SHIFT+Rrestarts.package.jsonscripts when norunCommandis configured.