Comet AI
Comet AI
Download
API Reference

Developer API

Complete reference for all IPC handlers, data models, and integration points. Use these APIs to extend Comet AI Browser with custom functionality.

50+

IPC Handlers

8

Categories

5

Data Models

5

Code Examples

Inter-Process Communication

IPC Handlers

All handlers are called via window.electron.invoke(channel, ...args).

Browser Control

12 handlers

get-open-tabs
Tab[]

Returns all open tabs with their URLs and titles

navigate-to(url: string)
void

Navigate the active tab to the specified URL

capture-browser-view-screenshot
Buffer

Capture screenshot of the current browser view

capture-page-html
string

Get the raw HTML of the current page

extract-page-content
string

Extract readable text content from the page

find-and-click-text(text: string)
boolean

Resolve visible text and click it through the shared native-first OCR service

perform-ocr({ useNative?, bounds?, language?, imagePath? })
OCRResult

Run OCR with native providers first and Tesseract fallback

ocr-capture-words(displayId?: string)
OCRCaptureResult

Capture OCR words and lines for the display

ocr-click({ target, useAi? })
OCRClickResult

Resolve and click a visible target using native-first OCR

ocr-screen-text(displayId?: string)
string

Return extracted screen text for a display

perform-cross-app-click({ x, y, button?, doubleClick? })
boolean

Click a coordinate in another application after permission checks

get-selected-text
string

Get currently selected text in the browser

Type Definitions

Data Models

Task

Represents a scheduled automation task

FieldTypeDescription
idstringUnique identifier
namestringHuman-readable task name
typeTaskTypepdf | scrape | prompt | workflow
triggerTriggerScheduling configuration
configTaskConfigTask-specific configuration
enabledbooleanWhether the task is active
priorityPriorityhigh | normal | low
modelstringAI model to use
outputDirstringOutput directory path
notifyOnCompletebooleanSend notification on completion
lastRunDate?Last execution time
nextRunDate?Next scheduled execution
runCountnumberTotal execution count
lastStatusstring?success | failed | running
lastErrorstring?Last error message

Trigger

Defines when a task should execute

FieldTypeDescription
typeTriggerTypecron | once | interval
schedulestring?Cron expression (for type=cron)
datetimestring?ISO datetime (for type=once)
intervalMsnumber?Interval in milliseconds (for type=interval)
timezonestring?Timezone (default: UTC)

TaskConfig

Configuration for different task types

FieldTypeDescription
promptstring?AI prompt to execute
pdfOptionsPDFOptions?PDF generation options
scrapeUrlsstring[]?URLs to scrape
workflowStepsWorkflowStep[]?Multi-step workflow definition
emailRecipientsstring[]?Email addresses to notify

ShellResult

Result of a shell command execution

FieldTypeDescription
successbooleanWhether the command succeeded
stdoutstringStandard output
stderrstringStandard error
exitCodenumberProcess exit code
durationnumberExecution time in ms

AppleIntelligenceStatus

Runtime availability and readiness information for Apple Intelligence on macOS

FieldTypeDescription
successbooleanWhether the status check completed successfully
osVersionstring?Detected macOS runtime version string
summaryAvailableboolean?Whether Foundation Models summary generation passed readiness checks
summaryReasonstring?Why summaries are unavailable or blocked
imageAvailableboolean?Whether Apple image generation is available right now
imageReasonstring?Why Apple image generation is unavailable

Usage Examples

Code Snippets

Best Practices

Error Handling

Best Practices

  • Always check the return value for success/error properties
  • Wrap IPC calls in try-catch for network failures
  • Use the status code to determine error type
  • Implement retry logic for transient failures
  • Log errors for debugging but don't expose to users

Security Notes

  • Shell commands require risk level and reason
  • High-risk actions need mobile approval via QR
  • Never expose raw command strings to users
  • Validate all inputs before passing to IPC
  • Rate limit sensitive operations

Start Building

Use these APIs to extend Comet AI Browser with custom automations, integrations, and features.

Edit on GitHub