Prerequisites
- The CLI is installed. See CLI overview.
- A CloudThinker account with access to at least one workspace. A workspace is the project that holds your connections and conversations.
Log in
1
Start the login
Use the arrow keys or press
1 or 2, then Enter.2
Approve in the browser
The CLI prints 
Success state: the terminal prints
Open this URL to authorize CloudThinker: with the link and opens it. Press c to copy the link if the browser didn’t open. Sign in, choose the workspace, and approve the request within five minutes.
Logged in to <workspace>.Picked Log in with a code? Follow Log in on a remote machine instead.3
Verify the credential
whoami asks the API, not the local file, so it proves the credential works.Success state: one line with host=, email=, and workspace= values. Add --json for machine-readable output.Log in on a remote machine
Over SSH, or on Linux with no display, the CLI picks the code flow on its own and says so:No local browser detected (SSH session). Using device-code login. It prints a URL and a short code. Open the URL in any browser, on any device, and enter the code within 10 minutes.
Work with several workspaces
Log in once per workspace. Each login is stored by host and workspace, so logging in to a second workspace keeps the first.--workspace, auth switch, and CLOUDTHINKER_WORKSPACE take a workspace ID or the exact workspace name. Quote names that contain spaces. --workspace goes before the command name:
Use a custom host
To use a host other thanhttps://app.cloudthinker.io, run cloudthinker login --url <origin> once. Later commands remember it. You can also set CLOUDTHINKER_URL. See the CLI reference.
Authenticate a script or CI job
A pipeline has no browser, so it can’t approve a login. CloudThinker has no service account or long-lived API key for the CLI yet. Access tokens last 30 minutes by default.cloudthinker auth token authenticates as you until it expires. Treat it like a password: never log it, commit it, or paste it into a chat.
You can’t combine CLOUDTHINKER_TOKEN with --workspace. The token already names its workspace, so the CLI rejects both together with exit code 2.
Where credentials live
The CLI writes credentials as plain JSON to one file, readable only by your user (mode 0600). It doesn’t use the OS keychain; releases before 0.5.3 did, and upgrading moves those logins into the file.
The file holds every workspace login, keyed by host and workspace.
Log out
Logged out., or Logged out of all workspaces for this host.
Troubleshooting
A command says you are not logged in (exit code 3)
A command says you are not logged in (exit code 3)
The credential is missing or expired, or the server refused access. Run
cloudthinker login again. In a non-interactive shell, the CLI never opens a browser: it prints the login command to run and stops.CLOUDTHINKER_TOKEN is rejected, or auth switch has no effect
CLOUDTHINKER_TOKEN is rejected, or auth switch has no effect
The environment token outranks stored credentials, so logging in again or running
auth switch changes nothing. Replace the token, or run unset CLOUDTHINKER_TOKEN and use your saved logins.Browser consent timed out
Browser consent timed out
The consent link is valid for five minutes. Run
cloudthinker login again, or use cloudthinker login --device-auth to approve from another device.A workspace name is not accepted
A workspace name is not accepted
--workspace matches an exact name or a workspace ID. Run cloudthinker auth status to see your saved workspaces, and quote a name that contains spaces.Next steps
Headless chat
Send prompts from scripts and CI with the credential you just set up
CLI reference
Every flag, environment variable, and exit code