npm.io
0.1.5 • Published 2d agoCLI

pubkeyc

Licence
MIT
Version
0.1.5
Deps
0
Size
1.5 MB
Vulns
0
Weekly
11

pubkeyc

Deploy frontend apps to pubkey.cloud from the command line.

Usage

No install required:

npx pubkeyc login
npx pubkeyc deploy --project my-app

Or install it globally:

npm install -g pubkeyc
pubkeyc deploy

Commands

Command Description
pubkeyc login Authenticate via your browser (device-code flow).
pubkeyc whoami Show the currently authenticated user.
pubkeyc logout Forget the cached token.
pubkeyc tokens Manage long-lived API tokens for CI (create / list / revoke).
pubkeyc deploy Bundle the current directory and deploy it.

deploy packages your current working directory (respecting .gitignore and .pubkeyignore), uploads it, and triggers a server-side build. The target project defaults to pubkey.json / package.json#pubkey.project / the directory name; override it with --project <slug>.

Deploy options
Flag Description
--project <slug> Target project. Auto-created on first deploy.
--label <label> Optional label (for example, a branch name).
--commit <sha> Pass a git revision through.
--yes Skip interactive prompts.
Global flags
Flag Description
--provider <url> Override the API endpoint (alias: --api). With login, the URL is saved alongside the issued token.
CI / non-interactive deploys

login needs a browser, so for CI use a long-lived API token instead. Mint one once from a machine where you're logged in:

pubkeyc login                       # interactive, one time
pubkeyc tokens create ci            # prints the secret ONCE — copy it

Then store it as a CI secret and pass it via the environment — no browser, no cached credentials file:

export PUBKEY_TOKEN=pk_# the token you just minted
pubkeyc deploy --project my-app --yes --license MIT --i-own-content

PUBKEY_TOKEN overrides any cached login. Tokens are revocable (pubkeyc tokens revoke <id>) and can expire (--expires <days>); minting and revoking require an interactive session, so a leaked CI token can only deploy.

Environment
Variable Description
PUBKEY_TOKEN Auth token for CI / non-interactive use. Overrides any cached login. Mint with pubkeyc tokens create.
PUBKEY_API_ORIGIN Fallback API origin when neither --provider nor a saved login origin is present. Defaults to https://api.pubkey.cloud (set to http://localhost:4000 for local development).

Requirements

Node.js 18 or newer.

Keywords