Use the ably channels command group to interact with Ably Pub/Sub channels. These commands enable you to publish and subscribe to messages, manage presence, monitor occupancy, and work with annotations.
Message publishing and subscribing
Use the following commands to publish and subscribe to messages on channels, retrieve message history, and perform message operations:
| Command | Description |
|---|---|
ably channels subscribe | Subscribe to messages on one or more channels. |
ably channels publish | Publish a message to a channel. |
ably channels batch-publish | Publish a message to multiple channels at once. |
ably channels history | Retrieve message history for a channel. |
ably channels append | Append data to a message on a channel. |
ably channels update | Update a message on a channel. |
ably channels delete | Delete a message on a channel. |
Message annotations
Use the following commands to manage annotations on channel messages. Annotations enable you to append metadata such as reactions, tags, moderation flags, and read receipts to existing messages:
| Command | Description |
|---|---|
ably channels annotations publish | Publish an annotation on a channel message. |
ably channels annotations subscribe | Subscribe to annotations on a channel. |
ably channels annotations get | Get annotations for a channel message. |
ably channels annotations delete | Delete an annotation from a channel message. |
Presence
Use the following commands to manage presence on channels. Presence enables clients to be aware of other members who are currently active on a channel:
| Command | Description |
|---|---|
ably channels presence enter | Enter presence member on a channel. |
ably channels presence get | Get current presence members on a channel. |
ably channels presence subscribe | Subscribe to presence member events on a channel. |
Channel occupancy
Use the following commands to monitor occupancy on channels. Occupancy provides high-level metrics about the number of clients attached to a channel without requiring presence:
| Command | Description |
|---|---|
ably channels occupancy get | Get current occupancy for a channel. |
ably channels occupancy subscribe | Subscribe to occupancy updates on a channel. |
Channels management
Use the following commands to list active channels and inspect channel details in the Ably dashboard:
| Command | Description |
|---|---|
ably channels list | List active channels. |
ably channels inspect | Open the Ably dashboard to inspect a channel. |
See also
- CLI reference — Full list of available commands.