Package Exports
- @mushi-mushi/cli
- @mushi-mushi/cli/detect
- @mushi-mushi/cli/init
- @mushi-mushi/cli/version
Readme
@mushi-mushi/cli
CLI for Mushi Mushi — set up the SDK in one command, then triage reports and monitor the pipeline from your terminal.
One-command setup
npx @mushi-mushi/cli init
# equivalently:
npx mushi-mushiThe wizard:
- Detects your framework (Next.js, Nuxt, SvelteKit, Angular, Expo, Capacitor, plain React/Vue/Svelte, or vanilla JS) from
package.jsonand config files. - Picks the right SDK package (
@mushi-mushi/react,@mushi-mushi/vue, etc.) plus@mushi-mushi/webwhen the framework SDK is API-only. - Detects your package manager (npm / pnpm / yarn / bun) from your lockfile and installs with that —
shell: false, with Windows.cmdshim resolution. - Writes
MUSHI_PROJECT_IDandMUSHI_API_KEY(with the right framework prefix —NEXT_PUBLIC_,NUXT_PUBLIC_,VITE_) to.env.local(or.env). - Warns you if
.env.localisn't in.gitignore(covers.env*.local,*.local, etc.). - Prints the framework-specific provider snippet to copy-paste.
- Offers to send a real test report so you see your first classified bug in the console immediately. Opt out via
--skip-test-report.
It never silently overwrites existing env vars or modifies application code. Pasted credentials are sanitized (stripped of quotes / CR / LF / NUL) and validated against ^proj_[A-Za-z0-9_-]{10,}$ / ^mushi_[A-Za-z0-9_-]{10,}$ before anything is written to disk.
Flags
mushi init --framework next # skip framework detection
mushi init --project-id proj_xxx --api-key mushi_xxx # skip credential prompts
mushi init --skip-install # print the install command instead
mushi init --skip-test-report # don't offer to send a test report
mushi init --cwd apps/web # run in a sub-package of a monorepo
mushi init --endpoint https://mushi.your-company.com # self-hosted Mushi API
mushi init -y # accept the detected frameworkNon-interactive use (CI): pass --yes --project-id proj_xxx --api-key mushi_xxx or the wizard exits with a clear error instead of hanging on a prompt.
Stale-version hint: the wizard checks the npm registry (2s timeout) and prints a one-line upgrade nudge if a newer stable is published. Opt out with MUSHI_NO_UPDATE_CHECK=1.
Monorepo awareness: if you run the wizard at a workspace root with no framework dep, it scans apps/*, packages/*, examples/* and tells you which sub-package you probably meant (mushi init --cwd apps/web).
Install globally
npm install -g @mushi-mushi/cli
mushi --help
mushi --versionOther commands
mushi login --api-key mushi_xxx # store credentials in ~/.mushirc (mode 0o600)
mushi status # project overview
mushi reports list # recent reports
mushi reports show <id> # one report
mushi reports triage <id> --status acknowledged --severity high
mushi deploy check # edge-function health probe
mushi index <path> # walk a local repo and feed RAG
mushi test # submit a test report end-to-end
mushi migrate # suggest the most relevant migration guide
mushi migrate --json # machine-readable JSON for CI
mushi config endpoint https://... # set API endpoint (https:// required outside localhost)mushi migrate
Reads package.json (deps + devDeps + peerDeps) and prints links to the
matching guides on the docs site. Detects:
- In-transition shapes — Capacitor + React Native side-by-side, Cordova
(or
cordova-ios/cordova-android), Create React App. - Competitor SDKs — Instabug / Luciq, Shake, LogRocket Feedback, BugHerd, Pendo Feedback.
Exits non-zero when nothing matches, so it composes in shell scripts:
mushi migrate || echo "no migration suggestions for this project"Only published guides ever surface — draft entries are filtered out so
the CLI never points users at a 404. This safety property is unit-pinned in
packages/cli/src/migrate.test.ts (positive control + negative control +
real-catalog regression guard).
Security notes
~/.mushircis written with mode0o600on Unix. Legacy configs with looser permissions are tightened on load.--endpointvalues are parsed throughnew URL()and required to usehttps://except forlocalhost/127.0.0.1/*.local.- The
--api-keyflag leaks intops -ef— prefer the interactive prompt on shared machines. - Full stack traces on error:
DEBUG=mushi mushi init.
License
MIT