UNPKG

@mondaycom/apps-cli

Version:

A cli tool to manage apps (and monday-code projects) in monday.com

24 lines (23 loc) 831 B
import { AuthenticatedCommand } from '../../commands-base/authenticated-command.js'; import { listApps } from '../../services/apps-service.js'; import logger from '../../utils/logger.js'; const printApps = (apps) => { const cleanedApps = apps.map(app => { return { id: app.id, name: app.name }; }); logger.table(cleanedApps); }; export default class AppList extends AuthenticatedCommand { static description = 'List all apps for a specific user.'; static withPrintCommand = false; static examples = ['<%= config.bin %> <%= command.id %>']; static flags = AppList.serializeFlags({}); async run() { const apps = await listApps(); if (apps.length === 0) { logger.error('No apps found'); return process.exit(0); } printApps(apps); } }