Ably CLI for Pub/Sub, Chat and Spaces
npm install @ably/cli
Ably CLI and MCP server for Ably Pub/Sub, Ably Spaces, Ably Chat and the Ably Control API.
> [!NOTE]
> This project is in beta and this CLI and MCP server project is being actively developed.
> Please raise an issue if you have feedback, feature requests or want to report a bug. We welcome pull requests too.
* Ably CLI and MCP server
* CLI Usage
* MCP Usage
* Commands
* MCP Server
* Contributing
* or
``sh-session`
$ npm install -g @ably/cli
$ ably COMMAND
running command...
$ ably (--version)
@ably/cli/0.16.0 darwin-arm64 node-v22.14.0
$ ably --help [COMMAND]
USAGE
$ ably COMMAND
...
`sh-session`
LOGIN (recommended first step)
$ ably login
The Ably CLI supports shell auto-completion for bash, zsh, and PowerShell. This helps you discover and use commands more efficiently.
To set up auto-completion:
`sh-session`
$ ably autocomplete
This will display installation instructions specific to your shell. Follow them to enable tab completion for commands, subcommands, and flags.
For more details, see the Auto-completion documentation.
The Ably CLI includes an interactive shell mode that provides a more convenient way to work with multiple commands:
`sh-session`
$ ably-interactive
- Command history: Previous commands are saved and can be accessed with up/down arrows
- Tab completion: Full support for command and flag completion
- Ctrl+C handling:
- Single Ctrl+C interrupts the current command and returns to prompt
- Double Ctrl+C (within 500ms) force quits the shell
- No "ably" prefix needed: Commands can be typed directly (e.g., just channels list instead of ably channels list)
> [!WARNING]
> The MCP server is currently experimental. Please raise an issue if you have feedback or suggestions for features.
1. Install the CLI following the CLI usage steps.
2. Follow the instructions for your tool to set up an MCP server, such as Claude desktop, and configure:
1. command as ably mcp start-server
See MCP Server section for more details on how to use the MCP Server.
> [!NOTE]
> If you are having trouble getting the MCP server running, use MCP inspector
* ably accounts
* ably accounts current
* ably accounts list
* [ably accounts login [TOKEN]](#ably-accounts-login-token)ably accounts logout [ALIAS]
* [](#ably-accounts-logout-alias)ably accounts stats
* ably accounts switch [ALIAS]
* [](#ably-accounts-switch-alias)ably apps
* ably apps channel-rules
* ably apps channel-rules create
* ably apps channel-rules delete NAMEORID
* ably apps channel-rules list
* ably apps channel-rules update NAMEORID
* ably apps create
* ably apps current
* ably apps delete [APPID]
* [](#ably-apps-delete-appid)ably apps list
* ably apps set-apns-p12 ID
* ably apps stats [ID]
* [](#ably-apps-stats-id)ably apps switch [APPID]
* [](#ably-apps-switch-appid)ably apps update ID
* ably auth
* ably auth issue-ably-token
* ably auth issue-jwt-token
* ably auth keys
* ably auth keys create
* ably auth keys current
* ably auth keys get KEYNAMEORVALUE
* ably auth keys list
* ably auth keys revoke KEYNAME
* ably auth keys switch [KEYNAMEORVALUE]
* [](#ably-auth-keys-switch-keynameorvalue)ably auth keys update KEYNAME
* ably auth revoke-token TOKEN
* ably autocomplete [SHELL]
* [](#ably-autocomplete-shell)ably bench
* ably bench publisher CHANNEL
* ably bench subscriber CHANNEL
* ably channels
* ably channels batch-publish [MESSAGE]
* [](#ably-channels-batch-publish-message)ably channels history CHANNEL
* ably channels list
* ably channels occupancy
* ably channels occupancy get CHANNEL
* ably channels occupancy subscribe CHANNEL
* ably channels presence
* ably channels presence enter CHANNEL
* ably channels presence subscribe CHANNEL
* ably channels publish CHANNEL MESSAGE
* ably channels subscribe CHANNELS
* ably config
* ably config path
* ably config show
* ably connections
* ably connections stats
* ably connections test
* ably help [COMMANDS]
* [](#ably-help-commands)ably integrations
* ably integrations create
* ably integrations delete INTEGRATIONID
* ably integrations get RULEID
* ably integrations list
* ably integrations update RULEID
* ably login [TOKEN]
* [](#ably-login-token)ably logs
* ably logs channel-lifecycle
* ably logs channel-lifecycle subscribe
* ably logs connection-lifecycle
* ably logs connection-lifecycle history
* ably logs connection-lifecycle subscribe
* ably logs history
* ably logs push
* ably logs push history
* ably logs push subscribe
* ably logs subscribe
* ably mcp
* ably mcp start-server
* ably queues
* ably queues create
* ably queues delete QUEUEID
* ably queues list
* ably rooms
* ably rooms list
* ably rooms messages
* ably rooms messages history ROOM
* ably rooms messages reactions
* ably rooms messages reactions remove ROOM MESSAGESERIAL REACTION
* ably rooms messages reactions send ROOM MESSAGESERIAL REACTION
* ably rooms messages reactions subscribe ROOM
* ably rooms messages send ROOM TEXT
* ably rooms messages subscribe ROOMS
* ably rooms occupancy
* ably rooms occupancy get ROOM
* ably rooms occupancy subscribe ROOM
* ably rooms presence
* ably rooms presence enter ROOM
* ably rooms presence subscribe ROOM
* ably rooms reactions
* ably rooms reactions send ROOM EMOJI
* ably rooms reactions subscribe ROOM
* ably rooms typing
* ably rooms typing keystroke ROOM
* ably rooms typing subscribe ROOM
* ably spaces
* ably spaces cursors
* ably spaces cursors get-all SPACE
* ably spaces cursors set SPACE
* ably spaces cursors subscribe SPACE
* ably spaces list
* ably spaces locations
* ably spaces locations get-all SPACE
* ably spaces locations set SPACE
* ably spaces locations subscribe SPACE
* ably spaces locks
* ably spaces locks acquire SPACE LOCKID
* ably spaces locks get SPACE LOCKID
* ably spaces locks get-all SPACE
* ably spaces locks subscribe SPACE
* ably spaces members
* ably spaces members enter SPACE
* ably spaces members subscribe SPACE
* ably status
* ably support
* ably support ask QUESTION
* ably support contact
*
Manage Ably accounts and your configured access tokens
`
USAGE
$ ably accounts
DESCRIPTION
Manage Ably accounts and your configured access tokens
EXAMPLES
$ ably accounts login
$ ably accounts list
$ ably accounts current
$ ably accounts logout
$ ably accounts switch my-account
$ ably accounts stats
COMMANDS
ably accounts current Show the current Ably account
ably accounts list List locally configured Ably accounts
ably accounts login Log in to your Ably account
ably accounts logout Log out from an Ably account
ably accounts stats Get account stats with optional live updates
ably accounts switch Switch to a different Ably account
`
_See code: src/commands/accounts/index.ts_
Show the current Ably account
`
USAGE
$ ably accounts current [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Show the current Ably account
EXAMPLES
$ ably accounts current
$ ably accounts current --json
$ ably accounts current --pretty-json
`
_See code: src/commands/accounts/current.ts_
List locally configured Ably accounts
`
USAGE
$ ably accounts list [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
List locally configured Ably accounts
EXAMPLES
$ ably accounts list
$ ably accounts list --json
$ ably accounts list --pretty-json
`
_See code: src/commands/accounts/list.ts_
Log in to your Ably account
`
USAGE
$ ably accounts login [TOKEN] [--access-token
[--endpoint
ARGUMENTS
TOKEN Access token (if not provided, will prompt for it)
FLAGS
-a, --alias=
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--no-browser Do not open a browser
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Log in to your Ably account
EXAMPLES
$ ably accounts login
$ ably accounts login --alias mycompany
$ ably accounts login --json
$ ably accounts login --pretty-json
`
_See code: src/commands/accounts/login.ts_
Log out from an Ably account
`
USAGE
$ ably accounts logout [ALIAS] [--access-token
[--endpoint
ARGUMENTS
ALIAS Alias of the account to log out from (defaults to current account)
FLAGS
-f, --force Force logout without confirmation
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Log out from an Ably account
EXAMPLES
$ ably accounts logout
$ ably accounts logout mycompany
$ ably accounts logout --json
$ ably accounts logout --pretty-json
`
_See code: src/commands/accounts/logout.ts_
Get account stats with optional live updates
`
USAGE
$ ably accounts stats [--access-token
[--endpoint
[--interval
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--debug Show debug information for live stats polling
--end=
--endpoint=
--env=
--host=
--interval=
--json Output in JSON format
--limit=
--live Subscribe to live stats updates (uses minute interval)
--pretty-json Output in colorized JSON format
--start=
--token=
--unit=
DESCRIPTION
Get account stats with optional live updates
EXAMPLES
$ ably accounts stats
$ ably accounts stats --unit hour
$ ably accounts stats --start 1618005600000 --end 1618091999999
$ ably accounts stats --limit 10
$ ably accounts stats --json
$ ably accounts stats --pretty-json
$ ably accounts stats --live
$ ably accounts stats --live --interval 15
`
_See code: src/commands/accounts/stats/index.ts_
Switch to a different Ably account
`
USAGE
$ ably accounts switch [ALIAS] [--access-token
[--endpoint
ARGUMENTS
ALIAS Alias of the account to switch to
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Switch to a different Ably account
EXAMPLES
$ ably accounts switch
$ ably accounts switch mycompany
$ ably accounts switch --json
$ ably accounts switch --pretty-json
`
_See code: src/commands/accounts/switch.ts_
Manage Ably apps
`
USAGE
$ ably apps
DESCRIPTION
Manage Ably apps
EXAMPLES
$ ably apps list
$ ably apps create
$ ably apps update
$ ably apps delete
$ ably apps set-apns-p12
$ ably apps stats
$ ably apps channel-rules list
$ ably apps switch my-app
COMMANDS
ably apps channel-rules Manage Ably channel rules (namespaces)
ably apps create Create a new app
ably apps current Show the currently selected app
ably apps delete Delete an app
ably apps list List all apps in the current account
ably apps set-apns-p12 Upload Apple Push Notification Service P12 certificate for an app
ably apps stats Get app stats with optional live updates
ably apps switch Switch to a different Ably app
ably apps update Update an app
`
_See code: src/commands/apps/index.ts_
Manage Ably channel rules (namespaces)
`
USAGE
$ ably apps channel-rules
DESCRIPTION
Manage Ably channel rules (namespaces)
EXAMPLES
$ ably apps channel-rules list
$ ably apps channel-rules create --name "chat" --persisted
$ ably apps channel-rules update chat --push-enabled
$ ably apps channel-rules delete chat
`
_See code: src/commands/apps/channel-rules/index.ts_
Create a channel rule
`
USAGE
$ ably apps channel-rules create --name
[--authenticated] [--batching-enabled] [--batching-interval
[--populate-channel-registry] [--push-enabled] [--tls-only]
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--authenticated Whether channels matching this rule require clients to be authenticated
--batching-enabled Whether to enable batching for messages on channels matching this rule
--batching-interval=
--client-id=
explicitly set no client ID. Not applicable when using token authentication.
--conflation-enabled Whether to enable conflation for messages on channels matching this rule
--conflation-interval=
--conflation-key=
--endpoint=
--env=
--expose-time-serial Whether to expose the time serial for messages on channels matching this rule
--host=
--json Output in JSON format
--name=
--persist-last Whether to persist only the last message on channels matching this rule
--persisted Whether messages on channels matching this rule should be persisted
--populate-channel-registry Whether to populate the channel registry for channels matching this rule
--pretty-json Output in colorized JSON format
--push-enabled Whether push notifications should be enabled for channels matching this rule
--tls-only Whether to enforce TLS for channels matching this rule
--token=
DESCRIPTION
Create a channel rule
EXAMPLES
$ ably apps channel-rules create --name "chat" --persisted
$ ably apps channel-rules create --name "events" --push-enabled
$ ably apps channel-rules create --name "notifications" --persisted --push-enabled --app "My App"
`
_See code: src/commands/apps/channel-rules/create.ts_
Delete a channel rule
`
USAGE
$ ably apps channel-rules delete NAMEORID [--access-token
[--endpoint
ARGUMENTS
NAMEORID Name or ID of the channel rule to delete
FLAGS
-f, --force Force deletion without confirmation
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Delete a channel rule
EXAMPLES
$ ably apps channel-rules delete chat
$ ably apps channel-rules delete events --app "My App"
$ ably apps channel-rules delete notifications --force
$ ably apps channel-rules delete chat --json
$ ably apps channel-rules delete chat --pretty-json
`
_See code: src/commands/apps/channel-rules/delete.ts_
List channel rules for an app
`
USAGE
$ ably apps channel-rules list
DESCRIPTION
List channel rules for an app
EXAMPLES
$ ably apps:channel-rules:list
$ ably apps:channel-rules:list --app-id my-app-id
$ ably apps:channel-rules:list --json
$ ably apps:channel-rules:list --pretty-json
`
_See code: src/commands/apps/channel-rules/list.ts_
Update a channel rule
`
USAGE
$ ably apps channel-rules update NAMEORID [--access-token
[--endpoint
[--authenticated] [--batching-enabled] [--batching-interval
[--populate-channel-registry] [--push-enabled] [--tls-only]
ARGUMENTS
NAMEORID Name or ID of the channel rule to update
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--[no-]authenticated Whether channels matching this rule require clients to be authenticated
--[no-]batching-enabled Whether to enable batching for messages on channels matching this rule
--batching-interval=
--client-id=
explicitly set no client ID. Not applicable when using token authentication.
--[no-]conflation-enabled Whether to enable conflation for messages on channels matching this rule
--conflation-interval=
--conflation-key=
--endpoint=
--env=
--[no-]expose-time-serial Whether to expose the time serial for messages on channels matching this rule
--host=
--json Output in JSON format
--[no-]persist-last Whether to persist only the last message on channels matching this rule
--[no-]persisted Whether messages on channels matching this rule should be persisted
--[no-]populate-channel-registry Whether to populate the channel registry for channels matching this rule
--pretty-json Output in colorized JSON format
--[no-]push-enabled Whether push notifications should be enabled for channels matching this rule
--[no-]tls-only Whether to enforce TLS for channels matching this rule
--token=
DESCRIPTION
Update a channel rule
EXAMPLES
$ ably apps channel-rules update chat --persisted
$ ably apps channel-rules update events --push-enabled=false
$ ably apps channel-rules update notifications --persisted --push-enabled --app "My App"
`
_See code: src/commands/apps/channel-rules/update.ts_
Create a new app
`
USAGE
$ ably apps create --name
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--name=
--pretty-json Output in colorized JSON format
--tls-only Whether the app should accept TLS connections only
--token=
DESCRIPTION
Create a new app
EXAMPLES
$ ably apps create --name "My New App"
$ ably apps create --name "My New App" --tls-only
$ ably apps create --name "My New App" --access-token "YOUR_ACCESS_TOKEN"
`
_See code: src/commands/apps/create.ts_
Show the currently selected app
`
USAGE
$ ably apps current [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Show the currently selected app
EXAMPLES
$ ably apps current
$ ably apps current --json
$ ably apps current --pretty-json
`
_See code: src/commands/apps/current.ts_
Delete an app
`
USAGE
$ ably apps delete [APPID] [--access-token
[--endpoint
ARGUMENTS
APPID App ID to delete (uses current app if not specified)
FLAGS
-f, --force Skip confirmation prompt
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Delete an app
EXAMPLES
$ ably apps delete
$ ably apps delete app-id
$ ably apps delete --app app-id
$ ably apps delete app-id --access-token "YOUR_ACCESS_TOKEN"
$ ably apps delete app-id --force
$ ably apps delete app-id --json
$ ably apps delete app-id --pretty-json
`
_See code: src/commands/apps/delete.ts_
List all apps in the current account
`
USAGE
$ ably apps list [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
List all apps in the current account
EXAMPLES
$ ably apps list
$ ably apps list --json
$ ably apps list --pretty-json
`
_See code: src/commands/apps/list.ts_
Upload Apple Push Notification Service P12 certificate for an app
`
USAGE
$ ably apps set-apns-p12 ID --certificate
[--env
ARGUMENTS
ID App ID to set the APNS certificate for
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--certificate=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--password=
--pretty-json Output in colorized JSON format
--token=
--use-for-sandbox Whether to use this certificate for the APNS sandbox environment
DESCRIPTION
Upload Apple Push Notification Service P12 certificate for an app
EXAMPLES
$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12
$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12 --password "YOUR_CERTIFICATE_PASSWORD"
$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12 --use-for-sandbox
`
_See code: src/commands/apps/set-apns-p12.ts_
Get app stats with optional live updates
`
USAGE
$ ably apps stats [ID] [--access-token
[--endpoint
[--interval
ARGUMENTS
ID App ID to get stats for (uses default app if not provided)
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--debug Show debug information for live stats polling
--end=
--endpoint=
--env=
--host=
--interval=
--json Output in JSON format
--limit=
--live Subscribe to live stats updates (uses minute interval)
--pretty-json Output in colorized JSON format
--start=
--token=
--unit=
DESCRIPTION
Get app stats with optional live updates
EXAMPLES
$ ably apps stats
$ ably apps stats app-id
$ ably apps stats --unit hour
$ ably apps stats app-id --unit hour
$ ably apps stats app-id --start 1618005600000 --end 1618091999999
$ ably apps stats app-id --limit 10
$ ably apps stats app-id --json
$ ably apps stats app-id --pretty-json
$ ably apps stats --live
$ ably apps stats app-id --live
$ ably apps stats --live --interval 15
`
_See code: src/commands/apps/stats/index.ts_
Switch to a different Ably app
`
USAGE
$ ably apps switch [APPID] [--access-token
[--endpoint
ARGUMENTS
APPID ID of the app to switch to
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Switch to a different Ably app
EXAMPLES
$ ably apps switch APP_ID
$ ably apps switch
`
_See code: src/commands/apps/switch.ts_
Update an app
`
USAGE
$ ably apps update ID [--access-token
[--endpoint
ARGUMENTS
ID App ID to update
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--name=
--pretty-json Output in colorized JSON format
--tls-only Whether the app should accept TLS connections only
--token=
DESCRIPTION
Update an app
EXAMPLES
$ ably apps update app-id --name "Updated App Name"
$ ably apps update app-id --tls-only
$ ably apps update app-id --name "Updated App Name" --tls-only
$ ably apps update app-id --name "Updated App Name" --access-token "YOUR_ACCESS_TOKEN"
`
_See code: src/commands/apps/update.ts_
Manage authentication, keys and tokens
`
USAGE
$ ably auth
DESCRIPTION
Manage authentication, keys and tokens
EXAMPLES
$ ably auth keys list
$ ably auth issue-jwt-token
$ ably auth issue-ably-token
COMMANDS
ably auth issue-ably-token Creates an Ably Token with capabilities
ably auth issue-jwt-token Creates an Ably JWT token with capabilities
ably auth keys Key management commands
ably auth revoke-token Revokes the token provided
`
_See code: src/commands/auth/index.ts_
Creates an Ably Token with capabilities
`
USAGE
$ ably auth issue-ably-token [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--capability=
--client-id=
client ID, otherwise a default will be generated.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
--token-only Output only the token string without any formatting or additional information
--ttl=
DESCRIPTION
Creates an Ably Token with capabilities
EXAMPLES
$ ably auth issue-ably-token
$ ably auth issue-ably-token --capability '{"":[""]}'
$ ably auth issue-ably-token --capability '{"chat:":["publish","subscribe"], "status:":["subscribe"]}' --ttl 3600
$ ably auth issue-ably-token --client-id client123 --ttl 86400
$ ably auth issue-ably-token --client-id "none" --ttl 3600
$ ably auth issue-ably-token --json
$ ably auth issue-ably-token --pretty-json
$ ably auth issue-ably-token --token-only
$ ably channels publish --token "$(ably auth issue-ably-token --token-only)" my-channel "Hello"
`
_See code: src/commands/auth/issue-ably-token.ts_
Creates an Ably JWT token with capabilities
`
USAGE
$ ably auth issue-jwt-token [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--capability=
--client-id=
client ID, otherwise a default will be generated.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
--token-only Output only the token string without any formatting or additional information
--ttl=
DESCRIPTION
Creates an Ably JWT token with capabilities
EXAMPLES
$ ably auth issue-jwt-token
$ ably auth issue-jwt-token --capability '{"":[""]}'
$ ably auth issue-jwt-token --capability '{"chat:":["publish","subscribe"], "status:":["subscribe"]}' --ttl 3600
$ ably auth issue-jwt-token --client-id client123 --ttl 86400
$ ably auth issue-jwt-token --json
$ ably auth issue-jwt-token --pretty-json
$ ably auth issue-jwt-token --token-only
$ ably channels publish --token "$(ably auth issue-jwt-token --token-only)" my-channel "Hello"
`
_See code: src/commands/auth/issue-jwt-token.ts_
Key management commands
`
USAGE
$ ably auth keys
DESCRIPTION
Key management commands
EXAMPLES
$ ably auth keys list
$ ably auth keys create --name "My New Key"
$ ably auth keys get KEY_ID
$ ably auth keys revoke KEY_ID
$ ably auth keys update KEY_ID
$ ably auth keys switch KEY_ID
`
_See code: src/commands/auth/keys/index.ts_
Create a new API key for an app
`
USAGE
$ ably auth keys create --name
[--capabilities
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--capabilities=
'{"channel:*":["publish"]}'
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--name=
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Create a new API key for an app
EXAMPLES
$ ably auth keys create --name "My New Key"
$ ably auth keys create --name "My New Key" --app APP_ID
$ ably auth keys create --name "My New Key" --capabilities '{"":[""]}'
$ ably auth keys create --name "My New Key" --capabilities '{"channel1":["publish","subscribe"],"channel2":["history"]}'
$ ably auth keys create --name "My New Key" --json
$ ably auth keys create --name "My New Key" --pretty-json
$ ably auth keys create --app
$ ably auth keys create --app
$ ably auth keys create --name "My New Key" --capabilities '{"channel1":["publish","subscribe"],"channel2":["history"]}'
`
_See code: src/commands/auth/keys/create.ts_
Show the current API key for the selected app
`
USAGE
$ ably auth keys current [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Show the current API key for the selected app
EXAMPLES
$ ably auth keys current
$ ably auth keys current --app APP_ID
$ ably auth keys current --json
$ ably auth keys current --pretty-json
`
_See code: src/commands/auth/keys/current.ts_
Get details for a specific key
`
USAGE
$ ably auth keys get KEYNAMEORVALUE [--access-token
ARGUMENTS
KEYNAMEORVALUE Key name (APP_ID.KEY_ID) or full value of the key to get details for
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Get details for a specific key
EXAMPLES
$ ably auth keys get APP_ID.KEY_ID
$ ably auth keys get KEY_ID --app APP_ID
$ ably auth keys get APP_ID.KEY_ID --json
$ ably auth keys get APP_ID.KEY_ID --pretty-json
`
_See code: src/commands/auth/keys/get.ts_
List all keys in the app
`
USAGE
$ ably auth keys list [--access-token
[--endpoint
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
List all keys in the app
EXAMPLES
$ ably auth keys list
$ ably auth keys list --app APP_ID
$ ably auth keys list --json
$ ably auth keys list --pretty-json
`
_See code: src/commands/auth/keys/list.ts_
Revoke an API key (permanently disables the key)
`
USAGE
$ ably auth keys revoke KEYNAME [--access-token
[--endpoint
ARGUMENTS
KEYNAME Key name (APP_ID.KEY_ID) of the key to revoke
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--force Skip confirmation prompt
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Revoke an API key (permanently disables the key)
EXAMPLES
$ ably auth keys revoke APP_ID.KEY_ID
$ ably auth keys revoke KEY_ID --app APP_ID
$ ably auth keys revoke APP_ID.KEY_ID --force
$ ably auth keys revoke APP_ID.KEY_ID --json
$ ably auth keys revoke APP_ID.KEY_ID --pretty-json
`
_See code: src/commands/auth/keys/revoke.ts_
Switch to a different API key for the current app
`
USAGE
$ ably auth keys switch [KEYNAMEORVALUE] [--access-token
ARGUMENTS
KEYNAMEORVALUE Key name (APP_ID.KEY_ID) or full value of the key to switch to
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Switch to a different API key for the current app
EXAMPLES
$ ably auth keys switch
$ ably auth keys switch APP_ID.KEY_ID
$ ably auth keys switch KEY_ID --app APP_ID
`
_See code: src/commands/auth/keys/switch.ts_
Update a key's properties
``
USAGE
$ ably auth keys update KEYNAME [--access-token
[--endpoint
[--capabilities
ARGUMENTS
KEYNAME Key name (APP_ID.KEY_ID) of the key to update
FLAGS
-v, --verbose Output verbose logs
--access-token=
--api-key=
--app=
--capabilities=
--client-id=
set no client ID. Not applicable when using token authentication.
--endpoint=
--env=
--host=
--json Output in JSON format
--name=
--pretty-json Output in colorized JSON format
--token=
DESCRIPTION
Update a key's properties
EXAMPLES
$ ably auth keys update