Install
Install metro with git clone and install-global.sh, then check it with metro doctor.
metro needs Node 18 or newer, git and npm. It runs on macOS and Linux.
git clone --depth 1 https://github.com/metrocli/metro.git ~/.metro/src
bash ~/.metro/src/scripts/install-global.sh
metro initWhat install-global.sh does
The script keeps a persistent checkout at ~/.metro/src and links it, so metro is a real file on your PATH.
- Clears any broken global
@metrocli/metrolink. - Clones
~/.metro/src, or pulls with--ff-onlyif it already exists. It never deletes the checkout. - Runs
npm installandnpm linkinside it. - Proves
metrois onPATH, and refuses to finish if npm linked into its temp cache.
Run it again any time to update: bash ~/.metro/src/scripts/install-global.sh. Set METRO_INSTALL_DIR to use another checkout path.
Don't use npm install -g git+https://...
On current npm that often leaves a metro symlink into an empty temp checkout. You see "added 1 package", then metro: command not found. The script exists to avoid exactly this.
Check the install: metro doctor
metro doctor checks the install without touching Metronome. Add --json for agents. The output below is illustrative of a healthy install; your paths differ.
metro install doctor
Healthy: yes
[pass] Node.js 18+: Node 24.22.2
[pass] metro on PATH: /usr/local/bin/metro
[pass] Global @metrocli/metro link: ...
[info] Source checkout: ~/.metro/srcEach failing check prints a fix: line with the exact command, and doctor ends with Next:. The checks are:
| Check | What it proves |
|---|---|
INSTALL-NODE-001 | Node 18 or newer |
INSTALL-PATH-001 | metro resolves on your PATH |
INSTALL-NPM-002 | The global @metrocli/metro link exists and isn't a temp-cache link |
INSTALL-CHECKOUT-003 | ~/.metro/src is a real git checkout |
INSTALL-GH-002 | A warning only: whether the GitHub CLI is signed in |
Troubleshooting
| You see | Do this |
|---|---|
metro: command not found after install | Run export PATH="$(npm prefix -g)/bin:$PATH", then metro doctor. |
~/.metro/src exists but is not a git checkout | Open a new terminal in ~, remove that folder yourself, and run the two git commands again. |
ENOTDIR on a retry | You used npm install -g git+... earlier. Run install-global.sh; step 1 clears the broken link. |