package-usage

Track which stacks across a Pulumi organization use a specific package and at what versions. Use for cross-stack audits, identifying outdated or unmaintained…

npx skills add https://github.com/pulumi/agent-skills --skill package-usage

API Reference

Query the Pulumi Cloud API with the pulumi api CLI subcommand. It authenticates with your existing Pulumi credentials and returns JSON.

Get the latest version of a package

pulumi api /api/registry/packages -F name={package_name} -F orgLogin={orgName}

Include orgLogin with the user's organization name. Omit -F name=... to list all packages visible to the organization (useful when the user has not named a specific package). The response contains a packages array. Each entry has a version field (the latest version), plus name, publisher, source, and packageStatus.

Get stack usage for a package

pulumi api /api/orgs/{orgName}/packages/usage -F packageName={package_name}

Replace {orgName} with the org name from context, PULUMI_ORG, or ask the user. packageName is required; query one package at a time.

Response fields:

  • packageName: The queried package
  • stacks: Array of {stackName, projectName, version, lastUpdate}
  • totalStacks: Total count

Workflow: Find outdated stacks

Use when the user wants to know which stacks are using an outdated version of a package.

  1. Get the latest version of the package
  2. Get stack usage for the package
  3. Compare each stack's version against the latest to identify outdated stacks
  4. Present results using the output format below

Output Format

Present results as a markdown table followed by a summary line:

| Project | Stack | Current Version | Latest Version | Status |
|---------|-------|-----------------|----------------|--------|
| my-app  | dev   | 6.40.0          | 6.52.0         | Outdated |
| my-app  | prod  | 6.52.0          | 6.52.0         | Up-to-date |

2 of 2 stacks checked. 1 outdated.

Out of scope: upgrading a specific stack

This skill identifies outdated stacks. It does not perform the upgrade itself. For actually bumping a package version in a project — editing package.json, requirements.txt, pyproject.toml, go.mod, or Pulumi.yaml, running pulumi preview, and reconciling the diff — hand off to the provider-upgrade skill.

More skills from pulumi

pulumi-debug-failed-operation
pulumi
Debug a Pulumi update or preview that failed: read the failure Pulumi already recorded, find what caused it, and fix it. Load this skill when the user asks to…
provider-upgrade
pulumi
A provider upgrade is a translation, not a change request.
cloudformation-to-pulumi
pulumi
Convert, migrate, or import AWS CloudFormation stacks or templates into Pulumi programs. Load this skill whenever a user wants to move from CloudFormation to…
pulumi-arm-to-pulumi
pulumi
Convert ARM templates, Bicep, or existing Azure resources to Pulumi infrastructure code. Handles complete ARM template conversion to Pulumi (TypeScript, Python, Go, C#, Java, or YAML) with support for parameters, variables, loops, conditionals, and nested templates Supports both azure-native (full API coverage) and azure (classic, simplified) providers; automatically selects the right provider for each resource Imports existing deployed Azure resources into Pulumi with zero-diff validation...
pulumi-cdk-to-pulumi
pulumi
Load this skill when a user wants to migrate, convert, port, translate, or move an AWS CDK application (including CDK stacks, constructs, or…
pulumi-migrate-from-discovered-stack
pulumi
Migrate a CloudFormation or ARM stack into a Pulumi stack, sourced from a stack that Pulumi Cloud's Discovery feature has already found and exposed via the…
pulumi-automation-api
pulumi
Programmatic orchestration of Pulumi infrastructure operations across multiple stacks and applications. Supports both local source (existing Pulumi projects) and inline source (embedded programs) architectures, enabling flexible deployment patterns from simple to complex multi-stack scenarios Handles multi-stack orchestration with dependency sequencing, parallel independent deployments, and cross-stack output passing for coordinated infrastructure provisioning Provides programmatic...
pulumi-best-practices
pulumi
Comprehensive best practices for writing reliable, maintainable Pulumi infrastructure code. Avoid creating resources inside apply() callbacks; pass Output objects directly as inputs to preserve dependency tracking and preview visibility Use ComponentResource classes to group related resources into reusable logical units with proper parent-child hierarchy via parent: this Encrypt secrets from the start with --secret flag or config.requireSecret() to prevent credential leakage in state files...