Skip to content

Video as code: canvas scenes rendered with WebCodecs in headless Chrome, a review viewer, and agent skills that build the video from your references.

doctor: an exact Chrome install command on Linux

StaryOne14212d3ebda2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14fd631..bbac20d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ Changes are listed by release, newest first. The sections dated before 0.1.0 rec
### Changed
+- When Chrome is missing on Linux, `motlab doctor` prints the commands that install Google's `.deb` on x64 Debian or Ubuntu, and says the Chromium snap can fail headless, instead of "install Google Chrome or Chromium from your distribution". On other processors it says to use the distribution's Chromium, not the snap. Checked by printing the hint with the platform set to Linux x64 and arm64 on the Windows laptop; the commands have not been run on Linux.
- The README and the install docs run setup as `npx @motlab/cli setup`, which works before `motlab` is on PATH; npx runs the installed package and downloads nothing.
To tell whether npm's folder is on the user's PATH, setup drops the folders a Node process sees in front of it that the terminal does not have: nvm's shim puts Node's own folder first, and npx adds its `node_modules\.bin` folders, node-gyp-bin and Node's folder again. Under nvm, Node's folder is npm's global folder, so without this the check always passed. `test/install.test.js` covers both cases on the CI runners.
diff --git a/docs/install.md b/docs/install.md
index 43c5ebc..6d706dc 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -17,10 +17,16 @@ How to get them:
| | Windows | macOS | Debian or Ubuntu |
|---|---|---|---|
| Node 24 | `winget install OpenJS.NodeJS` | `brew install node` | [nodejs.org](https://nodejs.org) or nvm |
-| Chrome | `winget install Google.Chrome` | `brew install --cask google-chrome` | Google's `.deb`, or `sudo apt install chromium` |
+| Chrome | `winget install Google.Chrome` | `brew install --cask google-chrome` | Google's `.deb` on x64 (below); on Ubuntu, `apt install chromium` gives the snap, which can fail headless |
| ffmpeg | `winget install Gyan.FFmpeg` | `brew install ffmpeg` | `sudo apt install ffmpeg` |
| Python 3 | `winget install Python.Python.3.12` | `brew install python` | `sudo apt install python3 python3-pip` |
+Google Chrome on Debian or Ubuntu (x64), the command `motlab doctor` prints when Chrome is missing:
+
+```bash
+wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt install -y ./google-chrome-stable_current_amd64.deb
+```
+
The skill's scripts need numpy, scipy and Pillow:
```bash
diff --git a/src/doctor.js b/src/doctor.js
index 6b4f1c9..03ae675 100644
--- a/src/doctor.js
+++ b/src/doctor.js
@@ -16,7 +16,11 @@ const firstLine = s => s && s.split('\n')[0].trim();
const HINTS = {
win32: { ffmpeg: 'winget install Gyan.FFmpeg', chrome: 'winget install Google.Chrome', python: 'winget install Python.Python.3.12' },
darwin: { ffmpeg: 'brew install ffmpeg', chrome: 'brew install --cask google-chrome', python: 'brew install python' },
- linux: { ffmpeg: 'sudo apt install ffmpeg', chrome: 'install Google Chrome or Chromium from your distribution', python: 'sudo apt install python3 python3-pip' },
+ // Google's x64 .deb puts google-chrome in /usr/bin. Ubuntu's apt chromium is a snap, which can fail headless.
+ linux: { ffmpeg: 'sudo apt install ffmpeg', python: 'sudo apt install python3 python3-pip',
+ chrome: process.arch === 'x64'
+ ? 'on Debian or Ubuntu, Google Chrome (the Chromium snap can fail headless):\n wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt install -y ./google-chrome-stable_current_amd64.deb'
+ : 'install Chromium from your distribution, not the snap (the Google Chrome .deb is for x64)' },
};
// Each check: { name, ok, detail, fix, optional }. Required checks decide the exit code.
@@ -26,7 +30,7 @@ export function checks() {
out.push({ name: 'Node.js 24 or newer', ok: major >= 24, detail: process.version, fix: 'install Node 24 from https://nodejs.org or with nvm' });
let chrome = null; try { chrome = findChrome(); } catch {}
- out.push({ name: 'Google Chrome or Chromium', ok: !!chrome, detail: chrome || 'not found', fix: `${hint.chrome}, or set CHROME=/path/to/chrome` });
+ out.push({ name: 'Google Chrome or Chromium', ok: !!chrome, detail: chrome || 'not found', fix: `${hint.chrome}\n or set CHROME=/path/to/chrome` });
for (const tool of ['ffmpeg', 'ffprobe']) {
const v = firstLine(run(tool, ['-version']));