@custral/cli
v1.0.3
Published
The Custral command-line interface — sign in and work with your workspace from the terminal.
Downloads
304
Maintainers
Readme
@custral/cli
The Custral command-line interface. Sign in from your terminal and work with your workspace as yourself — the CLI holds a real Custral session (not an API key), so it can act across every organization you belong to.
Install
npm install -g @custral/cliSign in
custral loginThis opens the RFC 8628 device flow: the CLI prints a short code and a URL,
you approve it in your browser (where you're already signed in), and the session
is saved to ~/.custral/config.json (0600). No password is ever typed into the
terminal, and you can revoke the session any time in Settings → Sessions.
Commands
custral login Sign in via your browser
custral logout Sign out (clears the stored session)
custral whoami Show the signed-in account + current org
custral org list List your organizations
custral org switch <slug> Switch the current organization
custral api <method> <path> [json] Make a raw authenticated requestSwitching orgs is instant and local — the session works for every org you belong
to, so org switch just changes which one subsequent commands target.
custral org switch pied
custral api GET organizations
custral api POST records/paginate '{"objectId":"obj_123","limit":10}'Configuration
| | |
|---|---|
| Config file | ~/.custral/config.json |
| CUSTRAL_API_URL | Override the API base (default https://api.custral.com) |
Auth model
The CLI authenticates like the web app: it sends the session id as the
Authorization header verbatim (no Bearer prefix) and the current org as
the Organization header. It is deliberately not an API-key client — API keys
(sk_…) are org-scoped credentials for server-to-server integrations; the CLI is
you, across all your orgs. For unattended/CI use, prefer an API key + the REST
API or @custral/sdk.
