UNPKG

@ably/cli

Version:

Ably CLI for Pub/Sub, Chat and Spaces

1,154 lines (879 loc) 212 kB
# Ably CLI and MCP server [![npm version](https://badge.fury.io/js/@ably%2Fcli.svg)](https://badge.fury.io/js/@ably%2Fcli) [Ably](https://ably.com) CLI and MCP server for [Ably Pub/Sub](https://ably.com/pubsub), [Ably Spaces](https://ably.com/spaces), [Ably Chat](https://ably.com/chat) and the [Ably Control API](https://ably.com/docs/account/control-api). > [!NOTE] > This project is in beta and this CLI and MCP server project is being actively developed. > Please [raise an issue](https://github.com/ably/ably-cli/issues) if you have feedback, feature requests or want to report a bug. We welcome [pull requests too](https://github.com/ably/ably-cli/pulls). ![Ably CLI screenshot](assets/cli-screenshot.png) <!-- toc --> * [Ably CLI and MCP server](#ably-cli-and-mcp-server) * [CLI Usage](#cli-usage) * [MCP Usage](#mcp-usage) * [Commands](#commands) * [MCP Server](#mcp-server) * [Contributing](#contributing) * [or](#or) <!-- tocstop --> # CLI Usage <!-- usage --> ```sh-session $ npm install -g @ably/cli $ ably COMMAND running command... $ ably (--version) @ably/cli/0.15.0 darwin-arm64 node-v22.14.0 $ ably --help [COMMAND] USAGE $ ably COMMAND ... ``` <!-- usagestop --> ```sh-session LOGIN (recommended first step) $ ably login ``` ## Auto-completion The Ably CLI supports shell auto-completion for bash, zsh, and PowerShell. This helps you discover and use commands more efficiently. To set up auto-completion: ```sh-session $ ably autocomplete ``` This will display installation instructions specific to your shell. Follow them to enable tab completion for commands, subcommands, and flags. For more details, see the [Auto-completion documentation](docs/Auto-completion.md). ## Interactive Mode The Ably CLI includes an interactive shell mode that provides a more convenient way to work with multiple commands: ```sh-session $ ably-interactive ``` ### Features - **Command history**: Previous commands are saved and can be accessed with up/down arrows - **Tab completion**: Full support for command and flag completion - **Ctrl+C handling**: - Single Ctrl+C interrupts the current command and returns to prompt - Double Ctrl+C (within 500ms) force quits the shell - **No "ably" prefix needed**: Commands can be typed directly (e.g., just `channels list` instead of `ably channels list`) # MCP Usage > [!WARNING] > The MCP server is currently experimental. Please [raise an issue](https://github.com/ably/ably-cli/issues) if you have feedback or suggestions for features. 1. Install the CLI following the [CLI usage](#cli-usage) steps. 2. Follow the instructions for your tool to set up an MCP server, such as [Claude desktop](https://modelcontextprotocol.io/quickstart/user), and configure: 1. `command` as ably mcp start-server See [MCP Server section](#mcp-server) for more details on how to use the MCP Server. > [!NOTE] > If you are having trouble getting the MCP server running, use [MCP inspector](https://github.com/modelcontextprotocol/inspector) # Commands <!-- commands --> * [`ably accounts`](#ably-accounts) * [`ably accounts current`](#ably-accounts-current) * [`ably accounts list`](#ably-accounts-list) * [`ably accounts login [TOKEN]`](#ably-accounts-login-token) * [`ably accounts logout [ALIAS]`](#ably-accounts-logout-alias) * [`ably accounts stats`](#ably-accounts-stats) * [`ably accounts switch [ALIAS]`](#ably-accounts-switch-alias) * [`ably apps`](#ably-apps) * [`ably apps channel-rules`](#ably-apps-channel-rules) * [`ably apps channel-rules create`](#ably-apps-channel-rules-create) * [`ably apps channel-rules delete NAMEORID`](#ably-apps-channel-rules-delete-nameorid) * [`ably apps channel-rules list`](#ably-apps-channel-rules-list) * [`ably apps channel-rules update NAMEORID`](#ably-apps-channel-rules-update-nameorid) * [`ably apps create`](#ably-apps-create) * [`ably apps current`](#ably-apps-current) * [`ably apps delete [ID]`](#ably-apps-delete-id) * [`ably apps list`](#ably-apps-list) * [`ably apps logs`](#ably-apps-logs) * [`ably apps logs history`](#ably-apps-logs-history) * [`ably apps logs subscribe`](#ably-apps-logs-subscribe) * [`ably apps set-apns-p12 ID`](#ably-apps-set-apns-p12-id) * [`ably apps stats [ID]`](#ably-apps-stats-id) * [`ably apps switch [APPID]`](#ably-apps-switch-appid) * [`ably apps update ID`](#ably-apps-update-id) * [`ably auth`](#ably-auth) * [`ably auth issue-ably-token`](#ably-auth-issue-ably-token) * [`ably auth issue-jwt-token`](#ably-auth-issue-jwt-token) * [`ably auth keys`](#ably-auth-keys) * [`ably auth keys create`](#ably-auth-keys-create) * [`ably auth keys current`](#ably-auth-keys-current) * [`ably auth keys get KEYNAMEORVALUE`](#ably-auth-keys-get-keynameorvalue) * [`ably auth keys list`](#ably-auth-keys-list) * [`ably auth keys revoke KEYNAME`](#ably-auth-keys-revoke-keyname) * [`ably auth keys switch [KEYNAMEORVALUE]`](#ably-auth-keys-switch-keynameorvalue) * [`ably auth keys update KEYNAME`](#ably-auth-keys-update-keyname) * [`ably auth revoke-token TOKEN`](#ably-auth-revoke-token-token) * [`ably autocomplete [SHELL]`](#ably-autocomplete-shell) * [`ably bench`](#ably-bench) * [`ably bench publisher CHANNEL`](#ably-bench-publisher-channel) * [`ably bench subscriber CHANNEL`](#ably-bench-subscriber-channel) * [`ably channels`](#ably-channels) * [`ably channels batch-publish [MESSAGE]`](#ably-channels-batch-publish-message) * [`ably channels history CHANNEL`](#ably-channels-history-channel) * [`ably channels list`](#ably-channels-list) * [`ably channels logs [TOPIC]`](#ably-channels-logs-topic) * [`ably channels occupancy`](#ably-channels-occupancy) * [`ably channels occupancy get CHANNEL`](#ably-channels-occupancy-get-channel) * [`ably channels occupancy subscribe CHANNEL`](#ably-channels-occupancy-subscribe-channel) * [`ably channels presence`](#ably-channels-presence) * [`ably channels presence enter CHANNEL`](#ably-channels-presence-enter-channel) * [`ably channels presence subscribe CHANNEL`](#ably-channels-presence-subscribe-channel) * [`ably channels publish CHANNEL MESSAGE`](#ably-channels-publish-channel-message) * [`ably channels subscribe CHANNELS`](#ably-channels-subscribe-channels) * [`ably config`](#ably-config) * [`ably connections`](#ably-connections) * [`ably connections logs [TOPIC]`](#ably-connections-logs-topic) * [`ably connections stats`](#ably-connections-stats) * [`ably connections test`](#ably-connections-test) * [`ably help [COMMANDS]`](#ably-help-commands) * [`ably integrations`](#ably-integrations) * [`ably integrations create`](#ably-integrations-create) * [`ably integrations delete RULEID`](#ably-integrations-delete-ruleid) * [`ably integrations get RULEID`](#ably-integrations-get-ruleid) * [`ably integrations list`](#ably-integrations-list) * [`ably integrations update RULEID`](#ably-integrations-update-ruleid) * [`ably login [TOKEN]`](#ably-login-token) * [`ably logs`](#ably-logs) * [`ably logs app`](#ably-logs-app) * [`ably logs app history`](#ably-logs-app-history) * [`ably logs app subscribe`](#ably-logs-app-subscribe) * [`ably logs channel-lifecycle`](#ably-logs-channel-lifecycle) * [`ably logs channel-lifecycle subscribe`](#ably-logs-channel-lifecycle-subscribe) * [`ably logs connection-lifecycle`](#ably-logs-connection-lifecycle) * [`ably logs connection-lifecycle history`](#ably-logs-connection-lifecycle-history) * [`ably logs connection-lifecycle subscribe`](#ably-logs-connection-lifecycle-subscribe) * [`ably logs connection subscribe`](#ably-logs-connection-subscribe) * [`ably logs push`](#ably-logs-push) * [`ably logs push history`](#ably-logs-push-history) * [`ably logs push subscribe`](#ably-logs-push-subscribe) * [`ably mcp`](#ably-mcp) * [`ably mcp start-server`](#ably-mcp-start-server) * [`ably queues`](#ably-queues) * [`ably queues create`](#ably-queues-create) * [`ably queues delete QUEUENAME`](#ably-queues-delete-queuename) * [`ably queues list`](#ably-queues-list) * [`ably rooms`](#ably-rooms) * [`ably rooms list`](#ably-rooms-list) * [`ably rooms messages`](#ably-rooms-messages) * [`ably rooms messages history ROOM`](#ably-rooms-messages-history-room) * [`ably rooms messages reactions`](#ably-rooms-messages-reactions) * [`ably rooms messages reactions remove ROOM MESSAGESERIAL REACTION`](#ably-rooms-messages-reactions-remove-room-messageserial-reaction) * [`ably rooms messages reactions send ROOM MESSAGESERIAL REACTION`](#ably-rooms-messages-reactions-send-room-messageserial-reaction) * [`ably rooms messages reactions subscribe ROOM`](#ably-rooms-messages-reactions-subscribe-room) * [`ably rooms messages send ROOM TEXT`](#ably-rooms-messages-send-room-text) * [`ably rooms messages subscribe ROOM`](#ably-rooms-messages-subscribe-room) * [`ably rooms occupancy`](#ably-rooms-occupancy) * [`ably rooms occupancy get ROOM`](#ably-rooms-occupancy-get-room) * [`ably rooms occupancy subscribe ROOM`](#ably-rooms-occupancy-subscribe-room) * [`ably rooms presence`](#ably-rooms-presence) * [`ably rooms presence enter ROOM`](#ably-rooms-presence-enter-room) * [`ably rooms presence subscribe ROOM`](#ably-rooms-presence-subscribe-room) * [`ably rooms reactions`](#ably-rooms-reactions) * [`ably rooms reactions send ROOM EMOJI`](#ably-rooms-reactions-send-room-emoji) * [`ably rooms reactions subscribe ROOM`](#ably-rooms-reactions-subscribe-room) * [`ably rooms typing`](#ably-rooms-typing) * [`ably rooms typing keystroke ROOM`](#ably-rooms-typing-keystroke-room) * [`ably rooms typing subscribe ROOM`](#ably-rooms-typing-subscribe-room) * [`ably spaces`](#ably-spaces) * [`ably spaces cursors`](#ably-spaces-cursors) * [`ably spaces cursors get-all SPACE`](#ably-spaces-cursors-get-all-space) * [`ably spaces cursors set SPACE`](#ably-spaces-cursors-set-space) * [`ably spaces cursors subscribe SPACE`](#ably-spaces-cursors-subscribe-space) * [`ably spaces list`](#ably-spaces-list) * [`ably spaces locations`](#ably-spaces-locations) * [`ably spaces locations get-all SPACE`](#ably-spaces-locations-get-all-space) * [`ably spaces locations set SPACE`](#ably-spaces-locations-set-space) * [`ably spaces locations subscribe SPACE`](#ably-spaces-locations-subscribe-space) * [`ably spaces locks`](#ably-spaces-locks) * [`ably spaces locks acquire SPACE LOCKID`](#ably-spaces-locks-acquire-space-lockid) * [`ably spaces locks get SPACE LOCKID`](#ably-spaces-locks-get-space-lockid) * [`ably spaces locks get-all SPACE`](#ably-spaces-locks-get-all-space) * [`ably spaces locks subscribe SPACE`](#ably-spaces-locks-subscribe-space) * [`ably spaces members`](#ably-spaces-members) * [`ably spaces members enter SPACE`](#ably-spaces-members-enter-space) * [`ably spaces members subscribe SPACE`](#ably-spaces-members-subscribe-space) * [`ably status`](#ably-status) * [`ably support`](#ably-support) * [`ably support ask QUESTION`](#ably-support-ask-question) * [`ably support contact`](#ably-support-contact) ## `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 COMMANDS ably accounts current Show the current Ably account ably accounts list List locally configured Ably accounts ably accounts login Log in to your Ably account ably accounts logout Log out from an Ably account ably accounts stats Get account stats with optional live updates ably accounts switch Switch to a different Ably account ``` _See code: [src/commands/accounts/index.ts](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --debug Show debug information for live stats polling --end=<value> End time in milliseconds since epoch --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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 COMMANDS ably apps channel-rules Manage Ably channel rules (namespaces) ably apps create Create a new app ably apps current Show the currently selected app ably apps delete Delete an app ably apps list List all apps in the current account ably apps logs Stream or retrieve app logs ably apps set-apns-p12 Upload Apple Push Notification Service P12 certificate for an app ably apps stats Get app stats with optional live updates ably apps switch Switch to a different Ably app ably apps update Update an app ``` _See code: [src/commands/apps/index.ts](https://github.com/ably/ably-cli/blob/v0.15.0/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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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 --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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 --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <value>] [--host <value>] [--json | --pretty-json] [--token <value>] [-v] [-f] [--app <value>] 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 --app=<value> App ID to delete (overrides argument and current app) --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. --endpoint=<value> Override the endpoint for all product API calls --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 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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --direction=<option> [default: backwards] Direction of message retrieval <options: backwards|forwards> --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --debug Show debug information for live stats polling --end=<value> End time in milliseconds since epoch --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<value> Override the endpoint for all product API calls --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](https://github.com/ably/ably-cli/blob/v0.15.0/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>] [--env <value>] [--endpoint <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. --endpoint=<