Public packages

@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 login

Requires 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
FlagDescription
--url <origin>Onyx server origin. Defaults to $ONYX_API_URL, then the hosted app.
--no-openPrint 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
FlagDescription
--api-key <key>Organization API key. Defaults to $ONYX_API_KEY.
--url <url>Origin of the Onyx deployment.
--jsonPrint the organization as JSON.

Configuration

  • ONYX_API_URL: default server origin. Origin precedence is the --url flag, then ONYX_API_URL, then the hosted app.
  • ONYX_API_KEY: default organization API key for onyx org.
  • The session token is stored at ~/.config/onyx/auth.json ($XDG_CONFIG_HOME/onyx/auth.json when set) with 0600 permissions. Delete the file to log out.

On this page