Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Authentication

Use span login to share as your Halfspan user in a workspace. For CI, use a scoped workspace API key with traces:write. See Authentication for the dashboard, CLI, API key, and MCP credential model.
CommandDescription
loginConnect your user and workspace through the browser.
auth statusCheck your saved connection with the server.
logoutRevoke the saved session and sign out of the CLI.

Sign in through your browser

span login
  1. The CLI prints a sign-in URL and opens it in your browser. If the browser does not open, copy the printed URL into it.
  2. Sign in through WorkOS if prompted. If you are already signed in, the page shows your current account and workspace.
  3. Review the account and workspace, then choose Connect CLI. If the page asks you to choose a company, complete company setup in the dashboard and reopen the CLI sign-in link.
  4. Return to the terminal and wait for the signed-in confirmation.
The approval link expires after 10 minutes. Cancel in the browser or press Ctrl+C in the terminal to stop the attempt; run span login again to start a new one.
span auth status span share --list --json
span auth status contacts the server and displays your name, email, organization, user ID, organization ID, and dashboard origin. It checks the saved personal connection, not an environment API key. span share --list discovers local sessions without sharing them or requiring credentials.

Workspace and permissions

The connection is tied to the user and organization shown during approval. It expires after 30 days. Halfspan checks active organization membership when the session is used, so a saved session does not preserve access after membership is removed.
Sharing with this login records you as the sharer. Members can share their own traces. The sharer and workspace owners or admins can unshare a trace; traces without a recorded sharer require an owner or admin. The CLI session supports trace sharing, sharing status, and unsharing; it does not authorize dashboard management operations.
The terminal browser's sharing status and span unshare use the saved login even when an API key is configured for uploads. Run span auth status before managing traces to check the connected workspace. To change the account or workspace, sign out of the CLI, sign into the intended account and workspace in the browser, then run span login and review the approval page.

Local storage and sign-out

The CLI saves its bearer session in a JSON file under the operating system's user configuration directory:
SystemSession file
macOS~/Library/Application Support/halfspan/cli/session.json
Linux$XDG_CONFIG_HOME/halfspan/cli/session.json, or ~/.config/halfspan/cli/session.json when unset
Windows%AppData%\halfspan\cli\session.json
The CLI creates the directory with mode 0700 and writes the file with mode 0600 on systems that support Unix permissions. Treat the file as a secret.
span logout
For a valid saved session, logout asks the server to revoke it before removing the local file. An already unauthorized session is also removed locally. If the revocation request fails for another reason, logout returns an error and keeps the file so you can retry. An expired or invalid local session is removed without a revocation request.
CLI logout does not sign your browser out, revoke API keys, or delete shared traces. Use unshare to remove a shared trace; the local transcript stays on disk. See privacy and data retention for shared-data behavior.

Automation credentials and precedence

Create a scoped workspace API key with traces:write for unattended sharing. Store it as a secret and pass it explicitly:
span share --key "$HALFSPAN_API_KEY" --agent codex
span share selects credentials in this order:
  1. A nonempty --key value.
  2. A locally valid saved CLI login.
  3. HALFSPAN_API_KEY.
  4. The legacy HALFSPAN_INGEST_TOKEN.
A saved session that is rejected by the server does not trigger a retry with your environment key. Use --key to choose the automation credential explicitly. Legacy hook and import commands prefer HALFSPAN_INGEST_TOKEN when it is set and HALFSPAN_API_KEY is unset.
API-key uploads use HALFSPAN_API_URL, defaulting to https://app.halfspan.com. Saved-login uploads use the dashboard origin in the session file. See environment variables for API origins and native session directories.

Troubleshooting

What you seeWhat to do
Browser did not openOpen the URL printed by span login manually.
Approval canceled or expiredRun span login again and complete approval within 10 minutes.
Choose a company or company membership requiredComplete company setup or ask your workspace administrator for access, then reopen the sign-in link.
Not signed in, or session expired or revokedRun span login again. If membership was removed, ask your administrator to restore access.
Unexpected account or workspaceCheck span auth status, run span logout, and repeat browser approval with the intended account and workspace.
Environment key appears to be ignoredA saved login takes precedence for sharing. Pass --key "$HALFSPAN_API_KEY" explicitly.
Logout fails during a network or server errorRestore connectivity and retry span logout so the saved session can be revoked.

Development dashboards

Shared CLI downloads connect login to https://app.halfspan.com. They do not accept --url, ignore HALFSPAN_DASHBOARD_URL for login, and cannot reuse sessions from a development dashboard.
Development builds created with just cli or just go-build support a local dashboard:
just cli login --url https://app.halfspan.localhost # A development server on a plain loopback address also works: just cli login --url http://localhost:4300
Only development builds accept --url and the HALFSPAN_DASHBOARD_URL login default. The URL must be an origin without a path, query, or fragment. just cli-downloads builds production binaries for the CDN. span login --help prints help for the build you are running.