@prezzee/prototype-hub-cli
v1.0.5
Published
CLI to deploy a static site to a prototype subdomain (*.prototype-hub.development.prezzee.com).
Maintainers
Keywords
Readme
@prezzee/prototype-hub-cli
prototype-hub — upload a static build to a prototype subdomain served by
@prezzee/prototype-hub (*.prototype-hub.development.prezzee.com).
Requires VPN access (the uploader API is private).
Usage
Run via npx — no install required:
npx @prezzee/prototype-hub-cli publish \
--name my-prototype \
--dir ./dist \
--endpoint https://prototype-hub.dev.api.prezzee.net# Single file
npx @prezzee/prototype-hub-cli publish \
--name my-prototype \
--file ./dist/index.html \
--endpoint https://prototype-hub.dev.api.prezzee.netIf the package is already installed (globally, or as a project dependency),
the same commands work via the prototype-hub binary directly, e.g.
prototype-hub publish --name my-prototype --dir ./dist ....
Preferred: if the project already has a package.json, install the
package as a dependency and add the command as a script instead of running it
ad hoc via npx each time:
npm install --save-dev @prezzee/prototype-hub-cli{
"scripts": {
"deploy": "prototype-hub publish --name my-prototype --dir ./dist --endpoint https://prototype-hub.dev.api.prezzee.net"
},
"devDependencies": {
"@prezzee/prototype-hub-cli": "^1.0.0"
}
}Installing it pins a specific version (reproducible across machines/CI) and
avoids npx's per-run resolution/download; the script can then call the
prototype-hub binary directly. Then run npm run deploy (or yarn deploy).
With pnpm, use pnpm run deploy — plain pnpm deploy is a reserved built-in
pnpm command and won't run this script.
--dirmust point at your project's build output directory — the folder your framework's build script produces (conventionally./dist; Next.js/Vite/CRA/etc. all default to this or something similar). It must not be the project root: run your build first (e.g.npm run build), then point--dirat the resultingdistfolder. Pointing--dirat a tree containingnode_modulesorpackage.jsonaborts the publish.--dirand--fileare mutually exclusive — provide exactly one.--endpointalso viaPROTOTYPE_UPLOAD_ENDPOINT.--secretalso viaPROTOTYPE_SECRET.
Publish secret
The secret is resolved in this order:
--secret$PROTOTYPE_SECRET./publish_secret.txt(current working directory)
If none is found, a strong secret is generated and written to ./publish_secret.txt.
Keep it to re-deploy the same prototype — anyone with it can overwrite the prototype.
- Add
publish_secret.txtto.gitignore; never commit it. - In CI, set
PROTOTYPE_SECRETrather than relying on the file. - The CLI never uploads
publish_secret.txt, wherever it sits in the tree.
Notes
--dirmust point at a build output directory, not your whole project. If anode_modulesfolder or apackage.jsonfile is found anywhere in the tree, the publish aborts with a message to move the public files into a directory like./dist— most frameworks already produce this via a build script (e.g.npm run build→./dist).- Only whitelisted file types are uploaded: web assets (html/css/js/json/map/txt/xml), images (including svg), fonts, and pdf/csv. Files of other types are skipped locally (with a reason) and the rest of the publish still proceeds; the server also rejects disallowed types if uploaded directly.
- Files larger than 10 MB are rejected locally and abort the whole publish (API Gateway REST payload cap) — unlike the file-type whitelist, this is a hard stop, not a skip-and-continue.
index.htmlis servedno-cache; other files get a short (max-age=60) TTL.- Prototype names must match
^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$and not begin withprezzee.
