Skip to main content
The official Keebai CLI. The fastest way to mint your first PAT (kbai_pk_...), connect a WhatsApp Business channel, and send a test message without touching the portal or writing code.
npm install -g @keebai/cli
keebai login
keebai whatsapp connect
keebai whatsapp messages send --from <channel> --to +15551234567 --text "hello"

Why use it

Auth in one command

keebai login runs the OAuth Device Authorization flow (RFC 8628), opens your browser, and saves your PAT to ~/.keebai/credentials.json with 0600 permissions.

Connect WhatsApp without the portal

keebai whatsapp connect launches Meta Embedded Signup, or pass --qr for multi-device QR pairing. No UI needed.

Send messages from your shell

Free-form text, templates with variables, custom metadata — all from keebai whatsapp messages send.

Same token everywhere

The PAT issued by the CLI works in the SDK, in curl, and in any HTTP client against api.keebai.com/v1.

Installation

npm install -g @keebai/cli
Requires Node.js 20+. After install, the keebai binary lives in your PATH. Without a global install:
npx @keebai/cli@latest login

Authentication

keebai login runs the OAuth 2.0 Device Authorization Grant flow (RFC 8628):
  1. The CLI requests a device_code and user_code from the public API.
  2. Your browser opens at https://developers.keebai.com/cli?code=ABCD-1234.
  3. You sign in to the developer portal (if you aren’t already) and confirm the request.
  4. The CLI finishes polling and saves the PAT (kbai_pk_...) to ~/.keebai/credentials.json with mode 0600.
keebai login                            # interactive — opens the browser
keebai login --no-browser               # headless — prints the URL to open manually
keebai login --scope "messages:write webhooks:read"
For CI or non-interactive contexts, you can skip login and inject a long-lived PAT via env var. It takes precedence over credentials saved on disk:
export KEEBAI_API_TOKEN=kbai_pk_xxxxxxxxxxxx
keebai whoami

Commands

Auth

CommandDescription
keebai loginDevice flow; saves the PAT to ~/.keebai/credentials.json.
keebai whoamiShows the user, company, and scopes of the active token.
keebai logoutRevokes the PAT server-side and deletes local credentials. --local-only skips the revoke.

WhatsApp

CommandDescription
keebai whatsapp connectConnects a WhatsApp Business channel via Meta Embedded Signup (browser).
keebai whatsapp connect --qrPairs a channel via QR in the terminal (multi-device). No browser.
keebai whatsapp numbers listLists the WhatsApp numbers connected to your company.
keebai whatsapp messages sendSends free-form text or an approved template.

Connect a channel (Embedded Signup)

keebai whatsapp connect
keebai whatsapp connect --coexistence            # the number already runs the WhatsApp Business app
keebai whatsapp connect --pipeline-id <id>       # attach to an existing pipeline

Connect a channel (multi-device QR)

keebai whatsapp connect --qr
keebai whatsapp connect --qr --name "Sales line"

Send messages

--from accepts a channel_id (24-hex), a phone_number_id, or the number in E.164. Free-form text (only inside the 24h window):
keebai whatsapp messages send \
  --from +15551234567 \
  --to +15557654321 \
  --text "hi, we'll get back to you shortly"
Approved template:
keebai whatsapp messages send \
  --from <channel_id> \
  --to +15557654321 \
  --template welcome_v2 \
  --language en_US \
  --var name=Alex --var amount=1500
Free-form metadata for downstream automations:
keebai whatsapp messages send \
  --from <channel_id> --to +15557654321 --text "ping" \
  --meta '{"source":"crm","ticket":"T-123"}'

Using your token directly

After keebai login, the PAT lives in ~/.keebai/credentials.json under the access_token field. Use it as a Bearer token against https://api.keebai.com/v1/...:
TOKEN=$(jq -r .access_token ~/.keebai/credentials.json)

curl https://api.keebai.com/v1/me \
  -H "Authorization: Bearer $TOKEN"

curl https://api.keebai.com/v1/webhooks \
  -H "Authorization: Bearer $TOKEN"

curl https://api.keebai.com/v1/messages/template \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone_number_id":"...","to":"+15551234567","template_name":"welcome","language":"en_US"}'

Global flags

FlagDescription
--output <pretty|json>Output format. Default: pretty. Use json for programmatic parsing.
--no-browserDon’t open the browser automatically on login or connect.
--verboseVerbose logs to stderr for diagnostics.

Environment variables

VariableWhat it does
KEEBAI_API_TOKENInject a PAT for non-interactive use (CI). Takes precedence over ~/.keebai/credentials.json.

Endpoints the CLI hits

The CLI talks exclusively to https://api.keebai.com/v1/.... Browser flows (login approval, channel connect) happen at https://developers.keebai.com/cli and https://connect.keebai.com/connect/whatsapp respectively.

Resources

npm: @keebai/cli

Latest version, changelog, install stats.

TypeScript SDK

The same PAT works in the SDK for code integrations.

Agent Skills

The integrate-keebai-whatsapp skill for AI agents that use this SDK.

API Keys

How to create, list, and revoke tokens from the portal (alternative to keebai login).