Overview
SuperCmd provides a comprehensive compatibility layer that implements the entire Raycast API surface. This allows existing Raycast extensions to run without modification while enabling SuperCmd-specific enhancements.The API shim lives in
src/renderer/src/raycast-api/ and is split into focused runtime modules for maintainability. The index.tsx file serves as the integration surface that wires everything together.Architecture
The Raycast API implementation follows a modular architecture:Core Exports
Components
All major Raycast components are fully implemented:- List
- Form
- Grid
- Detail
- Filtering with
onSearchTextChange - Pagination support
- Accessories (text, icons, dates)
List.Item.Detailwith Metadata- Sections with subtitles
- Empty states
Hooks
TheuseNavigation hook provides navigation stack control:
Functions
Window Management
- showToast
- showHUD
- confirmAlert
Toast.Style.Success- Green checkmarkToast.Style.Failure- Red errorToast.Style.Animated- Loading spinner
System Integration
Application APIs
Application APIs
File System APIs
File System APIs
Storage & State
LocalStorage
Persistent key-value storage scoped to each extension:SuperCmd uses a scoped prefix (
sc-ext:{extensionName}:) to isolate storage between extensions. Legacy keys are automatically migrated.Cache
LRU cache with size limits:Clipboard
Advanced clipboard operations with history support:AI Integration
Full AI API with streaming support:- AI.ask()
- Streaming
- Available Models
@raycast/utils Hooks
Advanced utility hooks for common patterns:- useCachedPromise
- useFetch
- useAI
- useSQL
- useExec
Icon System
SuperCmd maps Raycast icon names to Phosphor icons:Icon Runtime
The icon system is split into focused modules:icon-runtime-phosphor.tsx
Raycast icon name → Phosphor icon mapping with 200+ icons
icon-runtime-assets.tsx
Asset path normalization and
sc-asset:// protocol handlingicon-runtime-render.tsx
Actual rendering logic with tint color support
icon-runtime-config.ts
Extension context injection for asset resolution
Environment Object
Provides extension context and system information:OAuth Implementation
Full OAuth 2.0 support with PKCE:OAuth Service Presets
Pre-configured services for popular providers:Implementation Status
SuperCmd implements 100% of the core Raycast API:@raycast/api Components (100%)
@raycast/api Components (100%)
- ✅ List (with filtering, pagination, accessories, Detail)
- ✅ Detail (with Metadata: Label, Link, TagList, Separator)
- ✅ Form (all field types, validation, drafts)
- ✅ Grid (sections, fit modes, aspect ratio)
- ✅ ActionPanel (with Submenu)
- ✅ Action (all action types)
- ✅ MenuBarExtra (menu bar integration)
@raycast/api Functions (100%)
@raycast/api Functions (100%)
- ✅ showToast, showHUD, confirmAlert
- ✅ open, closeMainWindow, popToRoot
- ✅ launchCommand, clearSearchBar
- ✅ getApplications, getDefaultApplication, getFrontmostApplication
- ✅ getSelectedText, getSelectedFinderItems
- ✅ trash, showInFinder
- ✅ openExtensionPreferences, openCommandPreferences
- ✅ updateCommandMetadata
- ✅ captureException
@raycast/utils Hooks (100%)
@raycast/utils Hooks (100%)
- ✅ useFetch (with pagination)
- ✅ useCachedPromise (with cursor pagination)
- ✅ useCachedState
- ✅ usePromise (with mutate/revalidate)
- ✅ useForm (with validation)
- ✅ useExec
- ✅ useSQL
- ✅ useStreamJSON
- ✅ useAI
- ✅ useFrecencySorting
- ✅ useLocalStorage
Best Practices
Using the API
Using the API
- Always import from
@raycast/api, never from internal paths - Use TypeScript for better type safety and autocomplete
- Handle loading and error states in async operations
- Test extensions with different themes (dark/light)
Performance
Performance
- Use
useCachedPromisefor expensive async operations - Leverage
keepPreviousDatato prevent loading flickers - Avoid heavy computation in render functions
- Use
React.memo()for frequently re-rendered components
Error Handling
Error Handling
- Always wrap async operations in try/catch
- Show user-friendly error messages with
showToast - Use
captureException()to log errors - Provide fallback UI for error states
See Also
Extension Runtime
Learn how extensions are loaded and executed
Electron Architecture
Understand the IPC bridge and process model
Raycast API Docs
Official Raycast API documentation