Authentication
How to authenticate with the CircuitHub Platform.
There are two authentication methods, depending on your use case.
Browser login (interactive)
Best for local development and one-off tasks.
circuithub auth loginThis opens your browser, where you log in through CircuitHub's standard auth flow. 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 statusLog out (removes stored credentials):
circuithub auth logoutAPI key (machine use)
API key authentication is coming soon. For now, use browser login to authenticate.
Best for CI/CD pipelines and scripts. Once available, you will be able to create a key after logging 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 |