Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
run-migration.ts1.15 kB
import { getNxWorkspacePath } from '@nx-console/vscode-configuration'; import type { MigrationDetailsWithId } from 'nx/src/config/misc-interfaces'; import { commands, ProgressLocation, window } from 'vscode'; import { importMigrateUIApi } from './utils'; export async function runSingleMigration( migration: MigrationDetailsWithId, configuration: { createCommits: boolean }, ) { const workspacePath = getNxWorkspacePath(); await window.withProgress( { location: ProgressLocation.Notification, title: `Running ${migration.name}`, }, async () => { const migrateUiApi = await importMigrateUIApi(workspacePath); await migrateUiApi.runSingleMigration( workspacePath, migration, configuration, ); // Refresh after migration completes and writes to migrations.json commands.executeCommand('nxMigrate.refreshWebview'); }, ); } export async function runManyMigrations( migrations: MigrationDetailsWithId[], configuration: { createCommits: boolean }, ) { for (const migration of migrations) { await runSingleMigration(migration, configuration); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwl/nx-console'

If you have feedback or need assistance with the MCP directory API, please join our Discord server