⚡ The package you're looking for is
@shipstatic/ship— that's where the code and the full documentation live.This is an alias for it, so a guess at the unscoped name doesn't dead-end. Use it directly —
npx shipstatic-cliruns the same binary,import Ship from 'shipstatic-cli'resolves to the same module. Nothing to switch to.
Deploy a static site from the terminal or from code.
npx shipstatic-cli ./distNo account, no API key, no config, no install. This works in a fresh sandbox with no secrets set.
Point it at your built output — ./dist, ./build, ./out — not your project root. Build first if the project needs it. A single file works too:
npx shipstatic-cli ./index.htmlWhat you get back: the live URL, plus a claim URL.
Anonymous deployments are public and expire in 3 days. The claim URL is how one becomes permanent — surface it to whoever asked for the deploy.
Deploying — npx shipstatic-cli ./dist, and npx shipstatic-cli deployments upload ./dist |
Nothing. No account, no API key, no deploy token, no login. |
Everything else — domains, tokens, whoami, listing deployments |
Requires an API key. |
ship whoamifailing is normal without a key, and it says nothing about deploying. An authentication error from any other command is not a reason the deploy won't work — run the deploy anyway. It stays anonymous.
Need the rest? Get a free key at my.shipstatic.com/api-key, then ship config.
| Goal | Command |
|---|---|
| Deploy a folder | npx shipstatic-cli ./dist |
| Deploy one file | npx shipstatic-cli ./index.html |
| Password-protect it | npx shipstatic-cli ./dist --password "secret" |
| Machine-readable output | npx shipstatic-cli ./dist --json |
| Keep the password out of logs | SHIP_PASSWORD="secret" npx shipstatic-cli ./dist |
| Repeat use | npm install -g shipstatic-cli → the ship command |
npx shipstatic-cli ./dist --json--jsonemits machine-readable output on success and on failure.- Exit code is
0on success, non-zero on failure. Branch on it, not on the text. - Errors carry a stable
errortype andstatus. Branch on those, never on the message string. --no-coloris honoured; colour is off automatically when stdout is not a TTY.SHIP_PASSWORDsupplies--passwordfrom the environment.
Deploying needs no credentials, so there is nothing to configure before the first run and nothing to leak in a log.
import Ship from 'shipstatic-cli';
const result = await new Ship().deploy('./dist');
// result.deployment → live URL
// result.claim → visit to keep permanentlyCustom domains, API keys, deploy tokens, managing deployments, the complete SDK reference — @shipstatic/ship.