Skip to content

Commit e222ee6

Browse files
umair-ablyclaude
andcommitted
[DX-793] Migrate placeholder topic commands to BaseTopicCommand and add --json examples
Migrate 14 placeholder/index files from extending Command to BaseTopicCommand for consistency with other topic commands. Add missing --json examples to 5 leaf commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 24dfcfd commit e222ee6

33 files changed

Lines changed: 141 additions & 283 deletions

File tree

src/commands/apps/channel-rules/create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default class ChannelRulesCreateCommand extends ControlBaseCommand {
1111
'$ ably apps channel-rules create --name "chat" --persisted',
1212
'$ ably apps channel-rules create --name "events" --push-enabled',
1313
'$ ably apps channel-rules create --name "notifications" --persisted --push-enabled --app "My App"',
14+
'$ ably apps channel-rules create --name "chat" --persisted --json',
1415
];
1516

1617
static flags = {

src/commands/apps/channel-rules/update.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default class ChannelRulesUpdateCommand extends ControlBaseCommand {
1717
"$ ably apps channel-rules update chat --persisted",
1818
"$ ably apps channel-rules update events --push-enabled=false",
1919
'$ ably apps channel-rules update notifications --persisted --push-enabled --app "My App"',
20+
"$ ably apps channel-rules update chat --persisted --json",
2021
];
2122

2223
static flags = {

src/commands/apps/create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class AppsCreateCommand extends ControlBaseCommand {
1414
static examples = [
1515
'$ ably apps create --name "My New App"',
1616
'$ ably apps create --name "My New App" --tls-only',
17+
'$ ably apps create --name "My New App" --json',
1718
'$ ABLY_ACCESS_TOKEN="YOUR_ACCESS_TOKEN" ably apps create --name "My New App"',
1819
];
1920

src/commands/apps/set-apns-p12.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class AppsSetApnsP12Command extends ControlBaseCommand {
2525
"$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12",
2626
'$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12 --password "YOUR_CERTIFICATE_PASSWORD"',
2727
"$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12 --use-for-sandbox",
28+
"$ ably apps set-apns-p12 app-id --certificate /path/to/certificate.p12 --json",
2829
];
2930

3031
static flags = {

src/commands/apps/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class AppsUpdateCommand extends ControlBaseCommand {
2020
static examples = [
2121
'$ ably apps update app-id --name "Updated App Name"',
2222
"$ ably apps update app-id --tls-only",
23-
'$ ably apps update app-id --name "Updated App Name" --tls-only',
23+
'$ ably apps update app-id --name "Updated App Name" --json',
2424
'$ ABLY_ACCESS_TOKEN="YOUR_ACCESS_TOKEN" ably apps update app-id --name "Updated App Name"',
2525
];
2626

src/commands/auth/keys/update.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default class KeysUpdateCommand extends ControlBaseCommand {
1818
'$ ably auth keys update APP_ID.KEY_ID --name "New Name"',
1919
'$ ably auth keys update KEY_ID --app APP_ID --capabilities "publish,subscribe"',
2020
'$ ably auth keys update APP_ID.KEY_ID --name "New Name" --capabilities "publish,subscribe"',
21+
'$ ably auth keys update APP_ID.KEY_ID --name "New Name" --json',
2122
];
2223

2324
static flags = {

src/commands/bench/publisher.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default class BenchPublisher extends AblyBaseCommand {
6666
"$ ably bench publisher my-channel",
6767
"$ ably bench publisher --messages 5000 --rate 10 my-channel",
6868
"$ ably bench publisher --transport realtime my-channel",
69+
"$ ably bench publisher my-channel --json",
6970
];
7071

7172
static override flags = {

src/commands/bench/subscriber.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export default class BenchSubscriber extends AblyBaseCommand {
3333

3434
static override description = "Run a subscriber benchmark test";
3535

36-
static override examples = ["$ ably bench subscriber my-channel"];
36+
static override examples = [
37+
"$ ably bench subscriber my-channel",
38+
"$ ably bench subscriber my-channel --json",
39+
];
3740

3841
static override flags = {
3942
...productApiFlags,

src/commands/config/index.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
import { AblyBaseCommand } from "../../base-command.js";
2-
import { coreGlobalFlags } from "../../flags.js";
1+
import { BaseTopicCommand } from "../../base-topic-command.js";
2+
3+
export default class ConfigIndex extends BaseTopicCommand {
4+
protected topicName = "config";
5+
protected commandGroup = "Configuration";
36

4-
export default class ConfigIndex extends AblyBaseCommand {
57
static override description = "Manage Ably CLI configuration";
68

79
static override examples = [
8-
"<%= config.bin %> config path",
9-
"<%= config.bin %> config show",
10+
"<%= config.bin %> <%= command.id %> path",
11+
"<%= config.bin %> <%= command.id %> show",
1012
];
11-
12-
static override flags = {
13-
...coreGlobalFlags,
14-
};
15-
16-
async run(): Promise<void> {
17-
await this.config.runCommand("help", ["config"]);
18-
}
1913
}

src/commands/connections/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default class ConnectionsTest extends AblyBaseCommand {
1717
"$ ably connections test",
1818
"$ ably connections test --transport ws",
1919
"$ ably connections test --transport xhr",
20+
"$ ably connections test --json",
2021
];
2122

2223
static override flags = {

0 commit comments

Comments
 (0)