CLI Reference

contxt auth

Authenticate the CLI with your Contxt account. Required for cloud sync and semantic search. Local-only usage works without authentication.

Commands

contxt auth login

Opens a browser window for GitHub OAuth. On success, writes credentials to ~/.contxt/auth.json.

contxt auth logout

Removes ~/.contxt/auth.json. Your local database and project registrations are preserved.

contxt auth status

Shows the currently authenticated user and whether the token is valid.

What authentication enables

  • Cloud sync — push and pull entries across machines with contxt sync
  • Web dashboard — view, search, and manage entries at contxt.dev
  • Semantic search — vector-powered search across all projects (Pro)
  • Team sharing — share context with teammates on the same project

All CLI commands — contxt decision add, contxt pattern add, MCP tools — work fully offline without authentication.

Credentials file

After login, credentials are stored at ~/.contxt/auth.json:

{
  "accessToken": "sbp_...",
  "userId": "usr_abc123",
  "email": "you@example.com"
}

Do not commit this file. It is automatically added to ~/.gitignore_global during login.