pulumi-cli-up
Execute pulumi up for a specific project and stack to deploy infrastructure updates. Define the working directory and stack name for targeted deployment.
Instructions
Run pulumi up for a given project and stack
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stackName | No | The associated stack name. Defaults to 'dev'. | |
| workDir | Yes | The working directory of the program. |
Implementation Reference
- src/pulumi/cli.ts:66-102 (handler)Executes the pulumi up command using Pulumi's automation API: creates or selects a stack, runs stack.up(), summarizes resource changes, and returns formatted results.handler: async (args: UpArgs) => { const stackArgs: automation.LocalProgramArgs = { stackName: args.stackName ?? 'dev', workDir: args.workDir }; const stack = await automation.LocalWorkspace.createOrSelectStack(stackArgs); // Run up const upResult = await stack.up(); // Format the changes const changes = upResult.summary.resourceChanges!; const changesSummary = [ `Create: ${changes.create}`, `Update: ${changes.update}`, `Delete: ${changes.delete}`, `Same: ${changes.same}` ].join('\n'); return { description: 'Pulumi Up Results', content: [ { type: 'text' as const, text: ` Deployment Results for stack: ${stack.name} Changes: ${changesSummary} ${upResult.stdout || 'No additional output'} ` } ] }; }
- src/pulumi/cli.ts:62-65 (schema)Zod schema defining inputs for the tool: workDir (required string), stackName (optional string, defaults to 'dev').schema: { workDir: z.string().describe('The working directory of the program.'), stackName: z.string().optional().describe("The associated stack name. Defaults to 'dev'.") },
- src/server/server.ts:70-79 (registration)Registers the 'pulumi-cli-up' tool (and other CLI commands) by iterating over exported cliCommands from src/pulumi/cli.ts, constructing toolName as 'pulumi-cli-${commandName}' where commandName='up', and wrapping the handler with error handling.const toolName = `pulumi-cli-${commandName}`; // eslint-disable-next-line @typescript-eslint/no-explicit-any this.tool(toolName, command.description, command.schema, async (args: any) => { try { return await command.handler(args); } catch (error) { return handleError(error, toolName); } }); });