Skip to content
CLI

Documentation

CLI

Manage keys, tokens, channels, users, and webhooks from your terminal with the emb command.

The emb CLI wraps the Server SDK for everything you’d otherwise script by hand — generating keypairs, minting dev tokens, and administering channels, users, and webhooks. Every command supports --json for piping into other tools.

npm install -g @emb-chat/cli
# or run it from the workspace: pnpm exec emb <command>

Configure once

Settings resolve in the order flag → environment variable → config file, so you can set defaults once and override per command.

emb config set url     https://chat.acme.com
emb config set app     app_demo
emb config set api-key "$EMB_CHAT_API_KEY"
emb config path        # where the config file lives

Equivalent environment variables:

export EMB_CHAT_URL=https://chat.acme.com
export EMB_CHAT_APP_ID=app_demo
export EMB_CHAT_API_KEY=# never echoed or logged

Keys

emb keys generate                                   # -> emb-private.pem / emb-public.pem
emb keys register --key ./emb-public.pem --kid key_01
emb keys list
emb keys delete key_01

Tokens

Mint a token locally with your private key — handy for development and testing.

emb tokens mint \
  --user alice \
  --app app_demo \
  --kid key_01 \
  --private-key ./emb-private.pem \
  --expires-in 1h

Apps & group mode

emb apps get
emb apps update --group-mode internal   # external | internal | hybrid

Channels

emb channels create --type group --name Engineering --members alice,bob
emb channels list
emb channels send <id> --body "Welcome!"
emb channels history <id> --limit 20
emb channels members <id>
emb channels add-members <id> carol,dave --role member
emb channels remove-member <id> carol
emb channels set-role <id> bob admin
emb channels delete <id>

Users

emb users upsert --id alice --name "Alice" --avatar https://…/a.png

Webhooks

emb webhooks create --target https://acme.com/hooks/chat --events "message.*,member.*"
emb webhooks list
emb webhooks deliveries <id> --status failed
emb webhooks test <id>
emb webhooks delete <id>

JSON output

Append --json to any read command to get machine-readable output:

emb channels list --json | jq '.[].name'