Skip to content
Dashboard
Theme
Theme

Install the CLI and sign in

Install the CLI, sign in, select profiles and revoke credentials.

View Markdown

The ohauthcat CLI supports browser and device sign-in, named profiles and logout. Install it with one command, then sign in.

curl -fsSL https://ohauthcat.com/install.sh | sh

The script picks the build for your OS and CPU (amd64 or arm64), checks it against the release’s SHA-256 checksums and stops on any mismatch. When cosign is installed it also verifies the signature of the checksum file with the OhAuthCat public key, and stops if that fails. It installs to /usr/local/bin when that is writable, otherwise to ~/.local/bin, and never runs sudo. Set OHAUTHCAT_INSTALL_DIR to choose the folder and OHAUTHCAT_VERSION (for example 1.2.3) to pin a version.

Check the install with ohauthcat --version.

Every release on GitHub ships checksums.txt with a SHA-256 line per file, and the installers refuse a file whose checksum does not match. To check a download yourself, compare shasum -a 256 <file> (or Get-FileHash <file> in PowerShell) with its line in checksums.txt. The checksum file is signed with cosign using a key pair, without the public transparency log (hence --insecure-ignore-tlog=true; the key is what you trust). Download the OhAuthCat public key from ohauthcat.com/cli/cosign.pub, save it as cosign.pub, and run:

cosign verify-blob --key cosign.pub --signature checksums.txt.sig --insecure-ignore-tlog=true checksums.txt
  • Install script: delete the binary, rm "$(command -v ohauthcat)" (usually /usr/local/bin/ohauthcat or ~/.local/bin/ohauthcat).
  • Homebrew: brew uninstall ohauthcat.
  • Windows: delete %LOCALAPPDATA%\Programs\ohauthcat and remove that folder from your user Path (Settings, then Edit environment variables for your account).
  • npm: npm uninstall -g @ohauthcat/cli; npx keeps nothing to remove beyond its cache.

Run ohauthcat logout first if you want the saved credential revoked; uninstalling leaves keychain entries in place.

With authorized access to the ohauthcat-cli source and Go 1.26 (its go.mod pins the toolchain to go1.26.11), run make build in the checkout, which creates bin/ohauthcat.

ohauthcat init adds reviewed framework routes and registers your sandbox callback; see the init quickstart. The dev, events, trigger, listen, migrate, import, export and scim test commands are described in CLI development and migration commands.

The sandbox event relay API is available independently of those CLI commands. Its HTTP and WebSocket contract supports live events, samples and optional redirect registration.

Run ohauthcat login --profile work-sandbox. The CLI opens the dashboard and receives a PKCE-protected callback on 127.0.0.1. Approve only a request you initiated, check its client details, choose the intended environment and complete the dashboard’s required recent second factor.

For a machine without a browser, run ohauthcat login --device --profile work-sandbox. Open the displayed verification URI on another device and enter the code. An unavailable browser also falls back to device authorization. Never send your device code to another person or approve an unexpected request. Requests expire; an old approval request returns cli_request_stale. Restart login rather than reusing it.

Run ohauthcat whoami to verify the environment ID and type. It reports credential source and an optional profile label; it does not verify your account, project or member identity. Run ohauthcat env use work-sandbox to select a saved profile. This selects local account/environment context, not a different backend environment on an existing credential.

Configuration Behavior
OHAUTHCAT_API_KEY Takes precedence over saved credentials; never persisted or removed by commands. Suitable for your own CI secret injection.
OHAUTHCAT_PROFILE Overrides the selected saved profile.
OHAUTHCAT_API_BASE Management API origin; defaults to https://api.ohauthcat.com. Must be an HTTPS origin without user information, path, query or fragment. Interactive login requires an api.<domain>, dev-int-api.<domain> or stg-int-api.<domain> origin; it opens the matching dashboard (console.<domain>, or <env>-int-console.<domain>).

Credentials, profile metadata and the selected profile live in the OS keychain. Keychain failure stops the command; there is no plain-file fallback. --json emits device prompts and results without printing access or refresh tokens.

Access and refresh tokens are saved as one keychain secret. Expiry or the specific invalid-access-token response triggers one serialized refresh. Refresh tokens are single use: core rotates both tokens, and replay of a spent refresh token revokes the credential family. There is no separate CLI rotate command.

The CLI retires the old token pair before sending a refresh request. A crash or ambiguous response requires a new login instead of retrying the spent token. Concurrent CLI processes serialize credential changes per profile.

Run ohauthcat logout to revoke the selected CLI credential remotely before removing its saved profile. A remote failure leaves the profile available for a retry. Saved API-key profiles are removed locally; OHAUTHCAT_API_KEY remains unchanged. Environment API keys are revoked in the dashboard (ohauthcat keys revoke prints the link); organization-scoped keys are revoked with ohauthcat api-keys revoke <org> <key>.

CLI credentials appear among your dashboard sessions with method cli. Revoking one from the dashboard’s sessions list invalidates its entire token family. A CLI token cannot be used as a dashboard cookie. See dashboard security.