Installation
Three ways to install SmartSpec. Pick the one that fits your workflow.
Via global npm
The simplest way if you already have Node.js 20 or higher.
npm install -g smartspec
smartspec --version Available at npmjs.com/package/smartspec.
Verify the install
smartspec --version
smartspec doctor
smartspec audit https://example.com -m 1
If smartspec doctor passes and the audit yields roughly
score: 59, you're good.
Surgical audit, schema only
Limit an audit to a single module with --only. Markdown output saved to file.
smartspec audit https://my-site.app --only schema -f markdown -o schema.md Combinable: --only schema,performance. See every flag →
Requirements
GOOGLE_PSI_API_KEY env var)Troubleshooting
command not found: smartspec
Make sure the global npm bin is in your $PATH.
Run npm bin -g to find the npm path.
permission denied on npm install -g
Use a Node version manager (nvm, fnm, volta) instead of running Node globally as root.
Avoid sudo npm.
PSI not working (performance: null in findings)
Without an API key, PageSpeed Insights v5 has a tiny free quota. Generate a key from the
Google Developer Console and
export it as GOOGLE_PSI_API_KEY.