Skip to content

CLI

npx hostedge login     # opens your browser to authorize
npx hostedge deploy    # uploads changed files and streams the build

Install#

Run it without installing (npx hostedge), or install it once:

npm install --global hostedge
# or
curl -fsSL https://hostedge.app/install.sh | sh

It needs Node.js 20.11 or newer. Then hostedge login and hostedge deploy work from any folder.

Commands#

CommandWhat it does
hostedge loginOpens HostEdge in your browser; pick a workspace and the CLI receives a 90-day token. --token <token> skips the browser; --with-token reads the token from stdin.
hostedge logoutForgets the token on this computer. Revoke it in Settings › API tokens.
hostedge whoamiThe account, workspace and scopes in use.
hostedge ai-kitWrites AGENTS.md, CLAUDE.md, a Cursor rule and a Claude Code skill. See Agent kit. --force overwrites.
hostedge initLinks the folder to a new or existing project (--project <slug>). Writes .hostedge/project.json and adds it to .gitignore. --ai also writes the agent kit.
hostedge deployDeploys the folder. --preview for a preview, -m for a message, --no-wait to return after queueing. Exits with 5 if the build fails.
hostedge logsRuntime logs. -f follows, --level error, --search <text>, --since 30m|1h|24h|7d.
hostedge env pullWrites variables to .env.local (mode 600, git-ignored). -e production for another environment.
hostedge share [port]A public HTTPS link (and QR code) to a dev server on your computer, to try it on your phone. See Share localhost.

The first hostedge deploy in an unlinked folder creates the project and links it.

Scripts and agents#

Every command takes these options:

OptionEffect
--jsonMachine-readable output on stdout (NDJSON for logs). Progress and human text go to stderr, never to stdout.
-y, --yesNever prompt. CI=1 and a missing terminal do the same; commands fail with a clear message instead of waiting.
-q, --quietOnly results and errors. hostedge deploy -q prints only the URL.
--api-url <url>Use another HostEdge for this run (same as HOSTEDGE_API_URL).
--no-colorPlain text. NO_COLOR is respected too.
hostedge deploy --wait --json
# {"deploymentId":"dep_…","status":"ready","url":"https://….hostedge.app","failureReason":null,…}

If the build fails the same JSON is printed with "status":"failed" and the reason in failureReason, and the exit code is 5. Tokens are never printed: use HOSTEDGE_TOKEN, or pipe one to hostedge login --with-token.

Exit codes#

CodeMeaning
0Success
1Generic failure
2Usage error (unknown flag or command, missing input)
3Authentication error (not signed in, token invalid, expired or revoked)
4Not found (project, deployment or linked folder)
5Deployment failed or was canceled
6A plan limit was reached

More in Agent kit.

Continuous integration#

Create a token in Settings › API tokens with the deployments:write and projects:read scopes, store it as a secret, and run:

- run: npx hostedge deploy --message "${{ github.sha }}"
  env:
    HOSTEDGE_TOKEN: ${{ secrets.HOSTEDGE_TOKEN }}

What gets uploaded#

The same rules as the dashboard: .git, node_modules and similar folders are skipped, files that look like secrets are left behind with a note, and symbolic links are refused.

View this page as MarkdownAll docs as one file