--json, --timeout, …) apply here too and are documented on Global flags. Error codes are a workspace-global contract, not a per-command one — the taxonomy, and how to read a code that is not in it, is on The error envelope.
octolens login
Authenticate the CLI (browser handoff or API key)
Arguments
Flags
Examples
--json, stdout carries one JSON document with these fields.
Without
--json: A terminal prints one confirmation line naming the workspace and profile.
Example output:
0 OK · 1 UNEXPECTED · 2 USAGE · 8 CANCELLED. The full map is on Exit codes.
octolens logout
Remove stored login credentials
Flags
Examples
--json, stdout carries one JSON document with these fields.
Without
--json: A terminal prints what was removed and which profiles remain.
Example output:
0 OK · 1 UNEXPECTED · 2 USAGE. The full map is on Exit codes.
octolens signup
Create an Octolens workspace from the terminal (browser handoff, or —headless email code)
Flags
Examples
--json, stdout carries one JSON document with these fields.
Two modes, one success document. Default (browser handoff): the browser runs the actual signup (Clerk sign-up, domain, workspace creation) and the document reports the credential the handoff delivered and validated.
--headless: the minted API key is saved into the profile and never printed — --json carries no secret. The company domain defaults to your email’s domain for work addresses: the finishing run completes without --domain, while a personal-provider email (gmail, outlook, yahoo, …) still requires it; an explicit --domain always wins. A wrong --code answers the server’s INVALID_CODE envelope (exit 2); the attempt cap answers SIGNUP_ATTEMPTS_EXCEEDED, after which a fresh --email run restarts the flow. An interruption at ANY later point is equally recoverable by re-running with the same --email: a signup whose workspace never became usable is re-adopted after the new code is verified, and EMAIL_ALREADY_REGISTERED (409) answers only for a fully set-up account.
Without --json: A terminal prints the browser hand-off (or the emailed-code prompt flow with —headless), then one confirmation line naming the new workspace and profile.
Example output:
--headless --email without --code) answers the pending-signup coordinates instead and exits 0 — the emailed code cannot be read by this process.
Example output:
0 OK · 1 UNEXPECTED · 2 USAGE · 8 CANCELLED. The full map is on Exit codes.
octolens switch
Switch the active workspace profile
Arguments
Examples
--json, stdout carries one JSON document with these fields.
Without
--json: A terminal prints one confirmation line (interactive runs list the profiles and prompt first).
Example output:
0 OK · 1 UNEXPECTED · 2 USAGE · 8 CANCELLED. The full map is on Exit codes.
octolens whoami
Show the active login: who you are, workspace, plan, and scope
Examples
--json, stdout carries one JSON document with these fields. Backed by the v2 API operation GET /api/v2/auth.
Without
--json: A terminal renders the identity a human cares about (OCT-1545): workspace name + company domain, the acting user’s email (omitted when unavailable), a one-line company headline, the plan label (Agents renders as Sandbox) and scope. Org id / edition / transport / auth source stay JSON-only, and the base URL prints ONLY when it is non-default.
Example output
Example output
0 OK · 1 UNEXPECTED · 2 USAGE. The full map is on Exit codes.