[verification] HIGH: npx -y @claude-flow/cli@alpha --version hangs after printing version, never exits
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 83
Description
## Summary
`npx -y @claude-flow/cli@alpha --version` (and `npx -y ruflo@alpha --version`) prints the version string (`ruflo v3.37.0`) but then hangs indefinitely — the process does not exit. A 60 s hard timeout was required to kill it (exit code 124 / SIGTERM). This is user-visible breakage for any user running the alpha CLI for the first time.
## Impact
Any user who runs `npx ruflo@alpha --version` or `npx @claude-flow/cli@alpha --version` will see the version printed and then the terminal hang forever. The process must be manually killed (Ctrl-C). This is the first command most new users try, and it blocking is a critical first-impression regression.
## Expected
```
ruflo v3.37.0
[process exits 0 in <5 s]
```
## Actual
```
npm warn deprecated koa-router@14.0.0: Please use @koa/router instead...
npm warn deprecated prebuild-install@7.1.3: ...
npm warn deprecated boolean@3.2.0: ...
npm warn deprecated node-domexception@1.0.0: ...
ruflo v3.37.0
[hangs — killed after 60 s]
```
Exit code: 124 (SIGTERM from timeout)
Note: `npx @claude-flow/cli@3.37.0 doctor` (pinned version, different flag) completes successfully in ~45 s, so the CLI is not entirely broken — the hang appears specific to the `--version` code path or to first-run behavior with dist-tag resolution.
## Command output
```
timeout 60 npx -y @claude-flow/cli@alpha --version 2>&1 | tee check2.log
npm warn deprecated koa-router@14.0.0: Please use @koa/router instead, starting from v9!
npm warn deprecated prebuild-install@7.1.3: No longer maintained...
npm warn deprecated boolean@3.2.0: Package no longer supported...
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
Terminated
exit code: 124
```
A second invocation captured the version string but also timed out:
```
CLI exit: 124, version: ruflo v3.37.0
```
## Likely root cause
The CLI entry point likely starts background workers, watchers, or a daemon auto-start path that runs even for `--version`. Commander.js's built-in version handler calls `process.exit()` only after the synchronous option-parse phase — if any async work or libuv handles are registered before that point, the process will not exit.
## Recommended fix
Audit the CLI entry point (likely `v3/@claude-flow/cli/src/index.ts` or similar) for background handle registration at import time. Ensure that `--version` triggers an immediate `process.exit(0)` before any long-lived work is started, or defer all background initialization until after the flags are fully parsed.
## Relevant report section
Check 2 of the automated verification run.
## Environment
- **Commit:** 6ce18b5a7fcd4939a2f72c2e3b8fdbdec660e5a9
- **Package version:** @claude-flow/cli@3.37.0 (alpha tag)
- **Node:** v22.22.2
- **npm:** 10.9.7
- **OS:** Linux x86_64
- **Timestamp UTC:** 2026-08-11T19:03:35Z
Contributor guide
Research direction
Start with v3/@claude-flow/cli/src/index.ts or the CLI entry point referenced in the report, then reproduce with `npx -y @claude-flow/cli@alpha --version` under the 60-second timeout. Trace initialization around version handling and verify that the command prints `ruflo v3.37.0` and exits 0 in under five seconds without leaving background handles running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100