@jxdltd/onyx-cli
The onyx command line interface, with browser-based device-flow login.
@jxdltd/onyx-cli publishes the onyx binary, a command line interface for an Onyx deployment. It logs in through the browser using the OAuth device flow, so no password ever touches the terminal, and it can inspect the account and organization behind a session or an API key.
Installation
npm install -g @jxdltd/onyx-cli
# or run without installing
npx @jxdltd/onyx-cli loginRequires Node.js 20 or later.
Commands
onyx login
Log in through your browser using the OAuth device flow. The CLI shows a short code, opens the verification page, and waits for you to approve the request.
onyx login| Flag | Description |
|---|---|
--url <origin> | Onyx server origin. Defaults to $ONYX_API_URL, then the hosted app. |
--no-open | Print the verification link instead of opening a browser. Useful over SSH. |
onyx whoami
Show the account you are logged in as, including the active organization and the server.
onyx whoami
onyx whoami --json--json prints the user, session, and active organization as JSON for scripting. The session token is never included in the output.
onyx org
Show the organization an API key is scoped to. This uses @jxdltd/onyx-client against the public API rather than the stored login session.
onyx org --api-key onyx_...
ONYX_API_KEY=onyx_... onyx org --json| Flag | Description |
|---|---|
--api-key <key> | Organization API key. Defaults to $ONYX_API_KEY. |
--url <url> | Origin of the Onyx deployment. |
--json | Print the organization as JSON. |
Configuration
ONYX_API_URL: default server origin. Origin precedence is the--urlflag, thenONYX_API_URL, then the hosted app.ONYX_API_KEY: default organization API key foronyx org.- The session token is stored at
~/.config/onyx/auth.json($XDG_CONFIG_HOME/onyx/auth.jsonwhen set) with0600permissions. Delete the file to log out.