11import { Args , Flags } from "@oclif/core" ;
22import chalk from "chalk" ;
3- import { StatsDisplay } from "../../../services/stats-display.js" ;
4- import { ControlBaseCommand } from "../../../control-base-command.js" ;
5- import type { BaseFlags } from "../../../types/cli.js" ;
6- import type { ControlApi } from "../../../services/control-api.js" ;
73
8- export default class AppsStatsCommand extends ControlBaseCommand {
4+ import { ControlBaseCommand } from "../../control-base-command.js" ;
5+ import { StatsDisplay } from "../../services/stats-display.js" ;
6+ import type { BaseFlags } from "../../types/cli.js" ;
7+ import type { ControlApi } from "../../services/control-api.js" ;
8+
9+ export default class StatsAppCommand extends ControlBaseCommand {
910 static args = {
1011 id : Args . string ( {
1112 description : "App ID to get stats for (uses default app if not provided)" ,
@@ -16,17 +17,17 @@ export default class AppsStatsCommand extends ControlBaseCommand {
1617 static description = "Get app stats with optional live updates" ;
1718
1819 static examples = [
19- "$ ably apps stats" ,
20- "$ ably apps stats app-id" ,
21- "$ ably apps stats --unit hour" ,
22- "$ ably apps stats app-id --unit hour" ,
23- "$ ably apps stats app-id --start 1618005600000 --end 1618091999999" ,
24- "$ ably apps stats app-id --limit 10" ,
25- "$ ably apps stats app-id --json" ,
26- "$ ably apps stats app-id --pretty-json" ,
27- "$ ably apps stats --live" ,
28- "$ ably apps stats app-id --live" ,
29- "$ ably apps stats --live --interval 15" ,
20+ "$ ably stats app " ,
21+ "$ ably stats app app-id" ,
22+ "$ ably stats app --unit hour" ,
23+ "$ ably stats app app-id --unit hour" ,
24+ "$ ably stats app app-id --start 1618005600000 --end 1618091999999" ,
25+ "$ ably stats app app-id --limit 10" ,
26+ "$ ably stats app app-id --json" ,
27+ "$ ably stats app app-id --pretty-json" ,
28+ "$ ably stats app --live" ,
29+ "$ ably stats app app-id --live" ,
30+ "$ ably stats app --live --interval 15" ,
3031 ] ;
3132
3233 static flags = {
@@ -66,7 +67,7 @@ export default class AppsStatsCommand extends ControlBaseCommand {
6667 private statsDisplay : StatsDisplay | null = null ; // Track when we're already fetching stats
6768
6869 async run ( ) : Promise < void > {
69- const { args, flags } = await this . parse ( AppsStatsCommand ) ;
70+ const { args, flags } = await this . parse ( StatsAppCommand ) ;
7071
7172 // Use provided app ID or fall back to default app ID
7273 const appId = args . id || this . configManager . getCurrentAppId ( ) ;
0 commit comments