@ably/cli
v0.3.2
Published
Ably CLI for Pub/Sub, Chat, Spaces and the Control API
Downloads
1,073
Readme
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.3.2 darwin-arm64 node-v22.14.0
$ ably --help [COMMAND]
USAGE
$ ably COMMAND
...
LOGIN (recommended first step)
$ ably login
MCP 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:
command
as ably mcp start-server
[!NOTE]
If you are having trouble getting the MCP server running, use MCP inspector
Commands
ably accounts
ably accounts current
ably accounts list
ably accounts login [TOKEN]
ably accounts logout [ALIAS]
ably accounts stats
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 [ID]
ably apps list
ably apps logs
ably apps logs history
ably apps logs subscribe
ably apps set-apns-p12 ID
ably apps stats [ID]
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 update KEYNAME
ably auth revoke-token TOKEN
ably bench
ably bench publisher CHANNEL
ably bench subscriber CHANNEL
ably channels
ably channels batch-publish [MESSAGE]
ably channels history CHANNEL
ably channels list
ably channels logs [TOPIC]
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 connections
ably connections logs [TOPIC]
ably connections stats
ably connections test
ably help
ably help ask QUESTION
ably help contact
ably help status
ably help support
ably integrations
ably integrations create
ably integrations delete RULEID
ably integrations get RULEID
ably integrations list
ably integrations update RULEID
ably login [TOKEN]
ably logs
ably logs app
ably logs app history
ably logs app subscribe
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 connection subscribe
ably logs push
ably logs push history
ably logs push subscribe
ably mcp
ably mcp start-server
ably queues
ably queues create
ably queues delete QUEUENAME
ably queues list
ably rooms
ably rooms list
ably rooms messages
ably rooms messages get ROOMID
ably rooms messages send ROOMID TEXT
ably rooms messages subscribe ROOMID
ably rooms occupancy
ably rooms occupancy get ROOMID
ably rooms occupancy subscribe ROOMID
ably rooms presence
ably rooms presence enter ROOMID
ably rooms presence subscribe ROOMID
ably rooms reactions
ably rooms reactions send ROOMID TYPE
ably rooms reactions subscribe ROOMID
ably rooms typing
ably rooms typing start ROOMID
ably rooms typing subscribe ROOMID
ably spaces
ably spaces cursors
ably spaces cursors get-all SPACEID
ably spaces cursors set SPACEID
ably spaces cursors subscribe SPACEID
ably spaces list
ably spaces locations
ably spaces locations get-all SPACEID
ably spaces locations set SPACEID
ably spaces locations subscribe SPACEID
ably spaces locks
ably spaces locks acquire SPACEID LOCKID
ably spaces locks get SPACEID LOCKID
ably spaces locks get-all SPACEID
ably spaces locks subscribe SPACEID
ably spaces members
ably spaces members enter SPACEID
ably 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 stats
See code: src/commands/accounts/index.ts
ably accounts current
Show the current Ably account
USAGE
$ ably accounts current [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <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 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-json
See code: src/commands/accounts/current.ts
ably accounts list
List locally configured Ably accounts
USAGE
$ ably accounts list [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <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 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-json
See code: src/commands/accounts/list.ts
ably accounts login [TOKEN]
Log in to your Ably account
USAGE
$ ably accounts login [TOKEN] [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [-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-json
See code: src/commands/accounts/login.ts
ably accounts logout [ALIAS]
Log out from an Ably account
USAGE
$ ably accounts logout [ALIAS] [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [-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-json
See code: src/commands/accounts/logout.ts
ably accounts stats
Get account stats with optional live updates
USAGE
$ ably accounts stats [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--start <value>] [--end
<value>] [--unit minute|hour|day|month] [--limit <value>] [--live] [--interval <value>] [--debug]
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 15
See code: src/commands/accounts/stats/index.ts
ably accounts switch [ALIAS]
Switch to a different Ably account
USAGE
$ ably accounts switch [ALIAS] [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>]
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-json
See 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-app
See 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 chat
See 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> [--json | --pretty-json] [-v] [--host <value>] [--env <value>]
[--control-host <value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>]
[--persisted] [--push-enabled] [--authenticated] [--persist-last] [--expose-time-serial]
[--populate-channel-registry] [--batching-enabled] [--batching-interval <value>] [--conflation-enabled]
[--conflation-interval <value>] [--conflation-key <value>] [--tls-only] [--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 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 [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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-json
See 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-json
See 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 [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--persisted]
[--push-enabled] [--authenticated] [--persist-last] [--expose-time-serial] [--populate-channel-registry]
[--batching-enabled] [--batching-interval <value>] [--conflation-enabled] [--conflation-interval <value>]
[--conflation-key <value>] [--tls-only] [--app <value>]
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> [--json | --pretty-json] [-v] [--host <value>] [--env <value>]
[--control-host <value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>]
[--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 [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <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 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-json
See code: src/commands/apps/current.ts
ably apps delete [ID]
Delete an app
USAGE
$ ably apps delete [ID] [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [-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-json
See code: src/commands/apps/delete.ts
ably apps list
List all apps in the current account
USAGE
$ ably apps list [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <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 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-json
See 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 history
See code: src/commands/apps/logs/index.ts
ably apps logs history
Alias for ably logs app history
USAGE
$ ably apps logs history [--pretty-json | --json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--limit <value>] [--direction
backwards|forwards]
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-json
See code: src/commands/apps/logs/history.ts
ably apps logs subscribe
Alias for ably logs app subscribe
USAGE
$ ably apps logs subscribe [--pretty-json | --json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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 10
See 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> [--json | --pretty-json] [-v] [--host <value>] [--env <value>]
[--control-host <value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>]
[--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-sandbox
See code: src/commands/apps/set-apns-p12.ts
ably apps stats [ID]
Get app stats with optional live updates
USAGE
$ ably apps stats [ID] [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--start <value>] [--end
<value>] [--unit minute|hour|day|month] [--limit <value>] [--live] [--interval <value>] [--debug]
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 15
See code: src/commands/apps/stats/index.ts
ably apps switch [APPID]
Switch to a different Ably app
USAGE
$ ably apps switch [APPID] [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>]
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 switch
See code: src/commands/apps/switch.ts
ably apps update ID
Update an app
USAGE
$ ably apps update ID [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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 TOKEN
See code: src/commands/auth/index.ts
ably auth issue-ably-token
Creates an Ably Token with capabilities
USAGE
$ ably auth issue-ably-token [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--app <value>] [--capability
<value>] [--ttl <value>] [--token-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 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 [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--app <value>] [--capability
<value>] [--ttl <value>] [--token-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 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_ID
See 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> [--json | --pretty-json] [-v] [--host <value>] [--env <value>]
[--control-host <value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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: {"*":["*"]}] JSON string of capabilities for the key, e.g. "{\"*\":[\"*\"]}"
--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
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 [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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-json
See code: src/commands/auth/keys/current.ts
ably auth keys get KEYNAMEORVALUE
Get details for a specific key
USAGE
$ ably auth keys get KEYNAMEORVALUE [--json | --pretty-json] [-v] [--host <value>] [--env <value>]
[--control-host <value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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-json
See code: src/commands/auth/keys/get.ts
ably auth keys list
List all keys in the app
USAGE
$ ably auth keys list [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host <value>]
[--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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-json
See 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 [--json | --pretty-json] [-v] [--host <value>] [--env <value>] [--control-host
<value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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-json
See 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] [--json | --pretty-json] [-v] [--host <value>] [--env <value>]
[--control-host <value>] [--access-token <value>] [--api-key <value>] [--token <value>] [--client-id <value>] [--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 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 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](https://github.com/ably/cli/b