CLI
CLI login and permanent deployments
Sign in from the CLI to publish permanent sites, claim temporary anonymous deployments, and authenticate CI with an agent API key.
- Released
- Area
- CLI
Run flat login EMAIL to sign in through WorkOS. The CLI opens the authentication page, prompts for the code shown in your browser, and stores an agent API key for future deployments. Pass --no-open if you want to open the URL yourself.
Authenticated deployments are permanent and can use named or custom hostnames. Deployments without credentials remain available at a random onflat.page URL for one hour. After publishing anonymously, the CLI prints a flat claim command that lets you keep the same deployment and URL permanently.
For CI, set FLAT_API_KEY instead of storing credentials. The environment variable takes precedence over the stored key, and invalid credentials stop the deployment rather than falling back to anonymous access. Run flat logout to remove the locally stored key.
The CLI also adds generated shell completion for Bash, Zsh, Fish, and PowerShell. Command options can appear before or after operands, and flat deploy now requires exactly one file or directory path.