From 2c338ea538eb0483a526d2d682cffabce3404d25 Mon Sep 17 00:00:00 2001 From: Apoorv Taneja Date: Wed, 11 Dec 2024 14:54:52 +0530 Subject: [PATCH] fix: Apps CLI parity (#980) --- js/src/cli/apps.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/src/cli/apps.ts b/js/src/cli/apps.ts index 2c3fe1f7deb..ad0aa10cbd1 100644 --- a/js/src/cli/apps.ts +++ b/js/src/cli/apps.ts @@ -19,7 +19,9 @@ export default class AppsCommand { constructor(program: Command) { this.program = program; - const command = this.program.command("apps"); + const command = this.program + .command("apps") + .option("--enabled", "Only show enabled apps"); command .description("List all apps you have access to") @@ -28,13 +30,20 @@ export default class AppsCommand { new AppUpdateCommand(command); } - private async handleAction(options: { browser: boolean }): Promise { + private async handleAction(options: { + browser: boolean; + enabled: boolean; + }): Promise { getOpenAPIClient(); + const onlyShowEnabledApps = options.enabled; try { const { data } = await client.apps.getApps({}); console.log("Here are the apps you have access to:"); for (const app of data?.items || []) { + if (onlyShowEnabledApps && !app.enabled) { + continue; + } console.log(app.key); } } catch (error) {