Skip to content

Commit

Permalink
fix: Apps CLI parity (#980)
Browse files Browse the repository at this point in the history
  • Loading branch information
plxity authored Dec 11, 2024
1 parent d7b9502 commit 2c338ea
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions js/src/cli/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -28,13 +30,20 @@ export default class AppsCommand {
new AppUpdateCommand(command);
}

private async handleAction(options: { browser: boolean }): Promise<void> {
private async handleAction(options: {
browser: boolean;
enabled: boolean;
}): Promise<void> {
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) {
Expand Down

0 comments on commit 2c338ea

Please sign in to comment.