Skip to main content

Install and reload

  1. Open Settings > Extensions > Open extensions folder.
  2. Create a subfolder containing manifest.json and its referenced files.
  3. Select Reload extensions, review the requested permissions, and enable the extension.
  4. Find contributed commands in the command palette (Mod+P) and themes in Settings > Appearance > Theme.
Extensions live in the app profile, not in a vault. Reload after changing extension files. Reloading recreates enabled script hosts; disabling removes the host and its contributions but does not explicitly delete its private stored data. Entry scripts run in a sandboxed worker with the supplied tagline bridge. They are async function bodies, not ES modules: top-level await works, but top-level import/export and CommonJS require do not. Bundle dependencies into a self-contained script.

First-install setup

Register at most one tagline.onInstall(handler) synchronously while the entry script initializes. Tagline awaits it before marking the host ready. Use idempotent setup: an interrupted callback may run again on the next load. Successful setup is remembered by extension ID, so ordinary reloads, updates, and disable/re-enable do not repeat it. Extensions without an entry script do not have this hook.
This example needs ui permission and a declared welcome webview. Entry evaluation and setup share the startup deadline (10 seconds by default); show onboarding and return rather than waiting for the user to finish it.

Browse and publish extensions

Settings > Extensions > Browse extensions lists community extensions from the Tagline extension registry. Tagline contacts GitHub only after you select Browse registry. Each card shows the name, version, authors, description, permissions, and network hosts read from the extension’s manifest.json. Installed extensions show Installed, or Update to vX when the registry version differs. Installing resolves the listed ref to a commit, downloads only the files in that folder, checks every file against its Git blob hash, then uses the same validation, size limits, and permission review as installing from a folder. Registry extensions are not reviewed by Tagline; install only extensions you trust.

Submit an extension

  1. Publish the extension folder (with manifest.json at its root) in a public GitHub repository. Declare authors, and set sourceUrl to exactly the URL you will list in the registry.
  2. Open a pull request that appends its URL to extensions/registry.json:
Use https://github.com/owner/repo for the default branch root, or https://github.com/owner/repo/tree/<ref>/<folder> for a tag, branch, or commit and a subfolder. The ref cannot contain /. Pointing at a tag pins users to a reviewed release; pointing at a branch lets users update when you push. Each extension id may appear only once. The manifest’s sourceUrl must point to the same repository, ref, and folder as its registry URL (owner and repository names are compared case-insensitively), so a registry entry cannot claim someone else’s extension. A pull-request check validates extensions/registry.json against schemas/extension-registry.schema.json, then validates every listed manifest against schemas/extension-manifest.schema.json and Tagline’s runtime rules. The app enforces the runtime rules and the sourceUrl match again when listing and installing.

Review before enabling

Enabling an extension that declares any of these capabilities requires an explicit review of its manifest:
  • settings
  • editor:active-note
  • events
  • ui
  • network
  • secrets
  • api
Tagline computes a review signature from the manifest’s declared permissions (sorted), network hosts, settings, ribbon items, panels, and webviews, then derives a SHA-256 token from that value. Reloading extensions recomputes the token and compares it with the stored approval. Changing any reviewed field invalidates the approval; for example, adding network, secrets, or api, changing networkHosts, or changing a declared setting requires a new review. Only Settings > Extensions can enable or approve an extension, and enabling requires the token for its current manifest. A missing or stale token is rejected with “Extension permissions or settings changed. Reload and review before enabling.” After a successful enable, the approval signature is stored in extensionReviews in the app’s config.json. On every launch and reload, Tagline scans each manifest and checks its stored approval again. If an approval no longer matches, the extension is treated as disabled: its host does not start, its commands are unavailable, and its selectable themes fall back to the default palette until you review and enable it again. Extensions that declare a gated capability but have no stored approval—including extensions installed before reviews were introduced—also need review. The native menu can open Settings > Extensions only; it cannot enable or approve an extension. An extension declaring network must also declare networkHosts, a list of exact lowercase hostnames. Tagline includes this list in the review signature and shows it in Settings > Extensions. Review the requested hosts before approving the extension.

