@mushi-mushi/cli
v0.11.0
Published
CLI for Mushi Mushi — `mushi init` wizard installs the right SDK for your framework, plus report triage and pipeline health commands
Maintainers
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 sourcemaps upload --release <ver> --dir <dist> # upload .js.map / .css.map (sha256-idempotent)mushi sourcemaps upload
Recursively scans --dir for .js.map and .css.map files and uploads them
under the given --release. Each file is hashed (sha256) and skipped if the
server already has it for that release, so the command is safe to run from
every CI build without churning storage.
mushi sourcemaps upload --release 1.4.2 --dir ./dist
mushi sourcemaps upload --release "$GITHUB_SHA" --dir ./build --dry-run
mushi sourcemaps upload --release "$GITHUB_SHA" --dir ./build --silentRequires MUSHI_API_ENDPOINT and MUSHI_API_KEY (or pass --endpoint /
--api-key). Exits non-zero on any upload failure so CI gates fail fast.
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).
mushi doctor
Checks CLI and SDK health. Without flags it verifies local config and endpoint reachability only.
mushi doctor # local checks only
mushi doctor --server # + calls /preflight on the backend (all 4 dispatch checks)
mushi doctor --json # machine-readable JSON output (exits 1 if any check fails)Local checks performed:
| Check | What it verifies |
|---|---|
| CLI config | ~/.mushirc exists, projectId and apiKey fields are present |
| Endpoint reachability | GET /v1/sdk/config?project_id=... returns 200 |
| SDK install | @mushi-mushi/web or framework-specific SDK is in node_modules |
With --server, also calls GET /v1/admin/projects/:id/preflight (same 4 checks
the admin console dispatch popover uses) and merges the results. The four
server checks (key values returned by the endpoint):
| key | What it verifies |
|---|---|
| github | A GitHub repo URL is linked (project_repos.repo_url or project_settings.codebase_repo_url) |
| codebase | Codebase indexing is enabled AND pgvector has at least one non-tombstoned file AND last_indexed_at is set |
| anthropic | A BYOK Anthropic key is stored in Supabase Vault (project_settings.byok_anthropic_key_ref) |
| autofix | The autofix toggle is ON (project_settings.autofix_enabled = true) |
--server requires adminOrApiKey credentials — set MUSHI_API_KEY to an
admin key (not a public SDK key).
mushi reset <projectId>
Archives a project and wipes its test data so the full onboarding flow can be re-run. Useful for development and QA.
mushi reset proj_xxx --confirm # required flag prevents accidental wipesWipes: fix_attempts, project_codebase_files, reports, fix_dispatch_jobs.
Sets projects.archived_at. Irreversible.
mushi fixes tail --report-id <id>
Streams dispatch events for a report in real-time via SSE. Pairs with
mushi doctor --server for headless debugging without opening the admin console.
mushi fixes tail --report-id 11111111-2222-3333-4444-555555555555Exits automatically when the job reaches a terminal status (completed,
failed, cancelled, skipped).
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
