Skip to content

Routed CLI (src/cli/**) is only emitted into the npm package build, not into host artifacts — artifact scripts/skills cannot invoke it #387

Description

@ScriptedAlchemy

What happened

In framework mode src/cli/**/*.tsx compiles to the generated CLI bin (dist/bin/<name>.js, dist/bin/<name>-flight.mjs) as part of the package build. Host artifacts (artifact/plugin, artifact/portable) receive scripts/*.mjs, mcp/, hooks/, skills/, mcp-apps/ — but not the routed CLI.

For cargo-hauler that means:

  • The plugin ships scripts/hauler.mjs (a src/scripts/hauler.ts script route) which owns exec / install-shim / daemon and is meant to forward status | log | last | await | result | request to the routed CLI. Inside an installed plugin there is nothing to forward to, so node <plugin-root>/scripts/hauler.mjs status prints usage and exits 2.
  • The bundled SKILL.md files tell agents to run hauler status / hauler await <ticket>. From a plugin-only install (Claude marketplace, Codex marketplace, Cursor ~/.cursor/plugins/local) those commands do not exist unless the user separately installs the npm package.
  • The MCP tools cover the same surface, so MCP-capable sessions are fine — but hooks and skills are the surfaces that reach non-MCP shells.

Reproduce: agent-bundle build on ScriptedAlchemy/cargo-hauler at fa2f923, then node artifact/plugin/scripts/hauler.mjs status.

Ask

One of:

  1. Emit the generated routed CLI into each host artifact as well (e.g. artifact/<target>/bin/<name>.mjs alongside scripts/), so a script route can spawn(process.execPath, [sibling]) or the skills can reference ${CLAUDE_PLUGIN_ROOT}/bin/<name>.mjs.
  2. Or expose an in-process entry (agent-bundle/cli-runtime or similar) that a script route can import to dispatch argv through the compiled route graph without a second binary.

Related: a raw/streaming output mode for CLI routes that proxy a child process (own stdio entirely, return only an exit code) would let exec itself be a .ts CLI route instead of living in a separate script — today CLI routes must return a JSON-projectable result.

Pin: agent-bundle@105c65d8f.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions