Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/ably-codebase-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ Launch these agents **in parallel**. Each agent gets a focused mandate and uses
- Subscribe/stream commands must have `durationFlag`
- Subscribe commands with replay must have `rewindFlag`
- History/stats commands must have `timeRangeFlags`
- Commands creating realtime connections must have `clientIdFlag`
- Commands creating realtime connections or performing mutations (publish, update, delete, append) must have `clientIdFlag`
- Control API commands must use `ControlBaseCommand.globalFlags`

**Method (LSP — for ambiguous cases):**
3. Use `LSP goToDefinition` on flag spread references to confirm they resolve to `src/flags.ts` (not a local redefinition)

**Reasoning guidance:**
- A command that creates a realtime client but doesn't have `clientIdFlag` is a deviation
- A command that creates a realtime client or performs a mutation (publish, update, delete, append) but doesn't have `clientIdFlag` is a deviation
- A non-subscribe command having `durationFlag` is suspicious but might be valid (e.g., presence enter)
- Control API commands should NOT have `productApiFlags`

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ably-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ For each changed command file, run the relevant checks. Spawn agents for paralle
**Flag architecture check (grep, with LSP for ambiguous cases):**
1. **Grep** for flag spreads (`productApiFlags`, `clientIdFlag`, `durationFlag`, `rewindFlag`, `timeRangeFlags`, `ControlBaseCommand.globalFlags`)
2. Verify correct flag sets per the skill rules
3. Check subscribe commands have `durationFlag`, `rewindFlag`, `clientIdFlag` as appropriate
3. Check subscribe commands have `durationFlag`, `rewindFlag`, `clientIdFlag` as appropriate; mutation commands (publish, update, delete, append) should also have `clientIdFlag`
4. For ambiguous cases, use **LSP** `goToDefinition` to confirm flag imports resolve to `src/flags.ts`

