Skip to content
DocsAPI reference

PluginsEarly

Plugin API reference

Every element, event, method, command and limit a Graphide plugin can use.

From the plugin interface of gr 0.2.16. gr plugin api prints it on your machine, and gr plugin api --dts the declaration file.

This release serves API versions 0.1, 0.2 and 0.3. A plugin names the one it is written for in plugin.toml with api = "0.3", and can use everything marked as arriving in that version or earlier. Names with no version have been there since 0.1.

Elementswhat a view is built from29
Eventswhat a plugin listens for35
Methodsthe calls on $58
Commandswhat a handler asks the app to do20
Actionsapp actions a plugin may run54
Context keyswhat a handler is told about the app's state21
Capabilitieswhat a plugin may ask for16
Typesthe types in plugin.d.ts44
Test APIa plugin's own tests47
Limitstime, size and count86
Errorsevery error code93

The script

A plugin's TypeScript runs in a small sandboxed host, not in Node or a browser. These globals are there: h, Fragment, setTimeout, setInterval, clearTimeout, clearInterval, queueMicrotask, console. These are not: require, process, Buffer, fetch, XMLHttpRequest, eval, Function. Files, the network and programs are reached through $, and only with the capability for each.

Reserved for later

A plugin cannot take these names yet; later versions of the interface may use them.

Plugin namesgraphide, gr, core, builtin, test, api, plugin, plugins, list, tree, pane, tab, jump, attention, agent, agents, map, node, picker, buffer, change, hunk, toggle, symbols, definition, architecture, explorer, source_control, terminal, search, sessions, nav, changes, tests, servers, deslop, experimental, browser, diffs, inbox, scratchpad, design, and the names Graphide uses inside
Eventscursor, decorations, query
$ namespacesqueries, secrets
Commandsterminal.open, agent.start
Elementsboard, canvas, editor

These docs describe Graphide 0.2.16, the latest release. Something wrong or missing? Tell us onDiscord or at hello@graphide.com.