@ably/cli v0.5.1
Ably CLI and MCP server
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.

CLI Usage
$ npm install -g @ably/cli
$ ably COMMAND
running command...
$ ably (--version)
@ably/cli/0.5.1 darwin-arm64 node-v22.14.0
$ ably --help [COMMAND]
USAGE
$ ably COMMAND
...LOGIN (recommended first step)
$ ably loginMCP Usage
!WARNING The MCP server is currently experimental. Please raise an issue if you have feedback or suggestions for features.
- Install the CLI following the CLI usage steps.
- Follow the instructions for your tool to set up an MCP server, such as Claude desktop, and configure:
commandas 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
Commands
ably accountsably accounts currentably accounts listably accounts login [TOKEN]ably accounts logout [ALIAS]ably accounts statsably accounts switch [ALIAS]ably appsably apps channel-rulesably apps channel-rules createably apps channel-rules delete NAMEORIDably apps channel-rules listably apps channel-rules update NAMEORIDably apps createably apps currentably apps delete [ID]ably apps listably apps logsably apps logs historyably apps logs subscribeably apps set-apns-p12 IDably apps stats [ID]ably apps switch [APPID]ably apps update IDably authably auth issue-ably-tokenably auth issue-jwt-tokenably auth keysably auth keys createably auth keys currentably auth keys get KEYNAMEORVALUEably auth keys listably auth keys revoke KEYNAMEably auth keys switch [KEYNAMEORVALUE]ably auth keys update KEYNAMEably auth revoke-token TOKENably benchably bench publisher CHANNELably bench subscriber CHANNELably channelsably channels batch-publish [MESSAGE]ably channels history CHANNELably channels listably channels logs [TOPIC]ably channels occupancyably channels occupancy get CHANNELably channels occupancy subscribe CHANNELably channels presenceably channels presence enter CHANNELably channels presence subscribe CHANNELably channels publish CHANNEL MESSAGEably channels subscribe CHANNELSably configably connectionsably connections logs [TOPIC]ably connections statsably connections testably helpably help ask QUESTIONably help contactably help statusably help supportably integrationsably integrations createably integrations delete RULEIDably integrations get RULEIDably integrations listably integrations update RULEIDably login [TOKEN]ably logsably logs appably logs app historyably logs app subscribeably logs channel-lifecycleably logs channel-lifecycle subscribeably logs connection-lifecycleably logs connection-lifecycle historyably logs connection-lifecycle subscribeably logs connection subscribeably logs pushably logs push historyably logs push subscribeably mcpably mcp start-serverably queuesably queues createably queues delete QUEUENAMEably queues listably roomsably rooms listably rooms messagesably rooms messages get ROOMIDably rooms messages send ROOMID TEXTably rooms messages subscribe ROOMIDably rooms occupancyably rooms occupancy get ROOMIDably rooms occupancy subscribe ROOMIDably rooms presenceably rooms presence enter ROOMIDably rooms presence subscribe ROOMIDably rooms reactionsably rooms reactions send ROOMID EMOJIably rooms reactions subscribe ROOMIDably rooms typingably rooms typing start ROOMIDably rooms typing subscribe ROOMIDably spacesably spaces cursorsably spaces cursors get-all SPACEIDably spaces cursors set SPACEIDably spaces cursors subscribe SPACEIDably spaces listably spaces locationsably spaces locations get-all SPACEIDably spaces locations set SPACEIDably spaces locations subscribe SPACEIDably spaces locksably spaces locks acquire SPACEID LOCKIDably spaces locks get SPACEID LOCKIDably spaces locks get-all SPACEIDably spaces locks subscribe SPACEIDably spaces membersably spaces members enter SPACEIDably spaces members subscribe SPACEID
ably accounts
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 statsSee code: src/commands/accounts/index.ts
ably accounts current
Show the current Ably account
USAGE
$ ably accounts current [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Show the current Ably account
EXAMPLES
$ ably accounts current
$ ably accounts current --json
$ ably accounts current --pretty-jsonSee code: src/commands/accounts/current.ts
ably accounts list
List locally configured Ably accounts
USAGE
$ ably accounts list [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
List locally configured Ably accounts
EXAMPLES
$ ably accounts list
$ ably accounts list --json
$ ably accounts list --pretty-jsonSee code: src/commands/accounts/list.ts
ably accounts login [TOKEN]
Log in to your Ably account
USAGE
$ ably accounts login [TOKEN] [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [-a <value>]
[--no-browser]
ARGUMENTS
TOKEN Access token (if not provided, will prompt for it)
FLAGS
-a, --alias=<value> Alias for this account (default account if not specified)
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--no-browser Do not open a browser
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Log in to your Ably account
EXAMPLES
$ ably accounts login
$ ably accounts login --alias mycompany
$ ably accounts login --json
$ ably accounts login --pretty-jsonSee code: src/commands/accounts/login.ts
ably accounts logout [ALIAS]
Log out from an Ably account
USAGE
$ ably accounts logout [ALIAS] [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [-f]
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=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Log out from an Ably account
EXAMPLES
$ ably accounts logout
$ ably accounts logout mycompany
$ ably accounts logout --json
$ ably accounts logout --pretty-jsonSee code: src/commands/accounts/logout.ts
ably accounts stats
Get account stats with optional live updates
USAGE
$ ably accounts stats [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--debug] [--end <value>]
[--interval <value>] [--limit <value>] [--live] [--start <value>] [--unit minute|hour|day|month]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--debug Show debug information for live stats polling
--end=<value> End time in milliseconds since epoch
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--interval=<value> [default: 6] Polling interval in seconds (only used with --live)
--json Output in JSON format
--limit=<value> [default: 10] Maximum number of stats records to return
--live Subscribe to live stats updates (uses minute interval)
--pretty-json Output in colorized JSON format
--start=<value> Start time in milliseconds since epoch
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
--unit=<option> [default: minute] Time unit for stats
<options: minute|hour|day|month>
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 15See code: src/commands/accounts/stats/index.ts
ably accounts switch [ALIAS]
Switch to a different Ably account
USAGE
$ ably accounts switch [ALIAS] [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
ARGUMENTS
ALIAS Alias of the account to switch to
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Switch to a different Ably account
EXAMPLES
$ ably accounts switch
$ ably accounts switch mycompany
$ ably accounts switch --json
$ ably accounts switch --pretty-jsonSee code: src/commands/accounts/switch.ts
ably apps
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-appSee code: src/commands/apps/index.ts
ably apps channel-rules
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 chatSee code: src/commands/apps/channel-rules/index.ts
ably apps channel-rules create
Create a channel rule
USAGE
$ ably apps channel-rules create --name <value> [--access-token <value>] [--api-key <value>] [--client-id <value>]
[--control-host <value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app
<value>] [--authenticated] [--batching-enabled] [--batching-interval <value>] [--conflation-enabled]
[--conflation-interval <value>] [--conflation-key <value>] [--expose-time-serial] [--persist-last] [--persisted]
[--populate-channel-registry] [--push-enabled] [--tls-only]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID or name to create the channel rule in
--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=<value> The batching interval for messages on channels matching this rule
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to
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=<value> The conflation interval for messages on channels matching this rule
--conflation-key=<value> The conflation key for messages on channels matching this rule
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--expose-time-serial Whether to expose the time serial for messages on channels matching this rule
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--name=<value> (required) Name of the channel rule
--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=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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
ably apps channel-rules delete NAMEORID
Delete a channel rule
USAGE
$ ably apps channel-rules delete NAMEORID [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>] [-f]
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=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID or name to delete the channel rule from
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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-jsonSee code: src/commands/apps/channel-rules/delete.ts
ably apps channel-rules list
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-jsonSee code: src/commands/apps/channel-rules/list.ts
ably apps channel-rules update NAMEORID
Update a channel rule
USAGE
$ ably apps channel-rules update NAMEORID [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>]
[--authenticated] [--batching-enabled] [--batching-interval <value>] [--conflation-enabled] [--conflation-interval
<value>] [--conflation-key <value>] [--expose-time-serial] [--persist-last] [--persisted]
[--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=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID or name to update the channel rule in
--[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=<value> The batching interval for messages on channels matching this rule
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to
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=<value> The conflation interval for messages on channels matching this rule
--conflation-key=<value> The conflation key for messages on channels matching this rule
--control-host=<value> Override the host endpoint for the control API, which defaults to
control.ably.net
--env=<value> Override the environment for all product API calls
--[no-]expose-time-serial Whether to expose the time serial for messages on channels matching this rule
--host=<value> Override the host endpoint for all product API calls
--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=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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
ably apps create
Create a new app
USAGE
$ ably apps create --name <value> [--access-token <value>] [--api-key <value>] [--client-id <value>]
[--control-host <value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
[--tls-only]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--name=<value> (required) Name of the app
--pretty-json Output in colorized JSON format
--tls-only Whether the app should accept TLS connections only
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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
ably apps current
Show the currently selected app
USAGE
$ ably apps current [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Show the currently selected app
EXAMPLES
$ ably apps current
$ ably apps current --json
$ ably apps current --pretty-jsonSee code: src/commands/apps/current.ts
ably apps delete [ID]
Delete an app
USAGE
$ ably apps delete [ID] [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [-f]
ARGUMENTS
ID App ID to delete (uses current app if not specified)
FLAGS
-f, --force Skip confirmation prompt
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Delete an app
EXAMPLES
$ ably apps delete
$ ably apps delete 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-jsonSee code: src/commands/apps/delete.ts
ably apps list
List all apps in the current account
USAGE
$ ably apps list [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
List all apps in the current account
EXAMPLES
$ ably apps list
$ ably apps list --json
$ ably apps list --pretty-jsonSee code: src/commands/apps/list.ts
ably apps logs
Stream or retrieve app logs
USAGE
$ ably apps logs
DESCRIPTION
Stream or retrieve app logs
EXAMPLES
$ ably apps logs subscribe
$ ably apps logs subscribe --rewind 10
$ ably apps logs historySee code: src/commands/apps/logs/index.ts
ably apps logs history
Alias for ably logs app history
USAGE
$ ably apps logs history [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--pretty-json | --json] [--token <value>] [-v] [--direction backwards|forwards]
[--limit <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--direction=<option> [default: backwards] Direction of message retrieval
<options: backwards|forwards>
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output results in JSON format
--limit=<value> [default: 100] Maximum number of messages to retrieve
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Alias for `ably logs app history`
EXAMPLES
$ ably apps logs history
$ ably apps logs history --limit 20
$ ably apps logs history --direction forwards
$ ably apps logs history --json
$ ably apps logs history --pretty-jsonSee code: src/commands/apps/logs/history.ts
ably apps logs subscribe
Alias for ably logs app subscribe
USAGE
$ ably apps logs subscribe [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--pretty-json | --json] [--token <value>] [-v] [--rewind <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output results as JSON
--pretty-json Output in colorized JSON format
--rewind=<value> Number of messages to rewind when subscribing
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Alias for ably logs app subscribe
EXAMPLES
$ ably apps logs subscribe
$ ably apps logs subscribe --rewind 10See code: src/commands/apps/logs/subscribe.ts
ably apps set-apns-p12 ID
Upload Apple Push Notification Service P12 certificate for an app
USAGE
$ ably apps set-apns-p12 ID --certificate <value> [--access-token <value>] [--api-key <value>] [--client-id <value>]
[--control-host <value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
[--password <value>] [--use-for-sandbox]
ARGUMENTS
ID App ID to set the APNS certificate for
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--certificate=<value> (required) Path to the P12 certificate file
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--password=<value> Password for the P12 certificate
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
--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-sandboxSee code: src/commands/apps/set-apns-p12.ts
ably apps stats [ID]
Get app stats with optional live updates
USAGE
$ ably apps stats [ID] [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--debug] [--end <value>]
[--interval <value>] [--limit <value>] [--live] [--start <value>] [--unit minute|hour|day|month]
ARGUMENTS
ID App ID to get stats for (uses default app if not provided)
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--debug Show debug information for live stats polling
--end=<value> End time in milliseconds since epoch
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--interval=<value> [default: 6] Polling interval in seconds (only used with --live)
--json Output in JSON format
--limit=<value> [default: 10] Maximum number of stats records to return
--live Subscribe to live stats updates (uses minute interval)
--pretty-json Output in colorized JSON format
--start=<value> Start time in milliseconds since epoch
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
--unit=<option> [default: minute] Time unit for stats
<options: minute|hour|day|month>
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 15See code: src/commands/apps/stats/index.ts
ably apps switch [APPID]
Switch to a different Ably app
USAGE
$ ably apps switch [APPID] [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v]
ARGUMENTS
APPID ID of the app to switch to
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
DESCRIPTION
Switch to a different Ably app
EXAMPLES
$ ably apps switch APP_ID
$ ably apps switchSee code: src/commands/apps/switch.ts
ably apps update ID
Update an app
USAGE
$ ably apps update ID [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--name <value>]
[--tls-only]
ARGUMENTS
ID App ID to update
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--name=<value> New name for the app
--pretty-json Output in colorized JSON format
--tls-only Whether the app should accept TLS connections only
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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
ably auth
Authentication for Ably including key management and token generation
USAGE
$ ably auth
DESCRIPTION
Authentication for Ably including key management and token generation
EXAMPLES
$ ably auth keys list
$ ably auth keys get KEY_ID
$ ably auth keys revoke KEY_ID
$ ably auth keys update KEY_ID
$ ably auth keys switch KEY_ID
$ ably auth issue-jwt-token
$ ably auth issue-ably-token
$ ably auth revoke-token TOKENSee code: src/commands/auth/index.ts
ably auth issue-ably-token
Creates an Ably Token with capabilities
USAGE
$ ably auth issue-ably-token [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>] [--capability
<value>] [--token-only] [--ttl <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID to use (uses current app if not specified)
--capability=<value> [default: {"*":["*"]}] Capabilities JSON string (e.g. {"channel":["publish","subscribe"]})
--client-id=<value> Client ID to associate with the token. Use "none" to explicitly issue a token with no
client ID, otherwise a default will be generated.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
--token-only Output only the token string without any formatting or additional information
--ttl=<value> [default: 3600] Time to live in seconds
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
ably auth issue-jwt-token
Creates an Ably JWT token with capabilities
USAGE
$ ably auth issue-jwt-token [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>] [--capability
<value>] [--token-only] [--ttl <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID to use (uses current app if not specified)
--capability=<value> [default: {"*":["*"]}] Capabilities JSON string (e.g. {"channel":["publish","subscribe"]})
--client-id=<value> Client ID to associate with the token. Use "none" to explicitly issue a token with no
client ID, otherwise a default will be generated.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
--token-only Output only the token string without any formatting or additional information
--ttl=<value> [default: 3600] Time to live in seconds
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
ably auth keys
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_IDSee code: src/commands/auth/keys/index.ts
ably auth keys create
Create a new API key for an app
USAGE
$ ably auth keys create --name <value> [--access-token <value>] [--api-key <value>] [--client-id <value>]
[--control-host <value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app
<value>] [--capabilities <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID the key belongs to (uses current app if not specified)
--capabilities=<value> [default: {"*":["*"]}] Capability object as a JSON string. Example:
'{"channel:*":["publish"]}'
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--name=<value> (required) Name of the key
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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 <appId> --name "MyKey" --capabilities '{"channel:*":["publish"]}'
$ ably auth keys create --app <appId> --name "MyOtherKey" --capabilities '{"channel:chat-*":["subscribe"],"channel:updates":["publish"]}' --ttl 86400
$ ably auth keys create --name "My New Key" --capabilities '{"channel1":["publish","subscribe"],"channel2":["history"]}'See code: src/commands/auth/keys/create.ts
ably auth keys current
Show the current API key for the selected app
USAGE
$ ably auth keys current [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID to check key for (uses current app if not specified)
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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-jsonSee code: src/commands/auth/keys/current.ts
ably auth keys get KEYNAMEORVALUE
Get details for a specific key
USAGE
$ ably auth keys get KEYNAMEORVALUE [--access-token <value>] [--api-key <value>] [--client-id <value>]
[--control-host <value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app
<value>]
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=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID the key belongs to (uses current app if not specified)
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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-jsonSee code: src/commands/auth/keys/get.ts
ably auth keys list
List all keys in the app
USAGE
$ ably auth keys list [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host <value>]
[--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>]
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID to list keys for (uses current app if not specified)
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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-jsonSee code: src/commands/auth/keys/list.ts
ably auth keys revoke KEYNAME
Revoke an API key (permanently disables the key)
USAGE
$ ably auth keys revoke KEYNAME [--access-token <value>] [--api-key <value>] [--client-id <value>] [--control-host
<value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app <value>] [--force]
ARGUMENTS
KEYNAME Key name (APP_ID.KEY_ID) of the key to revoke
FLAGS
-v, --verbose Output verbose logs
--access-token=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID the key belongs to (uses current app if not specified)
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all product API calls
--force Skip confirmation prompt
--host=<value> Override the host endpoint for all product API calls
--json Output in JSON format
--pretty-json Output in colorized JSON format
--token=<value> Authenticate using an Ably Token or JWT Token instead of an API key
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-jsonSee code: src/commands/auth/keys/revoke.ts
ably auth keys switch [KEYNAMEORVALUE]
Switch to a different API key for the current app
USAGE
$ ably auth keys switch [KEYNAMEORVALUE] [--access-token <value>] [--api-key <value>] [--client-id <value>]
[--control-host <value>] [--env <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [--app
<value>]
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=<value> Overrides any configured access token used for the Control API
--api-key=<value> Overrides any configured API key used for the product APIs
--app=<value> App ID to switch keys for (uses current app if not specified)
--client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly
set no client ID. Not applicable when using token authentication.
--control-host=<value> Override the host endpoint for the control API, which defaults to control.ably.net
--env=<value> Override the environment for all 6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago