Skip to content
Back to skills

Interactive Command

ASecurity

Runs an interactive command in a separate window and waits for it to close, and covers closing a herdr tab safely. Invoked only when another skill explicitly calls for it, never on its own.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 10, 2026
ai-agentsbash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add LandonSchropp/agent-toolkit --skill interactive-command --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Interactive Command?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Interactive Command
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/landonschropp-interactive-command/badge)](https://www.skillsdirectory.com/skills/landonschropp-interactive-command)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: interactive-command
description: Runs an interactive command in a separate window and waits for it to close, and covers closing a herdr tab safely. Invoked only when another skill explicitly calls for it, never on its own.
user-invocable: false
---

# Interactive Command

Run `scripts/interactive-command.sh --command '<command>' --name <name>`. It opens the command in a new herdr tab in the agent's workspace and blocks until that tab closes. The command persists its own result — an editor saves the file it was given, so write a scratch file first and read it back after.

The script also exits with the command's own exit code once the tab closes (or 1 if the tab is closed before the command finishes). Read this exit code if the wrapped command's own success/failure is meaningful to the caller. If it isn't, ignore it explicitly — `wait "$command_pid" || true` — so `set -e` doesn't abort the caller on an exit code it doesn't care about.

Always run the script in the background, with no timeout, so it can run until the tab closes. After running the command, print a short message provided by the calling skill to let the user know it has been opened. You're notified when the tab closes.

## Closing a Tab

The tab you opened is yours. You put it on the user's screen, so you take it off again, and never end a turn asking them to close a window you opened.

On the normal path there is nothing to do: the user closes the tab, and the script exits carrying the command's result. Close it yourself the moment you stop waiting on that result, whatever the reason — the user redirects the session, or the workflow it belongs to is abandoned. A result you have stopped waiting for is worth nothing, so losing it costs nothing.

The script traps termination signals and closes its own tab on exit, so end the script rather than closing its tab: run it with the Bash tool's `run_in_background` and stop it with `TaskStop` on the task id it returns.

- **Never background a script with `&`.** `run_in_background` gives you a task id to stop it by and tells you when it finishes. `&` gives you neither.
- **Never hunt for a script's process.** `pkill -f`, `killall`, and `ps | grep | xargs kill` match every workspace and agent session on the machine, killing other sessions' tabs and the user's editors along with yours. A filter that looks scoped, like `grep "name review"`, is the worst: that label is identical in every workspace.

A tab left over from an earlier session has no task id. Close that one by tab id, scoped to the workspace since labels aren't unique across workspaces:

```bash
tab_id=$(herdr tab list --workspace "$HERDR_WORKSPACE_ID" | jq -r --arg label "<label>" '.result.tabs[] | select(.label == $label) | .tab_id')
[[ -n "$tab_id" ]] && herdr tab close "$tab_id"
```

Files in this skill

  • SKILL.md2.2 KB
  • scripts/interactive-command.sh3.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.