diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index 616f59cbac..5cbc0fe191 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -690,6 +690,25 @@ export function devTool ( await changeConfiguration(getWorkspaceId(workspace, productId), transactorUrl, cmd) }) + program + .command('configure-all') + .description('configure all spaces') + .option('--enable ', 'Enable plugin configuration', '') + .option('--disable ', 'Disable plugin configuration', '') + .option('--list', 'List plugin states', false) + .action(async (cmd: { enable: string, disable: string, list: boolean }) => { + const { mongodbUri } = prepareTools() + await withDatabase(mongodbUri, async (db) => { + console.log('configure all workspaces') + console.log(JSON.stringify(cmd)) + const workspaces = await listWorkspacesRaw(db, productId) + for (const ws of workspaces) { + console.log('configure', ws.workspaceName ?? ws.workspace) + await changeConfiguration(getWorkspaceId(ws.workspaceUrl ?? ws.workspace, productId), transactorUrl, cmd) + } + }) + }) + program .command('optimize-model ') .description('optimize model')