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/clibrew install custom-domain-app/tap/customdomainOr 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 initIt 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_123picks the application when your workspace has more than one. In a terminal,initlists them and asks you to pick one by number.--env-file .envwrites to another file.
Then follow the widget guide to add the connect flow to your product.
Other commands
| Command | What it does |
|---|---|
customdomain login | Sign in from this terminal |
customdomain logout | End this terminal's access |
customdomain whoami | Show who this terminal acts as |
customdomain domains | List your connected domains |
customdomain doctor <domain> | Show where a domain's DNS is hosted and what is in the way |
customdomain version | Print the version |
A terminal you sign in appears on the console's Agents page (under More), where you can revoke it at any time.