Skip to content

bunx hangs after link-cli commands by implicitly starting a development server #298

Description

@awlevin

summary

running link cli through bunx produces the expected command output, then bun implicitly starts a development server and keeps the process alive indefinitely. this prevents agent tool calls from resolving, leaving conversations stalled until tools timeout.

reproduction

bunx @stripe/link-cli auth status --format json

actual behavior

  1. link cli prints the valid json response.
  2. bun prints a started development server message to stdout.
  3. the process remains alive until it is manually killed or an external timeout fires.

this also contaminates structured stdout, so callers expecting only json cannot parse the result reliably.

expected behavior

once the command prints its response, the process should exit normally, matching the behavior under npx/node.

likely cause

link cli's bundled entrypoint appears to have a default export containing a fetch method. when invoked through bunx, bun interprets that export as a server entrypoint and automatically starts its development server, even though the user invoked a normal cli command.

idk why bun does this; it's annoying, but 🤷

environment

  • @stripe/link-cli: 0.16.0
  • runtime: bun via bunx
  • equivalent npx invocation exits normally

suggested resolution

could the bundle/export shape be adjusted so bun does not interpret ordinary cli execution as a server entrypoint? alternatively, documenting that bunx is currently unsupported would prevent agents and users from encountering a command that returns valid output but never exits.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions