Plugins

Brief

Terminal Delight is an MCP client as well as a server. A plugin is a small program that speaks MCP over stdin and stdout. Terminal Delight finds it from a manifest, starts it when you use one of its actions, and stops it when the call returns.

To install one, put a plugin.json naming its command in ~/.config/terminal-delight/plugins/<name>/. The 🧩 button in the footer, or Plugins in its … menu, lists what's installed, and a new manifest shows up the next time you open it.

Two actions run today. The ⬇ .cdx button on a graveyard card harvests that dead agent's session into a .cdx package, using context-delight's cdx-mcp. The savings face of the usage card shows lean-ctx's token savings, using leanctx-mcp. The panel lists any other plugin's actions, but can't run them yet.

Technical has the manifest format and how a call is made.

Technical

Manifests

Terminal Delight reads every plugin.json one level under plugins/ in its config folder, $XDG_CONFIG_HOME/terminal-delight or ~/.config/terminal-delight. It reads them again each time it needs the list, so there is nothing to restart.1

KeyTypeDefaultMeaning
namestring, requiredThe plugin's id. A plugin named context-delight or leanctx-savings replaces the built-in one.
commandstring, requiredThe program to start.
argslist of strings[]Its arguments.
envobject of strings{}Extra environment for it.
versionstring"0"Shown as v<version>.
descriptionstring""Shown in the panel.
scopestring"agent"agent or global.
actionslist[]Each {tool, label, surfaces}: the MCP tool, its label (the tool's name if left out), and where it belongs, among agent, graveyard and global (global if left out).

A manifest that is not valid JSON, or has no name or command, is skipped without a word.

{
  "name": "leanctx-savings",
  "version": "0.1.0",
  "command": "leanctx-mcp",
  "scope": "global",
  "actions": [{ "tool": "savings", "label": "</> savings", "surfaces": ["global", "agent"] }]
}

How a call is made#

Terminal Delight starts the command with stdin and stdout piped and stderr discarded, sends initialize (protocol 2024-11-05, client terminal-delight), then notifications/initialized, then one tools/call, and reads the text of the result. Each request has ten seconds: plugin timed out after 10s. The process is ended when the call is done. A plugin's JSON-RPC error shows as plugin error <code>: <message>, and a program that won't start as could not launch <command>: ….1

The built-in two#

PluginFound whenAction
context-delightcdx-mcp is on your PATH, in ~/.local/bin or in ~/.cargo/bin⬇ context in the panel, ⬇ .cdx on a graveyard card: write_package with {target, format: "cdx", out, redact: true}, writing ~/.local/share/context-delight/<session>.cdx
leanctx-savingsleanctx-mcp is on your PATH, in ~/.local/bin or in ~/.cargo/bin</> savings: savings, drawn on the usage card's savings face. The </> savings button on the agent wall opens the same face.

Run from a source checkout, Terminal Delight also finds the repository's own plugins/leanctx-mcp/leanctx-mcp. scripts/install-plugins.sh copies the plugin programs under plugins/ into ~/.local/bin; their manifests stay where they are.

The agent wall has no button or menu row of its own; Ctrl+Shift+A opens it, and the usage card's savings face is the usual way to the savings.

Not yet#

  • Only the two built-in actions run. A third plugin's actions are listed in the panel but have nothing to run them.
  • The repository's td-send plugin, which pulls other terminals' windows into Terminal Delight, isn't installed where Terminal Delight looks for manifests. Copy its plugin.json into place to list it.

What would prove this wrong#

Each action starts one plugin process and ends it when the call returns or times out. A plugin process still running after that, or a call that waits longer than ten seconds for one answer, is a bug.

Sources

  1. Discovery, the manifest and the client: plugins.rs; the strings: lang/parts.rs; the bundled plugins: plugins/.