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

Open
#298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
bun, typescript
Domain
build-system, cli

Research direction

Reproduce the issue with bunx @stripe/link-cli auth status --format json, then inspect the bundled entrypoint and its default export shape. Compare the Bun and npx/Node behavior; done means the command exits normally after printing only the expected JSON response under Bun.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
789
Forks
119
Avg merge
13h 36m
Merged PRs (30d)
70

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stripe/link-cli

All issues in stripe/link-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.