@assistant-ui/agent-launcher
v0.1.14
Published
Spawn the Claude Code CLI with a chosen plugin directory, skill, and prompt
Readme
@assistant-ui/agent-launcher
Spawn the Claude Code CLI with a chosen plugin directory, skill, and prompt.
Used internally by the assistant-ui CLI's agent command. Call it directly when wiring up your own integration that bundles Claude Code plugins or skills.
Installation
npm install @assistant-ui/agent-launcherThe claude CLI must be available on PATH. If it is missing, launch prints an install hint and exits with code 1.
Usage
import { launch } from "@assistant-ui/agent-launcher";
launch({
pluginDir: "/absolute/path/to/plugins", // forwarded as --plugin-dir
skillName: "assistant-ui", // optional; sends /<skill> <prompt>
prompt: "Add a thread component to this project.",
dry: false, // print command without spawning
});The child process inherits stdio, so output streams directly to the parent terminal. launch exits the parent with the child's status code on non-zero exit and re-raises the child's termination signal on the parent when the child is killed by a signal. Re-raising removes the parent's listeners for that signal so the default disposition applies; launch assumes it owns the process lifetime. If the signal does not terminate the parent, launch exits with the conventional 128 + signal number status.
