Skip to main content

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:
Features:
  • Filtering with onSearchTextChange
  • Pagination support
  • Accessories (text, icons, dates)
  • List.Item.Detail with Metadata
  • Sections with subtitles
  • Empty states

Hooks

The useNavigation hook provides navigation stack control:

Functions

Window Management

Toast Styles:
  • Toast.Style.Success - Green checkmark
  • Toast.Style.Failure - Red error
  • Toast.Style.Animated - Loading spinner

System Integration

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:

@raycast/utils Hooks

Advanced utility hooks for common patterns:

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 handling

icon-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:
  • ✅ 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)
  • ✅ showToast, showHUD, confirmAlert
  • ✅ open, closeMainWindow, popToRoot
  • ✅ launchCommand, clearSearchBar
  • ✅ getApplications, getDefaultApplication, getFrontmostApplication
  • ✅ getSelectedText, getSelectedFinderItems
  • ✅ trash, showInFinder
  • ✅ openExtensionPreferences, openCommandPreferences
  • ✅ updateCommandMetadata
  • ✅ captureException
  • ✅ useFetch (with pagination)
  • ✅ useCachedPromise (with cursor pagination)
  • ✅ useCachedState
  • ✅ usePromise (with mutate/revalidate)
  • ✅ useForm (with validation)
  • ✅ useExec
  • ✅ useSQL
  • ✅ useStreamJSON
  • ✅ useAI
  • ✅ useFrecencySorting
  • ✅ useLocalStorage

Best Practices

  • 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)
  • Use useCachedPromise for expensive async operations
  • Leverage keepPreviousData to prevent loading flickers
  • Avoid heavy computation in render functions
  • Use React.memo() for frequently re-rendered components
  • 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