singularity-forge/docs-internal/extending-pi/20-mode-behavior.md
Lex Christopherson d20d5e8fb5 docs: add Mintlify documentation site and move internal docs
Add a proper public-facing documentation site using Mintlify with 19 MDX
pages covering getting started, auto mode, commands, configuration, and
all user-facing features. Move internal/SDK documentation (Pi SDK, TUI,
context & hooks, research notes, ADRs) to docs-internal/ since they
should not be part of the public documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:54:41 -06:00

629 B

Mode Behavior

Mode UI Methods Notes
Interactive (default) Full TUI Normal operation
RPC (--mode rpc) JSON protocol Host handles UI, dialogs work via sub-protocol
JSON (--mode json) No-op Event stream to stdout
Print (-p) No-op Extensions run but can't prompt users

Always check ctx.hasUI before calling dialog methods in extensions that might run in non-interactive modes:

if (ctx.hasUI) {
  const ok = await ctx.ui.confirm("Delete?", "Sure?");
} else {
  // Default behavior for non-interactive mode
}