A minimal command extension

Create an extension folder with a manifest and one entry script:
The command appears as Debate Tools: Insert evidence reminder; its internal application ID is ext:debate-tools.insert-reminder. Register and await every contributed command during initialization.

Package translations, fonts, and templates

Declarative assets can be used without an entry script or permissions. Put every referenced file inside the extension folder:
Catalogs are flat JSON string maps, such as { "welcome": "Welcome, {name}" }. Keys are isolated under ext.debate-kit; an entry script can call await tagline.i18n.t('welcome', { name: 'Kim' }). Add a main script to the manifest to use that API. Contributed fonts appear in the font-family setting, and templates appear in template commands and Settings > General > Templates. Assets disappear when the extension is disabled; templates are never copied into the vault.

Manifest reference

Contribution IDs use the extension-ID character rules. Paths must remain inside the extension folder; absolute paths, traversal, and symlinks resolving outside it are rejected. Default file limits are 1 MiB for scripts and 64 KiB per contributed theme. Translation catalogs are limited to 256 KiB each; fonts to 10 MiB each and 20 MiB in total; templates to 1 MiB each and 4 MiB in total. These declarative assets need no permissions and are removed from the app when the extension is disabled. The aggregate JSON size of theme files loaded from one extension is limited to 524,288 bytes by default; this Theme preview bytes limit can be adjusted from 1,024 to 4,194,304 bytes. Per-file limits apply independently. Limits are adjustable within fixed bounds in Settings > Advanced settings > Theme and extension limits. Invalid manifests and load failures are shown in extension settings. A script must finish initialization within 10 seconds. See the JSON formats guide for schema validation and editor completion.

Permissions and isolation

Undeclared permission checks reject API calls. For every network request, the main process rechecks that the extension is enabled and its manifest still declares the permission and requested host. Requests reject local or private DNS results, embedded URL credentials, non-HTTPS schemes, non-default ports, cookies, automatic redirects, and compressed responses. Requests are limited to 20 per second and request bodies of 5,000,000 bytes; see Network API for response and timeout limits. The extension worker and webviews have no direct network access. Extensions also have no direct Node.js, Electron API, application DOM, profile storage, or arbitrary filesystem access. See Review before enabling for the manifest approval required for gated capabilities.
  • Workers keep synchronous extension loops off the application UI thread. A supervisor stops a worker that misses heartbeats for 5 seconds; startup has a 10-second deadline.
  • More than 200 messages in a rolling second stops an extension. At most 32 bridge calls may be pending, and each extension may register up to 32 vault watches and 32 active-note listeners.
  • Nested Worker and SharedWorker constructors are disabled. Disable, reload, or unload tears down the worker.
Runtime failures appear in notifications and startup failures on the extension card. Await bridge calls and handle specific errors where you can explain recovery; unhandled command errors are surfaced to the user.

Network API

