stack/packages
BilalG1 b0181ea195
fix(cli): ship a single hexclave bin so pnpx/pnpm dlx can resolve it (#1533)
## Problem

`pnpx @hexclave/cli <cmd>` (i.e. `pnpm dlx`) fails, even though `npx
@hexclave/cli <cmd>` works.

## Root cause

`@hexclave/cli` exposed **two** bins — `hexclave` and `stack` — and
neither matches the package's unscoped name (`@hexclave/cli` → `cli`).
When a package has multiple bins and none matches the unscoped name, the
two runners diverge:

- **npx** silently picks the *first* bin and runs it → worked by luck.
- **pnpm dlx / pnpx** refuses to guess and errors:
  ```
  ERR_PNPM_DLX_MULTIPLE_BINS  Could not determine executable to run.
  @hexclave/cli has multiple binaries: hexclave, stack
  ```

Reproduced and verified offline with a throwaway 2-bin package; also
verified that a **single**-bin package auto-resolves under both `npx`
and `pnpm dlx` even when the bin name doesn't match the unscoped package
name.

## Fix

Drop the `stack` bin, leaving a single `hexclave` bin → both `npx` and
`pnpm dlx`/`pnpx` resolve it unambiguously. Follow-through to keep the
CLI self-consistent:

- `resolveBinName` now prefers `hexclave` for the npx self-update
re-exec, so auto-update targets a bin guaranteed to exist in `@latest`
(it previously hard-preferred `stack`).
- Program name (`--help` usage) `stack` → `hexclave`.
- User-facing `stack <cmd>` guidance strings (in error messages / tips
across `auth`, `init`, `dev`, `config-file`, `exec`, `project`,
`doctor`, `local-emulator-client`) → `hexclave <cmd>`, so the CLI never
points users at a command that no longer exists.
- Unit test updated for the new bin preference.

## ⚠️ Breaking-change note

This drops the `stack` command. Fresh `npx`/`pnpx` users are unaffected,
but anyone with an *older* version installed loses the `stack` bin on
upgrade. Subtly, a stale install's auto-update re-execs `npx -p
@hexclave/cli@latest stack …` (its baked-in logic prefers `stack`); once
`@latest` drops the `stack` bin that one re-exec fails for those stale
installs. If we want a deprecation window, we can keep `stack` as a bin
for a release instead.

## Testing

- `pnpm lint` 
- `pnpm typecheck` 
- `pnpm test` (stack-cli)  148/148 (pure unit tests, no backend
required)

> Stacked on top of `rde-cli-auto-update` —
`resolveBinName`/`self-update.ts` only exist on that branch, so this
targets it rather than `dev`.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Ship a single `hexclave` bin for `@hexclave/cli` so `pnpx`/`pnpm dlx`
resolve the executable reliably. The CLI now uses `hexclave` as the
canonical command, including self-update re-execs.

- **Bug Fixes**
- Dropped the `stack` bin; kept only `hexclave`, fixing
ERR_PNPM_DLX_MULTIPLE_BINS when running `pnpx @hexclave/cli <cmd>`.
- `resolveBinName` now prefers `hexclave`; program name, help, and error
messages updated; tests adjusted.

- **Migration**
- The `stack` command is removed. Use `hexclave <cmd>`. Older installs
that re-exec `stack` may fail; run `npx -p @hexclave/cli@latest hexclave
...` or reinstall.

<sup>Written for commit bf5d6ac727.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/hexclave/hexclave/pull/1533?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->
2026-06-02 15:57:13 -07:00
..
dashboard-ui-components Update light mode logo 2026-06-01 15:05:44 -07:00
init-stack chore: update package versions 2026-06-01 21:41:58 +00:00
js chore: update package versions 2026-06-01 21:41:58 +00:00
react chore: update package versions 2026-06-01 21:41:58 +00:00
stack chore: update package versions 2026-06-01 21:41:58 +00:00
stack-cli fix(cli): ship a single hexclave bin so pnpx/pnpm dlx can resolve it (#1533) 2026-06-02 15:57:13 -07:00
stack-sc chore: update package versions 2026-06-01 21:41:58 +00:00
stack-shared chore: update package versions 2026-06-01 21:41:58 +00:00
stack-ui chore: update package versions 2026-06-01 21:41:58 +00:00
tanstack-start chore: update package versions 2026-06-01 21:41:58 +00:00
template chore: update package versions 2026-06-01 21:41:58 +00:00