IPC API
IPC API reference for building on top of Invoked — Electron IPC channels for querying runs, skills, and MCP tool results programmatically.
Invoked exposes a set of IPC channels via window.electronAPI for use in renderer code. These are available if you're building custom panels or extending Invoked.
Available channels
db:run
Execute a SQL query against the Invoked database.
const rows = await window.electronAPI.db.run(
'SELECT id, summary, model FROM runs ORDER BY created_at DESC LIMIT 10'
)
db:get
Execute a SQL query and return a single row.
const run = await window.electronAPI.db.get(
'SELECT * FROM runs WHERE id = ?',
[runId]
)
db:getPref / db:setPref
Read and write persistent preferences from the preferences database.
const value = await window.electronAPI.db.getPref('my-key')
await window.electronAPI.db.setPref('my-key', 'my-value')
screenshot:capture
Capture the current window to ~/Desktop/invoked-screenshots/.
await window.electronAPI.screenshot.capture('my-screenshot-name')
// Saves to ~/Desktop/invoked-screenshots/my-screenshot-name.png
shell:openExternal
Open a URL in the default browser.
await window.electronAPI.shell.openExternal('https://example.com')
Type definitions
The full TypeScript interface is in src/renderer/types/electron.d.ts in the source repository.
interface ElectronAPI {
db: {
run(sql: string, params?: unknown[]): Promise<unknown[]>
get(sql: string, params?: unknown[]): Promise<unknown>
getPref(key: string): Promise<string | null>
setPref(key: string, value: string): Promise<void>
}
screenshot: {
capture(name: string): Promise<void>
}
shell: {
openExternal(url: string): Promise<void>
}
}
declare global {
interface Window {
electronAPI: ElectronAPI
}
}