sf-decomposer

Decomposes large Salesforce metadata XML files into smaller, version-control–friendly files (XML, JSON, YAML, JSON5), and recomposes them back into deployment-ready metadata.
- Using the Salesforce CLI? Start at Setup.
- Running this in GitHub CI without the CLI? Skip straight to GitHub Action.
- No Salesforce CLI at all? Use the standalone command from
sf-decomposer-core.
- Using Claude Code, GitHub Copilot, or another AI coding agent? Install the agent skills.
Table of Contents
Setup
Complete these steps once per project. After setup, see Daily Workflow.
1. Requirements
- Salesforce CLI (
sf) installed
- Node.js 22.19 or later
- A Salesforce DX project with
sfdx-project.json and package directories
Supported Platforms
sf-decomposer depends on config-disassembler-node, which ships prebuilt native binaries as platform-specific optional npm packages — your package manager installs only the one matching your os / cpu / libc:
| Platform | Architectures |
|---|
| macOS | x64 (Intel), arm64 (Apple Silicon) |
| Linux | x64 (gnu + musl), arm64 (gnu + musl) |
| Windows | x64, arm64 |
If your platform or architecture is not listed, open an issue.
2. Install the Plugin
sf plugins install [email protected]
3. Configure .forceignore
Required. The Salesforce CLI must ignore decomposed files or sf commands will fail. Configure this before running any decompose or retrieve commands.
Option A — Automatic (recommended): Pass --update-forceignore on your first sf decomposer decompose run. The plugin appends type-level wildcard patterns to .forceignore — one ignore pattern for decomposed pieces and one negation to re-allow the original metadata file — creating the file if it doesn't exist. Subsequent runs only add new entries; existing ones are never duplicated.
sf decomposer decompose -m "flow" -m "permissionset" --postpurge --update-forceignore
Option B — Manual: Copy the sample .forceignore into your project root and adjust the extension patterns for your chosen format (.xml, .json, .yaml, etc.).
4. Configure Hooks (Recommended)