Project Structure
Main Process (src/main/)
The Electron main process handles system operations, extension management, and IPC communication.
Key Files
Key Files
Main Process Responsibilities
- Handles system operations (file system, applications, clipboard)
- Manages extension loading and execution
- Provides IPC bridge between main and renderer
- Manages global shortcuts and window state
- Executes native Swift binaries
Renderer Process (src/renderer/)
The React-based UI that renders the launcher interface and executes extensions.
Renderer Structure
App.tsx - The Orchestrator
The root component composes all hooks and routes to view components based on application state.Hooks (src/renderer/src/hooks/)
Feature hooks contain state and logic without JSX. Each major feature has a dedicated hook:
Core Hooks
Core Hooks
Views (src/renderer/src/views/)
Full-screen view components are pure UI with no business logic. State comes from hooks.
AiChatView.tsx— Full-screen AI chat panelCursorPromptView.tsx— Inline/portal AI cursor prompt UIScriptCommandSetupView.tsx— Script argument collection formScriptCommandOutputView.tsx— Script stdout/stderr output viewerExtensionPreferenceSetupView.tsx— Extension preference/argument form
Utils (src/renderer/src/utils/)
Pure utility modules with no side-effects:
constants.ts— localStorage keys, magic numbers, error stringscommand-helpers.tsx— filterCommands, icon renderers, display helpersextension-preferences.ts— localStorage helpers, preference hydration
Raycast API Layer (src/renderer/src/raycast-api/)
The compatibility layer that implements @raycast/api and @raycast/utils for Raycast extensions.
Architecture
The Raycast API is modularized into focused runtime files:Key Runtime Files
Component Runtimes
Component Runtimes
Raycast API File Map
When working in the Raycast compatibility layer, use this map to find the right file:- Top-level wiring:
index.tsx - Actions:
action-runtime*.tsxfiles - Lists:
list-runtime*.tsxfiles - Forms:
form-runtime*.tsxfiles - Grids:
grid-runtime*.tsxfiles - Icons:
icon-runtime*.tsxfiles - Platform APIs:
platform-runtime.ts - Utilities:
utility-runtime.ts - OAuth:
oauth/directory - Hooks:
hooks/directory
Native Modules (src/native/)
Swift binaries for macOS-native features:
color-picker.swift— Native color pickersnippet-expander.swift— Text snippet expansionhotkey-hold-monitor.swift— Hold-to-speak hotkey detectionspeech-recognizer.swift— Native speech recognitionmicrophone-access.swift— Microphone permission checkinginput-monitoring-request.swift— Input monitoring permissionswindow-adjust.swift— Window management and positioning
Building Native Modules
dist/native/.
Extension Execution Model
How Raycast extensions run in SuperCmd:Runtime Shim
A custom
require() function provides:- React (shared instance with host app)
@raycast/apishim (our compatibility layer)@raycast/utilsshim (utility hooks and functions)
IPC Communication Pattern
Communication between renderer and main process:Configuration and Settings
Settings Storage
All app settings are persisted in:Extension Storage
Extensions use:LocalStorage— Persistent storage (per-extension)Cache— Temporary caching (per-extension)
Build Output
Next Steps
- Learn about Contributing to SuperCmd
- Understand Testing strategies
- Check Troubleshooting for common issues