devhost CLI

Deploy from your terminal, or let your AI do it.

One command installs it. You sign in with your browser, the token goes into your OS keychain, and every deploy uses a fresh upload login that is deleted the moment it finishes. Nothing secret is printed, so it is safe to hand to Claude Code, Cursor or any coding agent.

curl -fsSL https://devhost.io/cli/install.sh | sh

macOS and Linux (Windows: use WSL). Needs Node.js 18 or newer. The installer checks the download's SHA-256 before installing to ~/.local/bin/devhost.

Quick start

Five commands to your first deploy.

devhost login              # opens the portal; approve the code you see
devhost sites              # your hosted sites
devhost link example.com --dir public
devhost deploy --dry-run   # what would be uploaded
devhost deploy             # upload into public_html

Run devhost link once per project; after that, devhost deploy is all you need.

Reference

Commands.

devhost login [--no-browser]
Sign in with your browser. Prints a link and a code; you approve it in the portal.
devhost whoami [--json]
Show the signed-in account and when the session expires.
devhost sites [--json]
List your hosted sites with their PHP version and HTTPS status.
devhost sites create <domain> [--php 8.4]
Add a hosted site: folder, PHP and HTTPS. If we can't tell the domain is yours, it prints the TXT record to publish.
devhost dns zones [add <domain>]
List your DNS zones, or add one (free).
devhost dns records <zone>
List a zone's records with their ids.
devhost dns add <zone> <type> <name> <content>
Add a record; --ttl and --priority are optional. rm <zone> <id> removes one.
devhost link <domain> [--dir <folder>]
Remember which site this folder deploys to. Writes devhost.json, which holds no secrets.
devhost deploy [folder] [--site <domain>] [--dry-run] [--json]
Upload a folder into the site's public_html over FTPS. Adds and overwrites; never deletes.
devhost logout
Sign out here and revoke the token on our side.

Never uploaded: .git, .devhost, .claude, node_modules, .env* and devhost.json.

Security

How sign-in works.

  1. devhost login prints a link and a short code such as KDRT-WMXB.
  2. You open the link while signed in to your portal, check the code matches your terminal, and approve.
  3. The CLI receives a token once and stores it in the macOS Keychain or your Linux keyring. It lasts 90 days.
  4. Each devhost deploy asks for its own FTPS login, uploads, and closes it; unclosed logins are removed within two hours.

See and sign out every device at portal → devices. Only account administrators can approve a login, and a team member's token stops working when their portal access is removed.

With your AI assistant

Paste this into Claude Code, Cursor or Codex.

Deploy this project to example.com with the devhost CLI.
If it isn't installed, run: curl -fsSL https://devhost.io/cli/install.sh | sh
Run `devhost login` and show me the link and code so I can approve it.
Then `devhost link example.com --dir <build folder>`, a `devhost deploy --dry-run`
for me to check, and `devhost deploy`.

You approve the login yourself, so the assistant never holds more access than you grant, and it never sees a password. Prefer not to install anything? Each site's hosting page has Connect your AI assistant: a one-time link that drops a deploy kit into the project.

Questions or a site that isn't listed? Contact us.