Authentication
How to authenticate with the CircuitHub Platform.
There are two authentication methods, depending on your use case.
Browser sign-in (interactive)
Best for local development and one-off tasks.
circuithub auth loginThis opens your browser, where you sign in through CircuitHub's standard sign-in. The CLI captures a JWT via a localhost callback and stores it in ~/.config/circuithub/credentials.json. The token is valid for 24 hours.
Check your current status:
circuithub auth statusSign out (removes stored credentials):
circuithub auth logoutAPI key (machine use)
API key authentication is coming soon. For now, sign in through the browser.
Best for CI/CD pipelines and scripts. Once available, you will be able to create a key after signing in:
circuithub auth keys create --name "ci-deploy"The key will be shown once at creation — save it somewhere secure. Then set it as an environment variable:
export CIRCUITHUB_API_KEY=ch_live_...When set, CIRCUITHUB_API_KEY will take priority over the stored JWT.
Using tokens with the API directly
All API requests require a Bearer token in the Authorization header:
curl -H "Authorization: Bearer $CIRCUITHUB_API_KEY" \
https://api.circuithub.com/v1/workspacesCredential storage
| Item | Location |
|---|---|
| JWT token | ~/.config/circuithub/credentials.json |
| File permissions | 0600 (user-only) |
| Config directory | Respects $XDG_CONFIG_HOME |