Skip to content

Persistence

CommandUI uses SQLite for all persistent storage. The database is created automatically on first launch.

OSPath
Windows%APPDATA%/com.commandui.desktop/
macOS~/Library/Application Support/com.commandui.desktop/
Linux~/.local/share/com.commandui.desktop/
DataPersists?Notes
Sessions (metadata)YesSession labels, creation time
PTY stateNoShell process respawned on restart
Terminal outputNoBuffered in memory only
HistoryYesAll structured command history
PlansYesGenerated command plans
SettingsYesUser preferences
Memory itemsYesAccepted pattern observations
Memory suggestionsYesPending suggestions
WorkflowsYesSaved command workflows
Workflow runsNoLast-run tracked in memory only

On app launch, the frontend loads data from the backend in this order:

  1. Settings — applied to SettingsStore (non-critical, swallowed errors)
  2. Sessions — loaded or created if none exist
  3. History — last 100 items loaded into HistoryStore
  4. Memory — items and suggestions loaded into MemoryStore
  5. Suggestions — pattern detectors re-run on loaded history
  6. Workflows — loaded into WorkflowStore

Each step is wrapped in try-catch. Non-critical failures (settings, history, memory, workflows) are swallowed — the app boots in a degraded but functional state. Only session creation failure triggers a boot error.

CommandPurpose
history_appendAdd a new history item
history_listLoad recent history
history_updateUpdate an existing item (e.g., add exit code after execution)
plan_storeSave a generated plan
workflow_addSave a new workflow
workflow_listLoad all workflows
workflow_deleteRemove a workflow
memory_addSave a memory item
memory_listLoad all items and suggestions
memory_accept_suggestionConvert suggestion to accepted item
memory_dismiss_suggestionMark suggestion as dismissed
memory_deleteRemove a memory item
settings_getLoad settings
settings_updateSave settings changes