tagline.network.fetch(url, options) supports GET, POST, PUT, PATCH, DELETE, and HEAD. GET and HEAD cannot have a body; other bodies are text up to 5,000,000 UTF-8 bytes. The response has status, statusText, ok, headers, and body. Response bodies are limited to 5,000,000 bytes. responseType can be text (default), json (parsed JSON; invalid JSON rejects), or base64 (binary bytes encoded as a string).
timeoutMs is a positive integer no greater than the configurable extensionNetworkTimeoutMs cap (30,000 ms by default). Omitting it uses 30,000 ms or the cap, whichever is smaller. Customize the cap in Settings. Requests are limited to 20 per second per extension. tagline.network.fetchToFile(url, vaultPath, options) requires both network and vault:write. It streams a successful response through a private temporary file, then saves bytes to a new vault-relative path; existing files are never overwritten and parent folders must already exist without symbolic links. Failures remove the temporary file. The result contains response metadata, bytes, and path. The same request options apply, except responseType. Downloads have a separate configurable networkDownloadBytes limit (20,000,000 bytes by default). The vault tree only displays non-hidden .md, .flow, .canvas, and .json files; other downloaded files remain on disk but do not appear in the tree.
tagline.network.authorize(url, options) supports desktop OAuth authorization code flows. The HTTPS authorization host must be declared in networkHosts. Tagline opens it in the system browser, creates a temporary listener bound only to 127.0.0.1 on an ephemeral port, adds its loopback redirect_uri and a random state plus an S256 PKCE challenge, and checks that state before returning callback parameters and the codeVerifier needed for token exchange. options.timeoutMs ranges from 1,000 to 300,000 ms and defaults to five minutes. Call tagline.network.cancelAuthorization() to cancel a pending flow; disabling the extension also closes its listener. Use the returned code with tagline.network.fetch() for the token exchange. This does not enable arbitrary localhost requests or fixed-port callbacks; OAuth providers must support loopback redirects with a dynamic port.

Commands and editor

Bridge methods return promises. Command handlers receive no arguments and expose no return value to the host.
Notifications accept strings up to 500 characters and include the extension name. The active-note snapshot includes vault-relative path, current content (including unsaved edits), selected text, and editor state. Modes are visual, edit, or read; kinds are markdown, flow, or canvas. Content is available only with editor. insertText requires an open Markdown note in an editing mode and a ready editor. In visual mode it parses Markdown; in source mode it inserts literal text. It replaces the selection or inserts at the cursor and schedules normal autosaving. It rejects in reading mode or on a flow, and accepts up to 5,000,000 characters. Selection offsets are source-character offsets starting at 0 in source mode and ProseMirror positions in visual mode (text usually starts at 1); the coordinate systems are not interchangeable. Invalid or out-of-document positions reject. Tiptap snapshots and commands require an active visual Markdown editor; reading mode, flows, and source fallback reject. Approved Tiptap commands include formatting (toggleBold, toggleItalic, toggleUnderline, toggleHighlight, toggleStrike, toggleCode, toggleHeading, setParagraph, clearNodes), blocks and lists (toggleCodeBlock, setHardBreak, setHorizontalRule, toggleBulletList, toggleOrderedList, toggleBlockquote, toggleTaskList), tables (insertTable, addColumnBefore, addColumnAfter, deleteColumn, addRowBefore, addRowAfter, deleteRow, toggleHeaderRow, toggleHeaderColumn, toggleHeaderCell, mergeCells, splitCell, deleteTable), and history (undo, redo, unsetAllMarks). Only toggleHeading accepts { level: 1..6 }; insertTable accepts { rows: 1..20, cols: 1..20, withHeaderRow: boolean }. Extensions cannot register arbitrary Tiptap, CodeMirror, or Marked JavaScript plugins: extension code stays in the worker sandbox and is never executed in the editor or app renderer. The restricted editor surface is the approved Tiptap command list, host-validated editor diagnostics (rendered in the source and visual editors), and permission-free Markdown parsing helpers. Use these APIs for editor integration without injecting executable code into Tagline’s editors. Use tagline.editor.onActiveNoteChanged(callback) with the separate editor:active-note permission to subscribe to { path } changes only. It does not provide an initial snapshot; call getActiveNote() only when full editor access is needed and approved. Unloading the extension unsubscribes automatically.

Application event bus

Every subscription requires events. Built-in events also require the listed data permission. Subscriptions do not replay initial state and are removed on disable, reload, or worker failure.
Custom event names follow ext.<extension-id>.<event-name>. Extensions may listen to other namespaces but can emit only in their own. Names are limited to 128 characters; custom event payloads must be JSON-serializable and no larger than 131,072 UTF-8 bytes (128 KiB); webview UI-message payloads are JSON-serializable and capped at 65,536 UTF-8 bytes. Treat payloads from other extensions as untrusted.

