Skip to content

04. Builtin Commands

1. Goal

Define first-party command palette entries available without plugins.

Shortcut: Cmd/Ctrl + Shift + P (D014)

2. Command ID convention

text
builtin.<domain>.<action>

3. MVP builtin catalog

idtitlekeywordscategoryriskbehavior
builtin.session.newNew Tasknew, task, sessionSessionlowcreate session and focus composer
builtin.session.deleteDelete Current Sessiondelete, sessionSessionmediumconfirm then delete active session
builtin.session.renameRename Current Sessionrename, sessionSessionlowopen rename UI
builtin.mode.planSwitch to Planmode, plan, planningModelowset idle session mode=plan
builtin.mode.goalSwitch to Goalmode, goal, objective, autonomousModelowset idle session mode=goal
builtin.mode.agentSwitch to Agentmode, agent, executeModelowset idle session mode=agent
builtin.agent.abortAbort Active Turnabort, stopAgentlowabort current turn/permission wait
builtin.agent.compactCompact Conversation Contextcompact, context, tokensAgentlowcreate a model-context checkpoint for the idle active session
builtin.project.openOpen Projectopen, project, folderProjectlowopen folder picker and bind workspace
builtin.project.clearClear Projectclear, projectProjectlowunbind workspace
builtin.settings.openOpen Settingssettings, preferencesApplownavigate settings root
builtin.settings.providersOpen Provider Settingsprovider, model, keySettingslownavigate Settings → Agent → Providers card
builtin.plugins.openOpen Pluginsplugins, extensionsPluginslownavigate plugins page
builtin.plugins.loadDevLoad Development Pluginload, dev, pluginPluginsmediumchoose local plugin directory
builtin.commandPalette.showShow Command Palettepalette, commandsApplowopen palette
builtin.app.reloadWindowReload Windowreload, windowApplowrenderer reload
builtin.app.toggleDevtoolsToggle DevToolsdevtools, debugDebuglowtoggle devtools (dev/nightly)
builtin.logs.openOpen Logslogs, diagnosticsDiagnosticslowopen logs panel/path

Keep MVP set small. Plugin commands extend this list dynamically.

4. Visibility rules

  • Debug commands may be hidden in production release builds
  • Plugin management commands always available
  • Project commands available even without active session
  • SubmitPlan and SubmitGoal are model tools, not palette commands. Mode commands are accepted only for an idle session; there is no Chat mode or request-changes alias.
  • Mode commands use the same active-session configuration path as the Composer Agent/Plan/Goal chip. When no session is active, they update the persisted default for the next session; a running session or pending approval is not changed.

5. Execution results

Commands return:

ts
type CommandExecutionResult =
  | { ok: true; navigation?: string; message?: string }
  | { ok: false; error: AppError }

6. Acceptance

  1. All builtin IDs are unique and prefixed
  2. Palette search matches title/keywords
  3. Mode switch commands update the idle session mode immediately; Plan, Goal, and Agent refer to the same pi Agent
  4. Abort command works during stream and permission pending
  5. Compact works while idle even when automatic context protection is disabled and returns AGENT_BUSY during an active turn/checkpoint

7. Composer slash aliases (D123, ADR 0024)

Builtin commands surface in the composer / menu through short aliases defined in the same registry that feeds palette search (electron/main/builtin-commands.ts); execution reuses the renderer switch.

aliaspalette id
/newbuiltin.session.new
/delete-taskbuiltin.session.delete
/abortbuiltin.agent.abort
/compactbuiltin.agent.compact
/agent-modebuiltin.mode.agent
/plan-modebuiltin.mode.plan
/goal-modebuiltin.mode.goal
/open-projectbuiltin.project.open
/clear-projectbuiltin.project.clear
/settingsbuiltin.settings.open
/providersbuiltin.settings.providers
/importbuiltin.settings.import
/pluginsbuiltin.plugins.open
/load-pluginbuiltin.plugins.loadDev
/logsbuiltin.logs.open

Aliases share one namespace with template and plugin command names; builtin aliases win collisions, then project templates, then user templates, then plugin commands. Selecting an alias inserts /alias ; sending executes it locally without creating a session or a prompt when the alias is sent alone. The Agent/Plan/Goal aliases also support a prompt body: /agent-mode <prompt>, /plan-mode <prompt>, or /goal-mode <prompt> switches the idle session (or the next-session default) and sends <prompt> through the normal prompt path. The prompt body remains the visible user turn; a failed dispatch does not clear the composer draft.

Built for local-first development.