← back to hatch

Guide

Install the CLI

One line, on any machine:

curl -fsSL https://hatch.michaelwhchan.com/_platform/install.sh | bash

Then hatch deploy --target token deploys with just the passphrase - no Google Cloud account needed. (Admins with bucket access can use --target gcp.) Prefer no terminal? Use the drag-and-drop card on the home page.

Ship your first site in 60 seconds

  1. Create a site folder
    hatch init mysite
    Gives you a folder with an index.html - or bring any folder of your own.
  2. Deploy it
    cd mysite
    hatch deploy
    No build, no config, no tickets. Publishing live asks for the shared passphrase (no Google Cloud account needed).
  3. Share your link
    https://mysite.hatch.michaelwhchan.com/
    Live the moment deploy finishes; it also appears on the home page.

Commands

hatch init <name>

Scaffold a new site folder with a starter page.

hatch deploy

Publish the current folder. --name picks the subdomain, --dir points elsewhere. Redeploying syncs exactly - deleted files are removed. --target token (default when installed) publishes with the passphrase, no gcloud; --target gcp is for admins with bucket access.

hatch drop

Open the drag-and-drop deploy console in your browser - drop a folder, tick "Publish live", enter the passphrase.

hatch open <name>

Open a site in your browser.

hatch delete <name>

Remove a site (asks you to type the name to confirm). Also a small × on each card on the home page.

hatch restore <name>

Undo a delete - brings back every file, up to 30 days later. Also on the restore page.

Add data, realtime & identity

Your site can use a shared API with one script tag - no keys, no config, same-origin:

<script src="/_platform/hatch.js"></script>

const posts = hatch.db.collection('posts');
await posts.create({ title: 'Hello' });      // + list / get / update / delete
posts.subscribe({ onCreate: render });        // live updates (SSE)
const me = await hatch.identity.me();       // who's viewing

Data is per-site and shared across everyone viewing it. Great for votes, comments, dashboards, multiplayer.

Removing a site

  1. Delete it
    hatch delete mysite
    Shows what will be removed and asks you to type the name back - no accidental nukes.
  2. Changed your mind?
    hatch restore mysite
    Every file comes back within 30 days of deleting. After that it's gone for good.

How it works

Your folder syncs to cloud storage; a tiny server maps <name>.hatch.michaelwhchan.com straight onto it. No frameworks, no build steps, no databases to babysit - which is why it is fast, cheap, and hard to break. Site names: lowercase letters, digits, and hyphens.

House rules