Inter-extension APIs

Both the provider and caller must declare the review-gated api permission and have it allowed in Settings. APIs are host-mediated; extensions never receive another extension’s worker or privileges. Export one API during initialization with a positive integer version and 1 - 64 lowercase method names:
Call an enabled provider by extension ID. getApi waits for an API that is still starting; pass a version to require an exact match. Each method takes one JSON payload (use null when unused) and returns JSON. Inputs and outputs are limited to 65,536 UTF-8 bytes; undeclared methods and mismatched versions reject.
API methods do not inherit permissions: the provider must independently validate inputs and only expose operations it intends to share. Disable, reload, or stop either extension to end access.

Status bar, menus, panels, and webviews

Declare surfaces before using them. IDs use command-ID syntax; titles are nonblank and at most 80 characters. Each surface belongs to its extension.
Status-bar items display only text, icon, and tooltip—no extension HTML. Their click command must be declared. Context-menu and file-handler commands receive a bounded { path, selection, uri } object; unavailable fields are null. Editor selections are text (clipped to 4,096 characters); canvas and flow selections contain only compact node/edge IDs or cell bounds. Context data is supplied only after an explicit user menu action. File handlers appear as “Open with …” in file and tab context menus. They never replace double-click/open behavior; priority only sorts matching extension handlers. Panels default to the right panel. persistVisibility stores only whether the panel is open, and when supports a short allowlist of document extensions and/or modes—no executable expressions.
Register message handlers before showing the surface. The page should send a ready message after registering its handler; posting to an unmounted surface rejects. setHtml replaces the page, show displays it, and close hides/unmounts it while retaining HTML for reopening. Disabling or reloading removes contributed surfaces. A webview with placement: 'search' becomes a search-mode option after setHtml; users choose it from the search dialog rather than an extension calling show. Switching modes or closing search unmounts the page, so send a ready message whenever it mounts and keep persistent state in the worker. After mounting, the page receives { type: 'search-query', query: '...' } via taglineWebview.onMessage with the current search text. With ui permission, await tagline.ui.openNote(path) opens an existing supported vault document; if called from the selected search contribution, the search dialog closes. await tagline.ui.openExternal(url) asks the user for confirmation before opening an HTTPS URL without credentials in their browser. Right-panel contributions appear above the built-in right sidebar; other panel placements follow their declaration, while webviews appear as dialogs. HTML is limited to 200,000 characters and runs in an opaque-origin sandbox="allow-scripts" iframe without same-origin access, Node, Electron APIs, network requests, forms, nested frames/workers, popups, or arbitrary navigation. Styles must be inline; images may use data URLs. Never inject unescaped note content; use textContent. Webview scripts have DOM access and can still block renderer responsiveness if they do expensive synchronous work.

Extension bundle files

Sandboxed extension scripts can read files shipped inside their own installed folder with tagline.extension.readFile(path, encoding = 'utf8'). The path is relative to the extension root, cannot escape it, and reads are limited to regular files (up to 2 MiB). Use 'utf8' for text or 'base64' for binary data.

Theme-aware UI kit

Panels and webviews receive app colors, fonts, selection colors, and a shared control stylesheet. Prefer taglineUI factories to hardcoded colors:
Factories return native elements with labels, keyboard behavior, focus indicators, and reduced-motion support. Available controls include stack, card, field, select, toggle, notice, and button. Text and labels are inserted as text, not HTML. In webviews, taglineWebview.getTheme() returns the current theme and onThemeChange(callback) observes updates; see the Theme API.

Helpers and disposable subscriptions

