Skip to main content
The CLI authenticates with the same workspace API keys as the /v1 REST API. The fastest way to get set up is the browser-based login flow. No copy-pasting keys.
Here’s what happens:
1

The CLI opens your browser

A page on the GeoGen dashboard asks you to authorize the CLI. If you’re not signed in, you’ll be prompted to sign in first.
2

Pick a workspace

The dashboard shows a workspace picker. The CLI will only get access to the workspace you select.
3

Click Authorize

A new API key is minted with a label like CLI: <your-device> (2026-05-22) so you can identify and revoke it from Settings → API Keys later.
4

Done

The dashboard hands the key back to the CLI through a temporary local listener (bound to 127.0.0.1 only). The CLI writes it to ~/.geogen/config.json and the browser shows ”✓ GeoGen CLI authorized”.
The flow times out after 5 minutes if you don’t complete it.

Login flags

Examples

Credential resolution order

For any command (other than login), the CLI resolves credentials in this order. The first match wins:
1

CLI flag

Per-command override. Use it to run against a different workspace without changing anything else.
2

Environment variable

Best for CI/CD secrets.
3

Config file

The key written by geogen login, stored at ~/.geogen/config.json (chmod 600 on POSIX).

Logout

Clears the stored credentials:
This only removes the local copy. To fully revoke access, also delete the key from Settings → API Keys in the dashboard.

Inspect resolved config

geogen config prints the effective configuration and where each value came from:
The API key is masked. Only the first and last four characters are shown.

Config file format

~/.geogen/config.json is plain JSON:
You can edit it manually if you prefer. Missing fields fall through to env vars, then defaults.
Never commit ~/.geogen/config.json or your API key to source control. For CI pipelines, use GEOGEN_API_KEY as a secret instead.

Multiple workspaces

Each geogen login mints a new API key bound to whichever workspace you pick on the consent screen. To switch which workspace the CLI talks to, you have two options:

Security notes

The browser-based flow is designed so your API key never leaves your machine in plain text any longer than necessary:
  • The local HTTP listener binds to 127.0.0.1 only (not exposed on your network).
  • The listener accepts callbacks from only the configured dashboard origin (CORS-locked).
  • A cryptographically random state token is exchanged through the URL. Any callback with the wrong state is rejected, defeating local-process impersonation.
  • The listener shuts down immediately after receiving the key, or after a 5-minute timeout.
The API key itself is stored unencrypted in ~/.geogen/config.json (chmod 600). If that’s not acceptable for your environment, use GEOGEN_API_KEY env var injection from a secrets manager instead.

Errors