CLI Reference

The hostedat CLI manages deployments, storage buckets, and S3-compatible credentials. It authenticates with API keys and talks to your hostedat server over HTTPS.

Command summary

CommandDescription
hostedat loginAuthenticate in browser and save API key
hostedat sites ...Create, list, and delete sites
hostedat deploy ...Deploy a directory to a site
hostedat storage ...Manage worker storage buckets and uploads
hostedat storage-credentials ...Manage S3-compatible access keys
hostedat versionPrint CLI version and default server

Global flags

FlagEnv varDescription
--serverHOSTEDAT_SERVERServer URL
--api-keyHOSTEDAT_API_KEYAPI key for authentication

Resolution order for the server URL: --serverHOSTEDAT_SERVER → config file → compiled default.

Resolution order for the API key: HOSTEDAT_API_KEY--api-key → config file.

Config file

The CLI stores its config at ~/.hostedat/config.json:

~/.hostedat/config.json
{
  "server": "https://hostedat.ditto.moe",
  "api_key": "hd_..."
}

This file is created automatically by hostedat login.


Authentication

hostedat login

Authenticate with the server via browser-based OAuth flow.

hostedat login

Opens your browser to the server's login page. After authenticating, an API key is generated and saved to the config file.


Site management

Commands that take <site> accept a site ID, site name, or subdomain slug.

hostedat sites list

List all your sites. Alias: hostedat sites ls

hostedat sites list

# ID          NAME            SUBDOMAIN       VERSION  CREATED
# abc123      my-portfolio    my-portfolio    v3       2026-01-15
# def456      blog            blog            v1       2026-02-01

hostedat sites create

Create a new site.

hostedat sites create <name> [--subdomain <slug>]
Argument / FlagDescription
<name>Display name for the site (required)
--subdomainCustom subdomain slug. Defaults to a URL-safe version of the name.
hostedat sites create "My Blog" --subdomain blog

# Site created!
#   ID:        def456
#   Name:      My Blog
#   Subdomain: blog

hostedat sites delete

Delete a site and all its deployments. Prompts for confirmation unless --yes is passed.

hostedat sites delete <site> [--yes]
Argument / FlagDescription
<site>Site ID, name, or subdomain slug (required)
--yesSkip confirmation prompt

Deployments

hostedat deploy

Deploy a directory to a site. The directory is zipped and uploaded as a new version.

hostedat deploy <site> <directory> [--spa]
Argument / FlagDescription
<site>Site ID, name, or subdomain slug
<directory>Path to the directory to upload (e.g., ./dist)
--spaEnable SPA mode on the site after successful deploy
hostedat deploy my-portfolio ./dist

# Deploying ./dist to site my-portfolio...
# Deployed! Version: v4

Storage buckets

Storage commands manage bucket bindings used by worker env bindings (for example, env.DOWNLOADS). Buckets can be toggled between public and private directly from the CLI.

hostedat storage list

List storage buckets for a site.

hostedat storage list <site>

hostedat storage create

Create a storage bucket binding for a site.

hostedat storage create <site> --name <BINDING> --bucket <bucket-name> [--public]
FlagDescription
--nameBinding name used in workers (for example, DOWNLOADS)
--bucketS3 bucket name (must start with your site ID)
--publicEnable unauthenticated public read access at creation

hostedat storage update

Change bucket visibility to public or private.

# Make a bucket public
hostedat storage update <site> <bucket-id> --public

# Make a bucket private
hostedat storage update <site> <bucket-id> --private

Pass exactly one of --public or --private.

hostedat storage upload

Upload a file into a bucket using a presigned URL generated by the server.

hostedat storage upload <site> <bucket-id> <file> [--key <object-key>]

hostedat storage delete

Delete a storage bucket and its data. Prompts for confirmation unless --yes is passed.

hostedat storage delete <site> <bucket-id> [--yes]

Storage credentials (S3 API)

Manage S3-compatible access keys for external tools. You can use either hostedat storage-credentials or the alias hostedat storage-creds.

hostedat storage-credentials list

List your credentials. Alias: hostedat storage-credentials ls.

hostedat storage-credentials list

hostedat storage-credentials create

Create a credential. The secret access key is shown once.

hostedat storage-credentials create <name>

hostedat storage-credentials delete

Delete a credential. Prompts for confirmation unless --yes is passed.

hostedat storage-credentials delete <credential-id> [--yes]

hostedat version

Print the CLI version and default server URL.

hostedat version

# hostedat v0.1.0 (abc1234)
# server:  https://hostedat.ditto.moe

Next: Worker Runtime for binding storage buckets in env.