CustomDomain Docs
Get started

CLI: set up from the terminal

Set up and check domains from your terminal.

Set up a project from your terminal. The customdomain command signs you in and gives the project its API key, so you never copy or paste the key. A coding agent can run it for you. You only approve the sign-in in your browser.

Install

npm install -g @customdomain/cli
brew install custom-domain-app/tap/customdomain

Or run it once without installing, with npx @customdomain/cli <command>. Binaries for macOS, Linux and Windows are on the releases page.

Give a project its API key

Run this in your project:

npx @customdomain/cli init

It opens a page where you approve the sign-in, then creates an API key for your application and writes CUSTOMDOMAIN_API_KEY and CUSTOMDOMAIN_APPLICATION_ID to .env.local. It prints only the key's id, never the secret, and adds the file to .gitignore. If the key is already set, it changes nothing.

  • --app app_123 picks the application when your workspace has more than one. In a terminal, init lists them and asks you to pick one by number.
  • --env-file .env writes to another file.

Then follow the widget guide to add the connect flow to your product.

Other commands

CommandWhat it does
customdomain loginSign in from this terminal
customdomain logoutEnd this terminal's access
customdomain whoamiShow who this terminal acts as
customdomain domainsList your connected domains
customdomain doctor <domain>Show where a domain's DNS is hosted and what is in the way
customdomain versionPrint the version

A terminal you sign in appears on the console's Agents page (under More), where you can revoke it at any time.

On this page