Skip to main content

Explyt CLI in herdr

herdr is a terminal multiplexer for AI agents: workspaces, tabs and panes, each running its own agent. Agents keep working even if you close the window. Explyt CLI is built on Pi, and herdr supports Pi, so Explyt CLI works in it.

Without the integration​

Explyt CLI is a regular terminal program. Open a pane in herdr and run explyt in it: the agent works as in any other terminal, and the pane survives closing the window.

The integration below gives you more: herdr starts receiving the agent state from the agent itself instead of guessing it from what is drawn on the screen. This gives accurate idle, working and blocked statuses in the Agent sidebar, correct notifications, and waiting for the agent to finish from scripts and other agents.

How to connect the integration​

  1. Install the Pi integration with the herdr command:

    herdr integration install pi

    herdr writes the extension to ~/.pi/agent/extensions/herdr-agent-state.ts. On Windows, ~ is your home directory, for example C:\Users\<user name>. If the PI_CODING_AGENT_DIR variable is set, the file appears in $PI_CODING_AGENT_DIR/extensions. The directory is created only if the Pi agent folder already exists.

  2. Check that the extension file appeared. Explyt CLI doesn't read the ~/.pi/agent/extensions folder itself, so you need to connect the extension with the --extension flag:

    explyt --extension ~/.pi/agent/extensions/herdr-agent-state.ts

    You can launch Explyt CLI this way by hand, and the next steps save you from typing the long command: you create a short explyt-herdr command.

  3. Open your shell settings file and add a line with the short command name at the end.

    bash: the ~/.bashrc file:

    alias explyt-herdr='explyt --extension "$HOME/.pi/agent/extensions/herdr-agent-state.ts"'

    zsh (the default on macOS): the ~/.zshrc file, same line:

    alias explyt-herdr='explyt --extension "$HOME/.pi/agent/extensions/herdr-agent-state.ts"'

    PowerShell (Windows): the profile that opens with notepad $PROFILE. If the file doesn't exist, create it first with New-Item -ItemType File -Force $PROFILE. In PowerShell an alias doesn't take arguments, so add a function instead:

    function explyt-herdr { explyt --extension "$HOME\.pi\agent\extensions\herdr-agent-state.ts" @args }

    If you set the PI_CODING_AGENT_DIR variable, replace $HOME/.pi/agent in the path with its value.

  4. Apply the changes: open a new pane in herdr or run source ~/.bashrc in the current one (in zsh, source ~/.zshrc; in PowerShell, . $PROFILE).

  5. In a herdr pane, launch the agent with explyt-herdr instead of explyt. You can add any explyt arguments after it, for example --continue.

Verify the setup​

Run explyt-herdr in a pane and give the agent a task. While it works, the pane has the working status in the herdr sidebar, and idle when the agent finishes. The herdr agent explain <pane> command shows what exactly herdr detected for the pane.