Skip to content
dhanu docs
Browse pages

SDKs

The dhanu CLI

Manage keys, tail request logs, forward webhook deliveries to localhost and fire test events from your terminal.

The dhanu npm package ships a command-line tool for the management side of the developer console, keys, logs and webhooks, so the things you do while wiring up an integration never need the browser. It is not a coding agent and it does not call the public API on your behalf; for that, use the SDK.

Install and sign in

npm i -g dhanu        # or: npx dhanu <command>
dhanu login

login opens the browser on the same sign-in the app uses (social sign-in, passkeys, MFA all work), then picks the session up in the terminal and stores it in ~/.config/dhanu/credentials.json (mode 600). With one workspace it is selected for you; with several, dhanu use <workspaceId> picks one, and every command also takes --workspace <id>. dhanu whoami shows who is signed in; dhanu logout forgets it.

Keys

dhanu keys list
dhanu keys create --project <projectId> --name ci --mode test
dhanu keys create --project <projectId> --scope-level api --capabilities tasks.create,tasks.read --expires-at 2026-12-31T00:00:00Z
dhanu keys revoke <keyId>

create prints the secret once; it is never shown again.

Request logs

dhanu logs tail                      # new requests as they arrive
dhanu logs tail --history --once     # the last 50, then exit
dhanu logs tail --key <keyId> --route /text

Each line is the time, status, method, route, latency and request id, the id you quote in a support report.

Webhooks

dhanu webhooks listen --endpoint <endpointId> --forward-to localhost:3000/hooks --secret whsec_…
dhanu trigger task.completed --endpoint <endpointId>

listen watches an endpoint’s deliveries and re-posts each new one to your local server with the same Dhanu-Event and Dhanu-Delivery headers and, when you pass --secret, a Dhanu-Signature computed with it, so the handler you are writing can run its real verification against events the platform actually sent. Dhanu itself only delivers to public https URLs, which is why the CLI forwards rather than tunnels: point the endpoint at your staging server or a tunnel URL and forward from there. trigger sends a test event of the given type to an endpoint, as the console’s test button does.

Pointing it elsewhere

DHANU_BASE_URL (default https://api.dhanu.ai) and DHANU_APP_URL (default https://app.dhanu.ai) point the CLI at a local or staging deployment; DHANU_CONFIG_DIR moves the credentials file.