npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jterrats/smart-deployment

v1.2.6

Published

Intelligent Salesforce metadata deployment plugin that automatically analyzes dependencies, generates optimal deployment

Readme

Smart Deployment

CI License Latest Release Node Version npm

Smart Deployment is a Salesforce CLI plugin that analyzes metadata, builds deployment waves, validates project state, and executes staged deployments with optional AI assistance.

The current codebase supports:

  • metadata scanning and dependency graph generation
  • wave generation with circular dependency detection
  • conservative circular dependency remediation for supported ApexClass cycles
  • real CLI flows for start, analyze, validate, status, resume, and config
  • AI-assisted dependency inference, priority weighting, and validation
  • multiple LLM providers through a shared provider abstraction

Current Status

This repository is in active development, but the command surface is now usable as a first working version.

What is working today:

  • sf smart-deployment analyze
  • sf smart-deployment start
  • sf smart-deployment validate
  • sf smart-deployment status
  • sf smart-deployment resume
  • sf smart-deployment config
  • sf smart-deployment ci-publish
  • JSON and HTML analysis reports
  • repo-level AI configuration via .smart-deployment.json

What is still partial:

  • full live deployment validation against real Salesforce orgs across all flows
  • broader automatic circular dependency remediation beyond simple supported cases
  • richer deployment resume/polling semantics against remote deployment backends
  • broader provider ecosystem beyond the currently implemented adapters

Installation

sf plugins install @jterrats/smart-deployment

For local development:

yarn install
yarn build
sf plugins link .

Quick Start

Analyze a project:

sf smart-deployment analyze --source-path force-app

Generate a saved plan and JSON report:

sf smart-deployment analyze \
  --source-path force-app \
  --use-ai \
  --save-plan \
  --output analysis.json \
  --format json

Run a dry deployment:

sf smart-deployment start \
  --source-path force-app \
  --dry-run

Run with AI and allow conservative cycle remediation:

sf smart-deployment start \
  --source-path force-app \
  --target-org myorg \
  --use-ai \
  --allow-cycle-remediation

Validate the local wave plan:

sf smart-deployment validate \
  --source-path force-app \
  --use-ai

When to use each:

  • use validate for local wave plan readiness and risk checks
  • use start --dry-run to rehearse the real deployment command flow without executing the deploy

Show persisted deployment state:

sf smart-deployment status --source-path force-app

Resume a failed deployment from local state:

sf smart-deployment resume \
  --source-path force-app \
  --retry-strategy standard

Configure the default AI provider for a repo:

sf smart-deployment config \
  --source-path . \
  --set-llm-provider openai \
  --set-llm-model gpt-4o-mini

Build a coordinated CI publish plan for metadata, Agentforce authoring bundles, LWR publish, and optional activation:

sf smart-deployment ci-publish \
  --source-path force-app \
  --target-org release \
  --since origin/main \
  --dry-run

When executing deploy phases, Smart Deployment respects .forceignore by building from a temporary sanitized Salesforce project. Ignored files stay in the working tree but are not visible to package generation or sf project deploy start. When --target-org is provided, the coordinated publish flow also passes the org through to Salesforce CLI commands and checks AI evaluation subjects against source metadata or the target org before deploy.

Commands

See:

AI Providers

The AI layer is no longer Agentforce-only.

Current provider model:

  • shared provider abstraction in src/ai/llm-provider.ts
  • provider factory in src/ai/llm-provider-factory.ts
  • concrete adapters currently implemented for:
    • agentforce
    • openai

AI is optional. When unavailable, supported flows fall back to deterministic heuristics where possible.

Repo Configuration

Repo-scoped configuration is stored in:

.smart-deployment.json

Example:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o-mini",
    "endpoint": "https://api.openai.com/v1/chat/completions",
    "timeout": 30000
  },
  "priorities": {
    "ApexClass:CriticalService": 100
  }
}

Deployment runtime state is stored separately under .smart-deployment/ and should not be committed.

Testing

Main commands:

yarn test
yarn test:compile
yarn test:only
yarn lint

The suite currently includes unit, integration-style, and NUT coverage for the main CLI flows.

Documentation Policy

The repository contains both active documentation and historical design/planning material.

  • active docs live in docs/
  • archived historical docs live in docs/archive/

If a document describes flags or workflows that do not exist in the current command layer, treat the archived version as historical only.