Pure helpers require no permission. Path helpers normalize vault-relative paths and reject absolute paths or traversal above the vault root; they do not access files.
  • Markdown: toText, toHtml (sanitized), frontmatter, slugify, outline, extractLinks, extractTags, and resolveLink(target, paths). Frontmatter returns { data, body, prefix }; invalid YAML rejects. Outline line numbers are zero-based and include frontmatter lines.
  • Cards and speech: cards.getAt, cards.stats, cards.spokenEvidence, cards.formatDuration, speech.analyze, and speech.estimate(text, wordsPerMinute = 250).
  • Other helpers: templates.fill, citations.create, search.fuzzyScore, countdown.remainingAt, language.system/initial, keybindings.valid/display, and layout normalization/movement helpers.
  • Structured data: canvas and flow parse/serialize/create helpers; folder path normalization; frontmatter and speech-path helpers; calendar date/grid helpers; vault path/index/link helpers; and NLI premise, hypothesis, and label helpers.
templates.fill(template, title, context) recognizes {{date}}, {{time}} (both local time, with optional formats such as {{date:dddd, MMMM D}} or {{time:hh:mm A}}), {{title}}, {{path}}, {{content}}, and {{properties}}. Pass a target vault-relative path and full Markdown content in context; content expands to the body without frontmatter and properties to the original YAML without delimiter lines. Pass context.vars, an object of string values (at most 100), to fill custom placeholders such as {{author}}; built-in names cannot be overridden. Values substitute literally in one pass, omitted values become empty strings, and unknown placeholders remain unchanged. templates.list(folder?) returns Markdown template paths from the configured template folder (or folder), and templates.read(path) returns a template’s text; both require the vault:read permission. Additional bounds include 10,000 supplied paths for link resolution; 10,000 document paths and 1,000,000 total text characters; 1,000 entries for layout catalogs and ID arrays; 10,000 folder-tree nodes and 100 levels; and 100,000 flow cells. Speech estimates accept 50 - 1,000 words per minute, and calibration accepts up to 100 validated samples. Invalid or oversized inputs reject rather than being silently truncated. Markdown rendering, text, links/tags, card analysis, and speech timing exclude frontmatter; link and tag extraction skip fenced and inline code.

Expanded helper surface

Every pure utility in src/lib is also available through tagline.helpers without a permission. In addition to the namespaces and methods above, the bridge exposes: Existing path, calendar, flow, flowCells, folders, markdown, templates, speech, readTime, and other vault, canvas, and citations helpers are unchanged. Inputs are validated and bounded: text up to 100,000 characters, documents up to 10,000 entries, search limits from 1 to 1,000, and keybinding platforms limited to darwin, win32, and linux. tagline.helpers.createDisposables() is synchronous. Add unsubscribe functions with add, then call dispose(); it clears the group and surfaces disposal failures.

Typed extension settings

Declare settings permission and typed contributions. This is a manifest fragment; include the required manifest fields as well.
Each setting has a unique ID, nonblank title (up to 80 characters), type, and valid default. Optional descriptions are limited to 500 characters. Booleans accept only booleans; numbers must be finite and may have inclusive bounds; strings default to a 1,000-character limit (configurable from 1 to 10,000) and may restrict values to 1–50 unique enum choices. Invalid definitions, undeclared IDs, and type or range mismatches reject instead of coercing values. Users can edit, save, and reset settings on the extension card under Settings > Extensions. Settings are scoped to the extension ID and separate from private storage. They are not encrypted; do not use them for secrets. Invalid saved values surface errors and can be reset by the user.

Canvas and flow documents

tagline.canvas.read(path) and tagline.flow.read(path) parse documents and require vault:read. Their write(path, document) counterparts validate and serialize data, require vault:write, and return the saved path. Paths must end in .canvas or .flow. Saves use normal autosaving and revision history; call tagline.vault.flush() to await disk persistence. Pure helpers require no permissions: canvas parse/serialize, node and argument-edge creation, group membership, link resolution, file suggestions, and node movement; flow parse/serialize/create and cell updates. Relations are supports, answers, or contradicts. Helpers return new values rather than mutating inputs. Canvas link resolution only considers supplied paths and never opens or reads files. See JSON formats and schemas for flow validation and the standard JSON Canvas specification.

