CLI Getting Started

The Temps CLI gives you full control over your Temps instance from any terminal. Install once with bun or npm, log in with a one-time browser approval, and every deploy, rollback, log stream, and project operation is one command away. No password prompts — the CLI uses the same credentials as the web UI.


Installation

You can run the CLI directly using bunx or npx without installing it globally, or install it as a global package.

Run without installing

npx @temps-sdk/cli --version

Global installation

Install globally

bun add -g @temps-sdk/cli

After global installation, the temps command is available directly. To run without installing, use bunx @temps-sdk/cli (or npx @temps-sdk/cli):

bunx @temps-sdk/cli --version

Configuration

Log in (browser device flow)

Running login with no --api-key starts the interactive, browser-based OAuth 2.0 device-authorization flow. The CLI never prompts for a password — you sign in with the same credentials, MFA, and SSO you use for the web UI.

npx @temps-sdk/cli login https://temps.example.com

What happens:

  1. The CLI requests a device_code and a short, dashed user_code (XXXX-XXXX) from the server and prints the approval URL (/cli-login/<user_code>). It makes a best-effort attempt to open your browser (open on macOS, start on Windows, xdg-open elsewhere). If no browser can open — headless, SSH, sandbox, CI, or a non-TTY shell — the printed URL is your fallback.
  2. The approval page lives inside the console. If you are not already signed in, you are bounced through the standard login screen and returned afterward. The page shows the account, device/client name, requesting IP, and expiry so you can confirm before approving.
  3. The CLI polls until you approve. On approval, the server mints a standard API key (90-day TTL, scoped to your primary role) and delivers it to the CLI exactly once.

The device session expires after 15 minutes, and the CLI polls roughly every 2 seconds. Set TEMPS_NO_BROWSER=1 to skip the auto-open attempt (the URL is still printed):

TEMPS_NO_BROWSER=1 bunx @temps-sdk/cli login https://temps.example.com

Login with an API key (headless / CI)

For headless or CI environments, pass a pre-minted API key with --api-key (or -k). The key is validated against the server before being stored. You can generate an API key from the Temps dashboard under Settings → API Keys.

npx @temps-sdk/cli login https://temps.example.com --api-key <your-api-key>

login options

bunx @temps-sdk/cli login accepts only these options. The legacy --email, --password, --magic, --mfa, and --device flags have been removed.

OptionDescription
[url]Positional Temps server URL to authenticate against.
--api-key, -kUse a pre-minted API key (Settings → API Keys) instead of opening the browser. Required for headless / CI.
--context <name>Save the credentials under this context name (defaults to the URL host).
--debugPrint every request/response to stderr (also enabled via TEMPS_DEBUG=1).

Logout

temps logout makes a best-effort, bearer-authenticated request to revoke the current context's API key on the server, then clears the local credentials. If the server-side revoke fails, it only warns and still removes the local credentials.

npx @temps-sdk/cli logout
OptionDescription
--local-onlySkip server-side revocation; only clear local credentials.
--context <name>Log out of a specific context (defaults to the active one).

Configure with wizard

For a guided setup experience:

npx @temps-sdk/cli configure

Quick start

Here's a quick workflow to deploy your first project using the CLI.

1. List your projects

npx @temps-sdk/cli projects list

2. Create a new project

npx @temps-sdk/cli projects create --name my-app --description "My awesome application" --repo https://github.com/myuser/my-app

3. Deploy your project

npx @temps-sdk/cli deploy --project my-app --environment production

4. View deployment logs

npx @temps-sdk/cli runtime-logs --project my-app --follow

For the full command reference, see CLI Reference.


Environment variables

The CLI respects the following environment variables for configuration:

VariableDescription
TEMPS_API_URLTemps API endpoint URL
TEMPS_API_TOKENAuthentication token
TEMPS_API_KEYAPI key (alternative to token)
NO_COLORDisable colored output

Example:

export TEMPS_API_URL=https://temps.example.com
export TEMPS_API_KEY=your-api-key
bunx @temps-sdk/cli projects list

Configuration files

The CLI stores configuration in:

  • Config file: ~/.temps/config.json
  • Credentials: ~/.temps/.secrets

View your current configuration:

npx @temps-sdk/cli configure show

For details on the browser device flow authentication endpoints, see CLI device-flow login.

Was this page helpful?