htmlhost.co
cliterminaldeploydeveloper

Deploy HTML from the Terminal with One Command

htmlhost.co·May 26, 2026·2 min read

For developers who live in the terminal

If your workflow revolves around the terminal, switching to a browser to deploy an HTML file feels wrong. The htmlhost CLI lets you deploy from the command line in one command — and it remembers your project for future re-deploys.

Installation

Install the CLI globally via npm:

npm install -g htmlhost-cli

Verify the installation:

htmlhost --version

Authentication

Log in to your htmlhost.co account:

htmlhost login

This opens your browser for OAuth. Once authenticated, your API token is saved locally with 0600 permissions — it never leaves your machine.

Your first deploy

Navigate to your project and deploy:

cd ~/projects/my-demo
htmlhost deploy

The CLI auto-detects index.html in the current directory. Within 3 seconds, you'll see:

✓ Live at https://bold-fern-x3k.htmlhost.co
  Linked → .htmlhost (future deploys update this site)

How project linking works

After your first deploy, the CLI creates a .htmlhost file in your project directory. This file maps your project to the deployed site. On subsequent deploys, the CLI recognizes the link and updates the existing site instead of creating a new one.

You can override this behavior:

  • htmlhost deploy --new — force a new site, ignore the link
  • htmlhost deploy index.html — deploy a specific file

Multi-page sites

Deploy an entire directory as a multi-page site:

htmlhost deploy . --pages

Each HTML file becomes a page with a clean URL:

  • index.html → /
  • about.html → /about
  • blog/post.html → /blog/post

Asset handling

The CLI automatically processes local assets referenced in your HTML. CSS and JS files under 512 KB are inlined. Images, fonts, and other assets are uploaded to your media library and URLs are rewritten.

htmlhost deploy  # assets processed automatically
htmlhost deploy --no-assets  # skip asset processing

Media uploads

Upload standalone assets to your media library:

htmlhost upload logo.png
htmlhost upload ./assets/  # upload a directory

Each uploaded file gets a permanent CDN-backed URL you can use anywhere.

Putting it all together

A typical workflow looks like:

# Initial setup (once)
npm i -g htmlhost-cli
htmlhost login

# Daily workflow
htmlhost deploy              # update your site
htmlhost upload screenshot.png  # add an asset
htmlhost deploy . --pages    # multi-page deploy

Three commands cover 90% of what you'll ever need. Read the full CLI docs for advanced options.

Ready to try it yourself?

Paste HTML, get a link. Deploy your site in under 3 seconds — no config, no build step.

Start hosting