Automattic / Automattic/studio
npm-installed wp-studio silently shadows the app's studio shim, allowing indefinite version drift
- Dominant language
- TypeScript
- Stars
- 517
- Forks
- 95
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 162
Description
Studio.app installs a `studio` shim at `/usr/local/bin/studio` and `~/.local/bin/studio`, both pointing at `Studio.app/Contents/Resources/bin/studio-cli.sh`. That shim uses the app's bundled Node and CLI, so it tracks the app automatically.
Installing the CLI from npm instead puts `studio` in the Node bin directory, which typically sits **earlier on PATH** (nvm, Homebrew). From then on, `studio` in a terminal is the npm copy — and the npm copy does not auto-update. It only prints an "Update available" banner.
I hit this with the npm CLI at **1.11.0** while Studio.app had reached **1.21.0** — ten minor versions apart, with no indication that the `studio` I was typing wasn't the one the app maintains.
**Why this matters beyond tidiness:** each install bundles its own PHP runtime and its own copy of `sqlite-database-integration` (~25 sqlite-related paths and ~30 PHP artifacts in each). Both drive the same site directories and the same `.ht.sqlite` files. A user in this state has two different SQLite drivers writing the same databases, depending on whether they clicked in the app or typed in a terminal.
### Reproduce
1. Install Studio.app.
2. `npm install -g wp-studio`
3. `which -a studio` — the npm path wins:
```
~/.nvm/versions/node/v24.14.0/bin/studio -> npm wp-studio
~/.local/bin/studio -> Studio.app/.../studio-cli.sh
/usr/local/bin/studio -> Studio.app/.../studio-cli.sh
```
4. Let Studio.app auto-update. The npm copy stays behind indefinitely.
### Expected
Either the npm package refuses to shadow an app-managed shim, or `studio` warns when the CLI and app versions differ, or the Settings → **Studio CLI for terminal** toggle detects and reports the conflict.
### Actual
Silent shadowing and unbounded version drift.
### Environment
macOS on Apple M2, Studio.app 1.21.0, `wp-studio` 1.11.0 from npm, `sqlite-database-integration` 3.0.0-rc.8.
Contributor guide
Research direction
Start by comparing the npm `studio` entry in the Node bin directory with `/usr/local/bin/studio`, `~/.local/bin/studio`, and the app's `studio-cli.sh`. Review the Settings → Studio CLI for terminal toggle and the npm installation path. Done means app-managed shims are not silently shadowed, or a clear version-conflict warning is shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, nodejs, typescript
- Domain
- cli, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100