Vault API

list, read, and watch require vault:read. Mutations and flush require vault:write; append and compareAndSwap require both. Paths are vault-relative with / separators, preserve file extensions, and are limited to 1,000 characters.
  • list returns loaded supported note paths, not arbitrary files or folders. read returns current loaded content and rejects for an absent note; reload the vault after external edits.
  • create creates a new .md, .flow, or .canvas note without overwriting an existing file. If the requested path is taken, it returns the unique path chosen by the normal vault workflow.
  • write accepts .md, .flow, and .canvas. It replaces loaded content or creates a note through the normal workflow. Folder normalization/collision handling can change a new path; use the returned path. Writes are debounced, so resolving does not mean disk persistence is complete. Content is limited to 5,000,000 characters.
  • append adds literal text to an existing note and preserves unsaved edits. compareAndSwap compares the entire loaded text, including unsaved edits, and replaces only on an exact match; mismatch returns false. Concurrent extension mutations are serialized.
  • flush waits for queued autosaves and in-flight writes for the current vault, including user edits. It rejects on save failure; edits made after it starts may require another flush.
  • rename and delete act on existing notes (not folders), flush first, and reject on save failure. Rename uses the app’s normal relinking and tab updates; delete moves the note to the OS trash and closes its tabs.
  • watch reports path-only create/change/delete events or { type: 'reset' } when switching vaults. Events may be coalesced; renames appear as delete/create. Read a current snapshot separately when needed.

Private extension storage

No permission is required. Keys are strings up to 200 characters; values should be JSON-compatible. Setting null or undefined removes a key. The total serialized object is limited to 131,072 UTF-8 bytes (128 KiB). Storage is scoped by extension ID in the local app profile and survives host reloads; it is not encrypted, synced, or a vault file. Do not store API keys or other credentials here. Use tagline.secrets for encrypted secret strings.

Encrypted extension secrets

Declare the review-gated secrets permission in manifest.json to use tagline.secrets:
Keys are non-empty strings up to 200 characters. Values are strings up to 10,000 characters, and each extension can hold up to 50 secrets. get returns null when the key is absent; has returns whether it exists. Setting null or undefined deletes the key, as does delete. Secrets are encrypted with the operating-system credential service through Electron safeStorage in the main process and stored in <userData>/extension-secrets/<extension-id>.bin, scoped by extension ID. They are never written to the vault, settings exports, tagline.storage, or localStorage. Calls reject if OS encryption is unavailable or the extension is disabled; there is no unencrypted fallback. Users can remove an extension’s secrets with Clear stored secrets on its card in Settings > Extensions. Disabling an extension blocks access but does not clear its stored secrets.
Keep secrets out of UI and logs. Do not log secret values or send them to panels or webviews. Read and use them in your entry script (main.js) with tagline.network.fetch(). Network requests also require the reviewed network permission and the destination hostname in networkHosts.

Shortcuts and contributed themes

Mod+Alt+K uses the portable primary modifier. Valid modifiers include Mod, Ctrl, Meta, Alt, and Shift; use uppercase letter keys in manifests. Users can change or clear extension shortcuts in Settings > Keyboard shortcuts > Extensions. Malformed, reserved, or already-used defaults are dropped rather than overriding another command; the command remains available in the palette. Theme-only extensions need no script or permissions:
Theme IDs are assigned as ext:<extension-id>:<zero-based-file-index>. Keep the theme list order stable to preserve saved selections. See the Theme API for the theme file format and the JSON formats guide for schemas.
Keep exploring: Browse the API demo extension for working examples, or open the JSON schemas for manifests, themes, and exported settings.
Source: Extension API reference.