Extensions
Hive is designed to be extended into personal software. An extension is a single folder with a manifest
(hive-extension.json) and, if it does more than declare themes or shell commands, one small program Hive runs
and talks to over JSON-RPC on stdin and stdout. You don't have to build a window, host a server, wire up OAuth,
or write a keychain wrapper: Hive draws your UI from blocks, holds your secrets and small storage, exposes your
tools to every agent thread over MCP, and connects you to the project's event bus.
The manifest
Every extension starts with hive-extension.json. Four fields are required: id (lowercase letters, digits and
dashes, starting with a letter), name, version, and api (the protocol version, currently 1). A manifest
with only those and declarative contributions (themes, prompts, shell commands) is a valid, data-only extension
that runs no process at all.
Add run and contributes for an active extension:
{
"id": "standup",
"name": "Standup",
"version": "0.1.0",
"api": 1,
"description": "Collects each thread's standup note and shows today's count in the title bar.",
"category": "Tools",
"run": ["node", "main.js"],
"requires": [{ "program": "node", "fix": "Install Node.js" }],
"permissions": ["events:emit"],
"contributes": {
"tools": [{
"name": "standup_note",
"description": "Record what this thread did today, in one line.",
"inputSchema": {
"type": "object",
"properties": { "text": { "type": "string" } },
"required": ["text"]
}
}],
"views": [
{ "id": "status", "title": "Standup", "where": "titlebar.status" },
{ "id": "today", "title": "Standup", "where": "deck.section" }
],
"events": {
"emits": [{ "type": "standup.logged" }]
}
}
}
Top-level manifest fields (defined in internal/ext/manifest.go):
run— the program and its arguments. A bare name (node,bun,python3) is looked up on the login shell's PATH; a name with a slash (./bin/server) is relative to the extension's folder.activation: ["startup"]— starts the program with Hive instead of on first use. Otherwise Hive stops an idle program after 10 minutes; setbackground: trueto keep a poll loop or event subscriber running.defaultEnabled: false— keeps the extension off until someone turns it on.category— one ofAgents,Sources,Integrations,Tools,Themes,Developer.icon— a Hive icon name shown in the Extension Store and Settings.permissions— what the extension asks for beyond Hive's core API (shown on its Extension Store page before install, and again if an update adds one).requires— prerequisites checked before loading (anotherextension, anagent, acapability, anaccount, anoswith optionalmin, or aprogram). Add"feature"to make a requirement optional so only that feature waits while the rest of the extension runs.accounts— sign-ins Hive already holds (reforge,github) that the extension wants tokens for.
Hive reads the manifest before running any code, and refuses any tool, view, card, download, or event the manifest doesn't declare.
What an extension can contribute
Everything an extension adds is declared under contributes. You can mix and match any of these in one extension:
Tools for agents (contributes.tools)
Every enabled extension's tools are served on Hive's MCP server so agents call them as mcp__hive__<name>. Each
tool declares name, description, and JSON inputSchema, plus optional:
roles(work,lead,orchestrator) to limit which threads see it;remote: trueso threads running on other machines can call it (otherwise only threads on this machine see it);annotations, as in MCP.
A tool handler receives its parsed arguments and a caller object (the thread, project, role, title, and machine).
If two extensions declare the same tool name, the first loaded wins. A tool call times out after 5 minutes. You
can also add contributes.instructions (appended to MCP server instructions) and contributes.briefs (appended to
the system prompt of agents working in matching folders).
Views and the title bar (contributes.views)
An extension never draws raw pixels. A view returns blocks — a fixed vocabulary of rows, text, buttons,
actions, lists, fields, progress bars, sections, empty states, and dividers that Hive renders in its own theme. A
view's where chooses its slot:
| Place | Where it appears |
|---|---|
titlebar.status |
A short status pill in the window's title bar on every page: its first row's text, subtitle as tooltip, and action on click |
deck.section |
A section on the deck after Hive's own cards: compact rows (five, then See more) |
workspace.pane |
A workspace pane kind. Set web to show an HTML file from the extension's folder or a URL instead of blocks |
project.section, project.side, project.header |
The project page: a main section, a side list, or a header button |
projects.menu |
Extra items in a project card's menu |
repo.tab, repo.header |
A tab or header facts on the repo page |
workspace.details, chat.side, settings.page |
The workspace details sidebar, the chat side column, or the extension's own settings page |
Call hive.changed(viewId) whenever a view's data changes and Hive re-renders it if it's on screen.
Cards and the deck (contributes.cards, contributes.deck)
- Your own cards (
contributes.cards). Declare a card kind withid,title, androle(requestwaits for the user;recordsits on the deck until marked done). Present one withhive.present({ kind, title, payload, fallback }), render its blocks inhive.card(kind, render, act), and return{ done: true }fromactto close it. - Hive's deck cards (
contributes.deck). To put Hive's own card kinds (ask,proof,artifact,mention) on the deck viadeck/present, list those kinds incontributes.deckand declare thedeckpermission.
Commands, settings, themes, prompts, and list sources
contributes.commands— appear in⌘Ksearch. Give arunshell line for a data-only command, or omitrunand handlecommand/runin your program (hive.command(id, fn)).contributes.settings— typed settings (bool,text,choice,number) rendered automatically on the extension's page under Settings ▸ Extension settings.contributes.themes,contributes.prompts,contributes.agents— theme files, reusable prompts, and agent definitions.contributes.inbox,contributes.chat,contributes.meetings,contributes.machines,contributes.queue,contributes.threads,contributes.search— feed items into Hive's list views and⌘Ksearch.contributes.checks— turn on Hive's named pre-tool checks (an extension cannot add arbitrary hooks of its own).contributes.hex— tricks taught to Hex beside the notch.
Capabilities: provides and using capabilities
Parts in Hive compose loosely through named capabilities (internal/ext/provides.go):
- Provide a capability (
contributes.provides). Declare"provides": ["dictation"]incontributes, answer requests withhive.provide(capability, (method, params) => ...)(capability/call), and push events to users withhive.emit(capability, event, data)(capability/event). - Use a capability (
requires). Declare an optional requirement inrequires:{ "capability": "dictation", "feature": "Voice input" }. Hive marks that feature met while any enabled extension provides it, and notifies your program withrequirements/changed(hive.onRequirements). Users never see a provider's ID, so any extension can supply the same capability, and using a capability never installs or prompts to install another extension.
Accounts, secrets, and storage
- Accounts (
accounts). Reuse a sign-in Hive already holds (reforgeorgithub) instead of building your own OAuth flow: list it in top-levelaccounts, then callaccount/tokenfor the token, login, and expiry (andaccount/rejectedif the service rejects it). Core and trusted first-party extensions receive tokens directly; installed extensions get access only after the user presses Allow on the extension's Settings page. - Secrets (
hive.secrets.get,set,delete) store strings (up to 16 KB, key up to 64 chars) in the OS credential store (Keychain on macOS), isolated to your extension. No permission required. - Storage (
hive.storage.get,set) keep small JSON values in your extension's data folder (also passed in the environment asHIVE_EXT_DATA).
Trusted versus untrusted
The Extension Store (on the rail) shows where every extension comes from and what it asks for — platforms, size, publisher, trust level, and required or optional capabilities and downloads — before you install it:
| Kind | What it is |
|---|---|
| Core | Ships inside Hive. Loads only when it matches the exact build of Hive. |
| Trusted | Listed as first-party in the Extension Store index. |
| Untrusted | Anything else: community store listings, git URLs, or a local folder you linked while developing. |
Trust is a provenance label, not a sandbox yet: today every extension's program runs as you, with your user permissions. Declared permissions are shown on the Extension Store page before install and again when an update adds a new permission; a sandbox enforcing them for third-party extensions is planned.
Only a person installs an extension. A project never brings or installs one (even when trusted), and agents have no tool to install extensions. A folder dropped into Hive's extensions directory is listed as found and nothing runs until you press Install. Installs are sealed: Hive only loads an installed extension with the install record you created.
Permissions
Declare permissions when your extension needs more than Hive's core API:
| Permission | Means | Enforced today |
|---|---|---|
network |
Network access | Shown, not enforced |
files:project |
Files in the project | Shown, not enforced |
files:home |
Files in your home folder | Shown, not enforced |
processes |
Starting other programs | Shown, not enforced |
screen |
Seeing the screen | Shown, not enforced |
input |
Input to other apps | Shown, not enforced |
microphone |
The microphone | Shown, not enforced |
deck |
Reading/answering cards and starting, reading, messaging, stopping threads | Yes |
preview |
Styling a project's web preview (CSS only) | Yes |
events:emit |
Publishing declared event types onto project event logs | Yes |
events:read |
Subscribing to declared event prefixes on enabled projects | Yes |
The event bus (emit and subscribe)
Extensions can participate directly in Hive's event bus — publishing their own events for automations to react to, or subscribing to thread, task, CI, and landing events without polling.
Declare contributes.events and the matching permissions (events:emit, events:read):
{
"permissions": ["events:emit", "events:read"],
"contributes": {
"events": {
"emits": [{ "type": "standup.logged" }],
"reads": ["task.", "ci."]
}
}
}
- Emitting (
events/emit). Callawait hive.events.emit({ project, type: "standup.logged", subject, data }). Hive checks thattypeis declared incontributes.events.emitsand stampssourceandtrustwithext:<id>. - Subscribing (
events/subscribe). Callconst sub = await hive.events.subscribe({ project, filter, since }, (events, cursor) => { ... }). Hive returns{ id, cursor }and streamsevents/notifybatches restricted to prefixes incontributes.events.readsand projects where the extension is enabled. Callawait sub.unsubscribe()(events/unsubscribe) to stop. Set"background": trueif your extension stays alive solely to listen to events.
Other host notifications an extension hears automatically: hive/changed (projects or theme changed),
settings/changed, requirements/changed, toast/action, and shutdown.
The download-consent rule
Installing or turning on an extension never approves a download. No binary, model, or dataset is fetched on install or enable. Every download waits for the user's explicit yes — from the Download button on the extension's page in Settings ▸ Extensions, or from a Hive consent prompt that names what it is, how big it is, and where it comes from. Consent is stored per item, so a previously approved item can be re-fetched if its file is missing.
Declare each item in contributes.downloads:
"downloads": [{
"id": "whisper-small",
"what": "Speech model (small)",
"kind": "data",
"optional": true,
"from": "huggingface.co",
"url": "https://huggingface.co/…/ggml-small.bin",
"size": 487601967,
"sha256": "…64 hex characters…",
"why": "Turns your speech into text, on this computer."
}]
kindisdata(the default: a model or dataset) orbinary(an executable).optional: truemarks downloads the extension works without; the Extension Store lists required and optional downloads separately with their sizes.- Every non-core extension must supply an HTTPS
urland a 64-hexsha256. Hive downloads the file itself, verifies the hash, and saves it under<HIVE_EXT_DATA>/downloads/<id>. - Core extensions go through the same user consent, and may omit
urlonly for OS-managed or multi-file assets where they report progress viadownload/progress.
Protocol methods:
| Method | What it does |
|---|---|
download/request |
Requests an item and returns its state (pending while waiting for the user, declined if refused, or starts/finds the verified file if approved) |
download/status |
Returns the current state without prompting the user |
download/progress |
Core extensions report progress on managed assets (downloading is refused without consent; ready for an already-present asset is accepted) |
download/changed |
Host notification when the user answers or a host download changes state |
States are not_requested, pending, approved, declined, downloading, ready, and failed. A ready host
download includes path to the verified file. In Go (ext/sdk/), use Host.DownloadRequest,
Host.DownloadStatus, Host.DownloadProgress, and DownloadChanged; in JavaScript, send the JSON-RPC requests
directly.
The JavaScript SDK (extensions/sdk/hive.js)
extensions/sdk/hive.js is a single zero-dependency file for Node or Bun: copy it beside your main.js. It
redirects console.log to stderr automatically so stdout stays valid JSON-RPC 2.0. (A Go SDK also lives in
ext/sdk/, and extensions/lanes/ is a complete extension built on it.)
| API | What it does |
|---|---|
hive.tool(name, (args, caller) => ...) |
Register a handler for a tool in contributes.tools |
hive.view(id, render, act) |
Register a view's render({ project }) and optional act({ project, action, value }) |
hive.card(kind, render, act) |
Register a card kind's render({ card, payload }) and act(...) |
hive.command(id, ({ project }) => ...) |
Register a handler for a command without a shell run line |
hive.provide(capability, (method, params) => ...) |
Answer capability/call for a capability in contributes.provides |
hive.emit(capability, event, data) |
Send a capability/event notification to users of that capability |
hive.events.emit(ev) |
Publish a declared event on the project event bus (events/emit) |
hive.events.subscribe(opts, onBatch) |
Subscribe to declared event prefixes (events/subscribe); returns { id, cursor, unsubscribe } |
hive.changed(viewId) |
Ask Hive to re-render a view if it is on screen |
hive.present(card) |
Present one of your card kinds on the deck (card/present) |
hive.toast(t) / hive.removeToast(id) / hive.onToastAction(fn) |
Show, replace, or dismiss a bottom-right notice with up to two action buttons |
hive.open(url) |
Open an http(s), mailto, or hive:// link |
hive.storage.get(key) / set(key, value) |
Persist small JSON values in the extension's data folder |
hive.secrets.get(key) / set(key, value) / delete(key) |
Store and read secrets in the OS keychain |
hive.settings / hive.onSettings(fn) |
Read current settings and react when the user changes them |
hive.info / hive.onInfo(fn) |
Read { projectsFolder, projects, theme } and react to hive/changed |
hive.requirements() / hive.onRequirements(fn) |
Inspect requirement status and react to requirements/changed |
hive.themes() / hive.setTheme(name, opts) |
List or switch Hive themes |
hive.log(text) / hive.unavailable(why) / hive.onShutdown(fn) |
Write to extension logs, mark unavailable, or clean up on exit |
Worked example: zero to installed
Let's build Standup, a tiny personal-software extension that gives every agent a standup_note tool, shows
today's count in the title bar, lists today's notes on the deck, and emits a standup.logged event when a note
arrives.
1. Create the folder and copy the SDK
mkdir -p ~/Code/standup-ext
cp <hive-checkout>/extensions/sdk/hive.js ~/Code/standup-ext/hive.js
2. Write hive-extension.json
Save this as ~/Code/standup-ext/hive-extension.json:
{
"id": "standup",
"name": "Standup",
"version": "0.1.0",
"api": 1,
"description": "Collects one-line standup notes from your threads.",
"category": "Tools",
"run": ["node", "main.js"],
"requires": [{ "program": "node", "fix": "Install Node.js" }],
"permissions": ["events:emit"],
"contributes": {
"tools": [{
"name": "standup_note",
"description": "Record what this thread accomplished today, in one line.",
"inputSchema": {
"type": "object",
"properties": { "text": { "type": "string" } },
"required": ["text"]
}
}],
"views": [
{ "id": "status", "title": "Standup", "where": "titlebar.status" },
{ "id": "today", "title": "Standup", "where": "deck.section" }
],
"settings": [
{ "key": "maxNotes", "title": "Notes shown on deck", "type": "number", "default": 5 }
],
"events": {
"emits": [{ "type": "standup.logged" }]
}
}
}
3. Write main.js
Save this as ~/Code/standup-ext/main.js:
const hive = require("./hive.js");
async function loadNotes() {
return (await hive.storage.get("notes")) ?? [];
}
hive.tool("standup_note", async ({ text }, caller) => {
const notes = await loadNotes();
const entry = {
text: text.trim(),
thread: caller.title || caller.thread || "thread",
project: caller.project || "",
at: new Date().toISOString(),
};
notes.unshift(entry);
await hive.storage.set("notes", notes.slice(0, 50));
if (entry.project) {
await hive.events.emit({
project: entry.project,
type: "standup.logged",
subject: entry.thread,
data: { text: entry.text },
});
}
hive.changed("status");
hive.changed("today");
hive.toast(`Standup logged: ${entry.text}`);
return "Logged to Standup.";
});
hive.view("status", async () => {
const notes = await loadNotes();
return {
blocks: [{
type: "row",
title: `${notes.length} standup`,
subtitle: notes[0]?.text || "No standup notes yet",
}],
};
});
hive.view("today", async () => {
const notes = await loadNotes();
const limit = Number(hive.settings.maxNotes) || 5;
if (!notes.length) {
return { blocks: [{ type: "empty", text: "No standup notes yet. Ask any thread to log one." }] };
}
return {
blocks: [
...notes.slice(0, limit).map((n, i) => ({
type: "row",
title: n.text,
subtitle: n.thread,
action: { id: "clear-one", value: String(i), title: "Remove" },
})),
{ type: "button", title: "Clear all", action: "clear" },
],
};
}, async ({ action, value }) => {
if (action === "clear") {
await hive.storage.set("notes", []);
} else if (action === "clear-one") {
const notes = await loadNotes();
notes.splice(Number(value), 1);
await hive.storage.set("notes", notes);
}
hive.changed("status");
hive.changed("today");
});
4. Install and iterate live
- Open the Extension Store from the rail (the cube icon below Artifacts).
- Scroll to Install from elsewhere ▸ From a folder on this Mac and pick
~/Code/standup-ext. - Hive links the folder (it shows as Untrusted), starts
main.js, and reloads it automatically whenever you edit a file (ignoringnode_modulesand dot-folders). - Try it: open any thread and ask it to call
standup_note. Your title bar updates immediately, the note appears in the Standup section on your deck, andstandup.loggedlands on the project's event bus. - Tweak its
maxNotessetting under Settings ▸ Extension settings ▸ Standup.
When you want to share it with someone else, push the folder to a git repository — anyone can install it from Extension Store ▸ Install from elsewhere ▸ From a git repository, where Hive clones it, seals the install, and shows its manifest permissions and downloads before anything runs.
Managing extensions
- Extension Store (rail). Browse Core, Trusted, and Untrusted extensions, inspect each extension's platforms, size, publisher, capabilities, and downloads, install from git or a local folder, and update or uninstall.
- Settings ▸ Extension settings. Configure each enabled extension's own settings, manage approved downloads, or grant account access.
- On and off. Turning an extension off stops its program.
HIVE_EXTENSIONS_ONandHIVE_EXTENSIONS_OFF(comma-separated IDs) override for a single launch. - Crashes. Three crashes in five minutes mark an extension Failing until you restart it.
This page's source is pages/extensions.md in hive/docs.