blog / , updated

How to Run Herdr Plugins in qoop

To run Herdr plugins in qoop you install one with qoop plugin install owner/repo, read the list of what it will run, say yes, and start its actions from the ctrl-a space palette. The plugin is not rewritten and Herdr is not involved: qoop answers the calls the plugin makes the way Herdr's own program would.

This tutorial follows one install from start to finish and ends with a plain list of what does not work yet. Read that list first.

Before you start

  • qoop running, with a build that has the plugin commands.
  • A plugin on GitHub written for Herdr 0.9.5: a repository with a herdr-plugin.toml and the programs it names. It can sit in a subfolder.
  • A plugin whose manifest lists linux or macos. qoop refuses one that does not name your platform.
  • A job that fits: plugins work on terminals, tabs and spaces. They do not change how qoop looks.

Below, owner/repo stands for the plugin you picked.

Step 1: Install the plugin

All five commands live under qoop plugin:

CommandWhat it does
qoop plugin install owner/repo[/subdir] [--ref REF] [--yes]fetch from GitHub, show what it runs, ask
qoop plugin link <dir> [--yes]use a folder as it is, with no build and no commit recorded
qoop plugin ls [--json]list plugins and whether each still matches your yes
qoop plugin rm <id>remove one
qoop plugin run <id.action>run one action from the shell

Install always fetches from GitHub. Add /subdir for a plugin inside a bigger repository. --ref takes a branch, tag or commit.

qoop plugin install owner/repo

Nothing of the plugin runs yet. qoop reads the manifest and applies the checks Herdr 0.9.5 applies, such as a name, a version and a minimum Herdr version no newer than 0.9.5. A manifest that fails is refused with the reason.

Step 2: Read the preview before you say yes

qoop now prints what the plugin would run, one line each, then asks install it? [y/N]. The preview lists:

  • the plugin's id, version, source and the commit checked out;
  • every build command, action, pane, event handler and startup command, each with its full argument list and control characters escaped, so a manifest cannot hide one;
  • a closing line on what any plugin can do: it runs as you, reads every terminal, types into terminals, runs commands in shells, closes and renames panes, tabs and spaces, and opens panes.

Read the build and startup lines first: they run arbitrary code as soon as you agree.

Your yes is narrower than it feels:

  • It covers the text of herdr-plugin.toml, compared with the file on disk before every run. A manifest that changes later is refused until you remove the plugin and install it again.
  • The commit is recorded, and nothing re-verifies it.
  • The files the commands run are outside it. If the manifest runs ./bin/tool, you agreed to that line, not to whatever bin/tool holds next week.

Answer y. With no terminal, add --yes; the preview is printed either way.

After the yes, qoop installs the exact checkout you were shown. Build steps run once, with stdin closed. If a build fails, nothing is recorded as agreed and the plugin stays off.

Step 3: Run Herdr plugins from the palette

Installing a plugin starts the plugin host, the small process the plugin talks to. It starts again with every interface start while a plugin is installed.

Press ctrl-a space. At the bottom is a plugins section: every action of every installed plugin, by title with the plugin's id beside it. Only actions that fit what you have open appear; one for a space, tab or pane needs a terminal of this computer on screen.

Pick one with enter. The hint row says starting <title> (<id>), then started, or did not start (see qoop plugin ls) with the host's reason.

If the host is not running, the section shows one row, plugin host not running. Picking it tells you to quit and run qoop again.

Anything a plugin writes into a terminal meets the refusals that qoop send and qoop prompt already have. If a person is at the terminal, the write fails and the plugin receives an error. An agent waiting on you, a trust prompt and a sleeping tab are refused too, with no retry.

Two exceptions keep ordinary plugins usable. A plugin may always type into its own pane, and a key you press in a plugin's pane lets it send one line into its tab within 10 seconds, unless you left a line half typed there. Neither is a wall against a program that means harm, since a plugin runs as you.

Step 4: List, run from the shell and remove

qoop plugin ls shows each plugin's id, version, recorded commit and whether it still matches your yes. Anything other than ok is the reason qoop would refuse to run it, such as a changed manifest.

To run an action without the palette:

qoop plugin run <id.action>

With the host running, the action starts through it with the focused terminal as context, and the command prints where the output goes: host.log in the plugin's state folder. Without a host, it runs in your shell with no focused terminal.

To remove a plugin:

qoop plugin rm <id>

This removes your consent, then the folder and the plugin's state. A linked folder is unlinked and left alone, and the plugin's config folder stays.

Writing a plugin yourself? qoop plugin link <dir> uses your folder as it is, with the same preview.

Step 5: Use what plugins can do in the interface

Four things a plugin can do show up on your screen:

  • Move panes. A plugin can park a pane in another tab, or give it a tab of its own, with its program still running. A sidebar plugin such as ChmaraX/herdr-nvim uses this to open and close its sidebar without losing your shells.
  • Take a ctrl+click on a link. A plugin's link handler gets the click first. A link no handler takes behaves as before. Your terminal must report ctrl+click to qoop: iTerm2 needs "Ctrl-click reported to apps, does not open menu" turned on, and macOS Terminal.app reads it as a right click, so there it may not arrive.
  • Order the agent rows. While a plugin's agent view is set, the agent rows under each space list in the plugin's order and leave out what its filter drops. Clearing the view or removing the plugin puts the rows back.
  • Receive your selection. Select text with the mouse in a pane, press ctrl-a space and pick the plugin's action: the action gets the selected text. A selection from copy mode is not passed.

Check it worked

  • qoop plugin ls lists the plugin with ok, and ctrl-a space ends with its actions.
  • Picking an action says started, and output shows up in host.log.

What does not work yet

A plugin that depends on one of these installs and then falls short.

  • No floating popups: a popup opens as a split beside its pane and fills the tab until it closes.
  • No layout calls. Swapping, resizing and moving panes work.
  • Link handlers run only from a click your terminal reports, and never for a terminal of another computer. There are no worktree events, and a few others never fire, among them output matches and scroll changes.
  • Some Herdr commands are missing, such as starting or reporting an agent. A plugin cannot tell qoop an agent's state. An agent view orders the sidebar rows only; its label is not drawn.
  • Only a plugin's tab rename changes the name qoop shows. The names it gives panes and agents are kept for the plugin and not drawn.
  • After the daemon restarts, a plugin's pane returns as a plain shell, and a tab with one running refuses to sleep.
  • Panes running nushell are out, and plugins reach this computer's terminals only, not another computer shown over ssh.
  • Plugin actions have no key bindings. They run from the palette and qoop plugin run.

When it does not work

  • Install refuses the manifest: read the reason, such as a minimum Herdr version above 0.9.5 or a platform list without yours.
  • Install says the id exists, or a build fails: run qoop plugin rm <id> first.
  • An action refuses to run: qoop plugin ls names why, usually a manifest that changed since your yes. Remove it, install again and read the new preview.
  • A write from an action fails: someone is at that terminal, or the agent is blocked.
  • The palette shows plugin host not running: quit qoop and start it again.
  • A ctrl+click does nothing: check your terminal's setting in step 5.

Doing this with qoop

The preview matters because a plugin acts as you, and in qoop it can type into your agents' terminals. The rules that stop a second writer from talking over you apply to a plugin as well, apart from the two exceptions in step 3.

The full command and key lists are in the qoop CLI reference and the keyboard shortcuts. To weigh the two tools against each other, see qoop vs Herdr.

To try it, sign up at https://qoop.si.

[linked from]