CLI › DoubleX in the terminal
Authentication
Sign in through the browser or with an API key. The CLI stores the credential in the system keychain, never in a text file.
The CLI uses an API key to talk to the app. You have two ways to provide that key:
| Option | How | Use it when |
|---|---|---|
| Browser login (recommended) | doublex login | On your own computer. The CLI gets a key just for this terminal, which you can disconnect from your Profile at any time. |
| Personal key | doublex login --api-key - or the DOUBLEX_API_KEY variable | Servers, containers, CI and machines without a browser. |
Browser login#
doublex loginWhat happens:
- The CLI starts a local server, just for this step, at
http://127.0.0.1:8765. - The browser opens the app's Allow terminal access? page, with this computer's name and what the CLI will be able to do. If you're not signed in, the app asks you to sign in first.
- You click Allow. The browser goes back to the local server with a single-use code.
- The CLI exchanges the code for a terminal key (with PKCE verification: the code is useless to anyone else), checks the key and saves it to the keychain.
Opening the browser so you can allow access…
Waiting for confirmation in the browser (up to 5 minutes)…
Signed in as Ana Souza ([email protected]) · Empresa SA.The terminal key shows up in Settings › Profile › Terminal (CLI) › Connected terminals, with the computer name and when it was last used.
| Option | Default | What it's for |
|---|---|---|
--no-browser | off | Shows the authorization URL instead of opening the browser. |
--callback-port <port> | 8765 | Changes the local server's port, if 8765 is in use. |
--base-url <url> | from the installer | Signs in to a different app address. |
On a remote computer (SSH)#
The browser needs to reach the local port on the machine where the CLI is running. Forward the port over SSH and use --no-browser:
ssh -L 8765:127.0.0.1:8765 you@server
doublex login --no-browserOpen the URL the CLI shows in your computer's browser and click Allow.
Sign in with a key#
Generate your personal key in Settings › Profile › API access and pass it through stdin, so it doesn't end up in your shell history or in the process list:
echo "$DOUBLEX_API_KEY" | doublex login --api-key -The CLI checks the key with the server before saving it. If it's invalid, nothing is saved.
Check#
doublex whoamiAna Souza <[email protected]>
id: usr_1a2b3c4d5e6f
org: Empresa SA (admin)
teams: Sales, Operations
url: https://doublex.aiWith --json, whoami returns the same object as GET /api/me.
Sign out#
doublex logoutlogout revokes the terminal key on the server and deletes it from the keychain. If you signed in with your personal key, it's only removed from the keychain and stays valid: revoke it in your Profile if you need to. You can also disconnect any terminal from the Profile page, without access to the computer.
Environment variables#
Variables apply only to the command they're set for and take priority over what's saved. They're the way to go for CI, containers and servers without a keychain.
| Variable | What it's for |
|---|---|
DOUBLEX_API_KEY | API key. When it's set, the CLI doesn't check the keychain. |
DOUBLEX_BASE_URL | The app's address. |
DOUBLEX_LANG | CLI language: pt, en or es. |
XDG_CONFIG_HOME | Changes the folder of the config file (default ~/.config). |
- name: Update the Brain with the product docs
env:
DOUBLEX_API_KEY: ${{ secrets.DOUBLEX_API_KEY }}
DOUBLEX_BASE_URL: https://doublex.ai
run: |
curl -fsSL https://doublex.ai/cli/install.sh | sh
~/.local/bin/doublex brain upload docs/*.md --scope organizationWhere the CLI stores the credential#
| System | Where |
|---|---|
| macOS | Keychain, item doublex-cli, one entry per app address |
| Linux | Secret Service (GNOME Keyring or KWallet), through secret-tool, service doublex-cli |
The ~/.config/doublex/config.json file stores only the app's address, never the key. Because the key lives in the keychain, you can be signed in to more than one address (for example, production and a test environment) and choose with --base-url.