**JSON output check (grep/read):**
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Flags are NOT global. Each command explicitly declares only the flags it needs v
- **`coreGlobalFlags`** — `--verbose`, `--json`, `--pretty-json`, `--web-cli-help` (hidden) (on every command via `AblyBaseCommand.globalFlags`)
- **`productApiFlags`** — core + hidden product API flags (`port`, `tlsPort`, `tls`). Use for commands that talk to the Ably product API.
- **`controlApiFlags`** — core + hidden control API flags (`control-host`, `dashboard-host`). Use for commands that talk to the Control API.
- **`clientIdFlag`** — `--client-id`. Add to any command that creates a realtime connection (publish, subscribe, presence enter/subscribe, spaces enter/get/subscribe, locks acquire/get/subscribe, cursors set/get/subscribe, locations set/get/subscribe, etc.). The rule: if the command calls `space.enter()`, creates a realtime client, or joins a channel, include `clientIdFlag`. Do NOT add globally.
- **`clientIdFlag`** — `--client-id`. Add to any command where the user might want to control which client identity performs the operation. This includes: commands that create a realtime connection (subscribe, presence enter/subscribe, spaces, etc.), publish, and REST mutations where permissions may depend on the client (update, delete, append). Do NOT add globally.
- **`durationFlag`** — `--duration` / `-D`. Use for long-running subscribe/stream commands that auto-exit after N seconds.
- **`rewindFlag`** — `--rewind`. Use for subscribe commands that support message replay (default: 0).
- **`timeRangeFlags`** — `--start`, `--end`. Use for history and stats commands. Parse with `parseTimestamp()` from `src/utils/time.ts`. Accepts ISO 8601, Unix ms, or relative (e.g., `"1h"`, `"30m"`, `"2d"`).
Expand Down
127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ $ ably-interactive
* [`ably bench publisher CHANNEL`](#ably-bench-publisher-channel)
* [`ably bench subscriber CHANNEL`](#ably-bench-subscriber-channel)
* [`ably channels`](#ably-channels)
* [`ably channels append CHANNEL SERIAL MESSAGE`](#ably-channels-append-channel-serial-message)
* [`ably channels batch-publish [MESSAGE]`](#ably-channels-batch-publish-message)
* [`ably channels delete CHANNEL SERIAL`](#ably-channels-delete-channel-serial)
* [`ably channels history CHANNEL`](#ably-channels-history-channel)
* [`ably channels inspect CHANNEL`](#ably-channels-inspect-channel)
* [`ably channels list`](#ably-channels-list)
Expand All @@ -118,6 +120,7 @@ $ ably-interactive
* [`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 channels update CHANNEL SERIAL MESSAGE`](#ably-channels-update-channel-serial-message)
* [`ably config`](#ably-config)
* [`ably config path`](#ably-config-path)
* [`ably config show`](#ably-config-show)
Expand Down Expand Up @@ -1370,18 +1373,64 @@ EXAMPLES
$ ably channels list

COMMANDS
ably channels append Append data to a message on an Ably channel
ably channels batch-publish Publish messages to multiple Ably channels with a single request
ably channels delete Delete a message on an Ably channel
ably channels history Retrieve message history for a channel
ably channels inspect Open the Ably dashboard to inspect a specific channel
ably channels list List active channels using the channel enumeration API
ably channels occupancy Get occupancy metrics for a channel
ably channels presence Manage presence on Ably channels
ably channels publish Publish a message to an Ably channel
ably channels subscribe Subscribe to messages published on one or more Ably channels
ably channels update Update a message on an Ably channel
```

_See code: [src/commands/channels/index.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/index.ts)_

## `ably channels append CHANNEL SERIAL MESSAGE`

Append data to a message on an Ably channel

```
USAGE
$ ably channels append CHANNEL SERIAL MESSAGE [-v] [--json | --pretty-json] [--client-id <value>] [--description
<value>] [-e <value>] [-n <value>]

ARGUMENTS
CHANNEL The channel name
SERIAL The serial of the message to append to
MESSAGE The message to append (JSON format or plain text)

FLAGS
-e, --encoding=<value> The encoding for the message
-n, --name=<value> The event name
-v, --verbose Output verbose logs
--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.
--description=<value> Description of the append operation
--json Output in JSON format
--pretty-json Output in colorized JSON format

DESCRIPTION
Append data to a message on an Ably channel

EXAMPLES
$ ably channels append my-channel "01234567890:0" '{"data":"appended content"}'

$ ably channels append my-channel "01234567890:0" "Appended plain text"

$ ably channels append my-channel "01234567890:0" '{"data":"appended"}' --name event-name

$ ably channels append my-channel "01234567890:0" '{"data":"appended"}' --description "Added context"

$ ably channels append my-channel "01234567890:0" '{"data":"appended"}' --json

$ ably channels append my-channel "01234567890:0" '{"data":"appended"}' --pretty-json
```

_See code: [src/commands/channels/append.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/append.ts)_

## `ably channels batch-publish [MESSAGE]`

Publish messages to multiple Ably channels with a single request
Expand Down Expand Up @@ -1427,6 +1476,41 @@ EXAMPLES

_See code: [src/commands/channels/batch-publish.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/batch-publish.ts)_

## `ably channels delete CHANNEL SERIAL`

Delete a message on an Ably channel

```
USAGE
$ ably channels delete CHANNEL SERIAL [-v] [--json | --pretty-json] [--client-id <value>] [--description <value>]

ARGUMENTS
CHANNEL The channel name
SERIAL The serial of the message to delete

FLAGS
-v, --verbose Output verbose logs
--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.
--description=<value> Description of the delete operation
--json Output in JSON format
--pretty-json Output in colorized JSON format

DESCRIPTION
Delete a message on an Ably channel

EXAMPLES
$ ably channels delete my-channel "01234567890:0"

$ ably channels delete my-channel "01234567890:0" --description "Removed by admin"

$ ably channels delete my-channel "01234567890:0" --json

$ ably channels delete my-channel "01234567890:0" --pretty-json
```

_See code: [src/commands/channels/delete.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/delete.ts)_

## `ably channels history CHANNEL`

Retrieve message history for a channel
Expand Down Expand Up @@ -1824,6 +1908,49 @@ EXAMPLES

_See code: [src/commands/channels/subscribe.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/subscribe.ts)_

## `ably channels update CHANNEL SERIAL MESSAGE`

Update a message on an Ably channel

```
USAGE
$ ably channels update CHANNEL SERIAL MESSAGE [-v] [--json | --pretty-json] [--client-id <value>] [--description
<value>] [-e <value>] [-n <value>]

ARGUMENTS
CHANNEL The channel name
SERIAL The serial of the message to update
MESSAGE The updated message (JSON format or plain text)

FLAGS
-e, --encoding=<value> The encoding for the message
-n, --name=<value> The event name
-v, --verbose Output verbose logs
--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.
--description=<value> Description of the update operation
--json Output in JSON format
--pretty-json Output in colorized JSON format

DESCRIPTION
Update a message on an Ably channel

EXAMPLES
$ ably channels update my-channel "01234567890:0" '{"data":"updated content"}'

$ ably channels update my-channel "01234567890:0" "Updated plain text"

$ ably channels update my-channel "01234567890:0" '{"data":"updated"}' --name event-name

$ ably channels update my-channel "01234567890:0" '{"data":"updated"}' --description "Corrected typo"

$ ably channels update my-channel "01234567890:0" '{"data":"updated"}' --json

$ ably channels update my-channel "01234567890:0" '{"data":"updated"}' --pretty-json
```

_See code: [src/commands/channels/update.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/update.ts)_

## `ably config`

Manage Ably CLI configuration
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"@xterm/addon-fit": "^0.10.0",
"@xterm/addon-web-links": "^0.11.0",
"@xterm/xterm": "^5.5.0",
"ably": "^2.14.0",
"ably": "^2.19.0",
"chalk": "5",
"cli-table3": "^0.6.5",
"color-json": "^3.0.5",
Expand Down
Loading
Loading