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

sfdxdatadicgen

v1.0.0

Published

Salesforce CLI plugin that generates a data dictionary from an org

Downloads

234

Readme

dataDicGen

Improve the governance of your Salesforce implementation with this Salesforce CLI plugin that generates a Data Dictionary from any authenticated org — in Excel, HTML, JSON, or Markdown — plus an interactive schema map you can filter to as few or as many objects as you want.

Version Appveyor CI Codecov Downloads/week License

Requirements

  • Node.js >= 18
  • The unified Salesforce CLI (sf). Legacy sfdx invocations still work via a deprecated alias.
  • An authenticated org (sf org login web) before running the command.

Installation

$ sf plugins install sfdxdatadicgen

Or from this repo:

$ sf plugins install https://github.com/marsson/dataDicGen

Usage

Default — Excel only:

$ sf data-dictionary generate --target-org [email protected]

Every format at once (the schema map is embedded inside <base>.html):

$ sf data-dictionary generate -o myOrg --format xlsx,html,json,md

HTML report only, with a custom output base:

$ sf data-dictionary generate -o myOrg -f ./out/dict --format html

Include extra standard objects and a managed-package namespace:

$ sf data-dictionary generate -o myOrg -m -s Case,Opportunity -l npsp__

Default selection

Every run always includes:

  • All custom objects (__c), excluding managed-package objects.
  • The standard objects Account, Contact, and User.

Anything else is opt-in.

Adding more standard objects (e.g. Opportunity and Lead)

Use the -s (--includestandardsobjects) flag with a comma-separated list of API names:

$ sf data-dictionary generate -o myOrg -s Opportunity,Lead --format md

This produces a Markdown dictionary containing Account, Contact, User, Opportunity, Lead plus all of your custom objects. The flag accepts as many objects as you want — repeat or extend the list:

$ sf data-dictionary generate -o myOrg -s Opportunity,Lead,Case,Product2 --format html,md

If any name in the list isn't present in the org, the command fails fast with a clear error so you don't end up with a half-empty dictionary.

Backwards compatibility. The previous command name dataDictionary:generate is still accepted and prints a deprecation notice. -o is now --target-org (the SF CLI standard); the old -o output short was moved to -f. The long --output flag is unchanged.

Output formats

Pick one or many with --format / -t (default xlsx). Outputs are written to the directory of --output using its basename (or to the current directory using the org username when --output is omitted).

| Format | File | What it is | | ------ | ------------- | ----------------------------------------------------------------------------------------- | | xlsx | <base>.xlsx | The classic multi-sheet Excel workbook (one sheet per object). | | html | <base>.html | Self-contained interactive HTML report with the schema map embedded (Reference / Schema map tabs). | | json | <base>.json | Single JSON document with every object, field, picklist, and relationship. | | md | <base>.md | Markdown reference with an index and one section per object. |

HTML report highlights

A single <base>.html file with a top tab bar that switches between two views:

Reference

  • Sticky sidebar with searchable object list and per-object field counts.
  • Hero header with object / custom / field totals.
  • Sticky table headers, color-coded type badges, expandable picklist & formula details.
  • One-click filter pills for Custom only / Standard only.
  • Light / dark theme toggle (preference saved in localStorage).

Schema map

  • Force-directed D3 graph rendered as rounded rectangles sized to fit each API name.
  • Sidebar checkbox list — pick as few or as many objects as you want, or use bulk buttons:
    • All — every object selected.
    • None — clear the canvas.
    • Connected — only objects that participate in at least one relationship.
    • Custom / Standard — quick partition.
  • Live search to narrow the sidebar.
  • Drag nodes, scroll to zoom, click a node for details (label, description, incoming/outgoing relationships).
  • Bottom legend distinguishing standard objects, custom objects, lookups, and master-detail.
  • Edge styling: dashed gray for lookups, solid orange (thicker) for master-detail.

The HTML file is fully self-contained — D3.js is bundled inline, so there are no external assets and no internet connection is required to open it.

sf data-dictionary generate

Generate a data dictionary for the selected org in one or more formats.

USAGE
  $ sf data-dictionary generate -o <value> [--json] [--flags-dir <value>] [-f <value>] [-m] [-s <value>...] [-l <value>...]
    [-t <value>...]

FLAGS
  -f, --output=<value>                      Destination directory and base file name (extension is appended per format).
  -l, --includemanagedpackages=<value>...   Comma-separated namespaces of managed packages whose objects should be
                                            included.
  -m, --includemanaged                      Include objects from all managed packages.
  -o, --target-org=<value>                  (required) Username or alias of the target org. Not required if the
                                            `target-org` configuration variable is already set.
  -s, --includestandardsobjects=<value>...  Additional standard objects to include (Account, Contact, and User are
                                            included by default).
  -t, --format=<value>...                   Output formats to generate. One or more of: xlsx, html, json, md.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Generate a data dictionary for the selected org in one or more formats.

  Connects to the target org, describes its sObjects, and produces a data dictionary in the requested formats: Excel
  (.xlsx), HTML report, JSON, or Markdown. The HTML report includes an interactive schema map (Reference / Schema map
  tabs) embedded in the same self-contained file.

ALIASES
  $ sf dataDictionary generate

EXAMPLES
  $ sf data-dictionary generate --target-org [email protected]

  $ sf data-dictionary generate -o myOrgName -m -s Case,Opportunity,Product2

  $ sf data-dictionary generate -o myOrgName -f ./out/dict --format xlsx,html,json,md

  $ sf data-dictionary generate -o myOrgName -f ./out/dict --format html

See code: src/commands/data-dictionary/generate.ts

sf dataDictionary generate

Generate a data dictionary for the selected org in one or more formats.

USAGE
  $ sf dataDictionary generate -o <value> [--json] [--flags-dir <value>] [-f <value>] [-m] [-s <value>...] [-l <value>...]
    [-t <value>...]

FLAGS
  -f, --output=<value>                      Destination directory and base file name (extension is appended per format).
  -l, --includemanagedpackages=<value>...   Comma-separated namespaces of managed packages whose objects should be
                                            included.
  -m, --includemanaged                      Include objects from all managed packages.
  -o, --target-org=<value>                  (required) Username or alias of the target org. Not required if the
                                            `target-org` configuration variable is already set.
  -s, --includestandardsobjects=<value>...  Additional standard objects to include (Account, Contact, and User are
                                            included by default).
  -t, --format=<value>...                   Output formats to generate. One or more of: xlsx, html, json, md.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Generate a data dictionary for the selected org in one or more formats.

  Connects to the target org, describes its sObjects, and produces a data dictionary in the requested formats: Excel
  (.xlsx), HTML report, JSON, or Markdown. The HTML report includes an interactive schema map (Reference / Schema map
  tabs) embedded in the same self-contained file.

ALIASES
  $ sf dataDictionary generate

EXAMPLES
  $ sf data-dictionary generate --target-org [email protected]

  $ sf data-dictionary generate -o myOrgName -m -s Case,Opportunity,Product2

  $ sf data-dictionary generate -o myOrgName -f ./out/dict --format xlsx,html,json,md

  $ sf data-dictionary generate -o myOrgName -f ./out/dict --format html

Behavior

  • Every custom object (__c, excluding managed-package objects) is always included.
  • The standard objects Account, Contact, and User are always included. Use --includestandardsobjects to add more.
  • --includemanaged includes every managed-package object — use --includemanagedpackages to scope by namespace prefix.
  • --format accepts a comma-separated list. Repeating the flag works too: -t xlsx -t html.

Development

$ git clone https://github.com/marsson/dataDicGen.git
$ cd dataDicGen
$ npm install
$ npm run build
$ npm test
$ npm run lint

Run the plugin locally without installing:

$ ./bin/dev.js data-dictionary generate -o [email protected] --format html,json,md

Or link it into your global sf CLI:

$ sf plugins link .
$ sf data-dictionary generate -o [email protected] --format xlsx,html,json,md

Project layout

  • src/commands/data-dictionary/generate.ts — the SF command (sf-plugins-core).
  • src/shared/filter.ts — pure helpers for sObject selection.
  • src/shared/dictionary.ts — describe + metadata loader, relationship extraction.
  • src/shared/builders/jsonBuilder.ts — JSON output.
  • src/shared/builders/mdBuilder.ts — Markdown output.
  • src/shared/builders/htmlBuilder.ts — interactive HTML report (combines the reference view and the embedded schema map).
  • src/shared/builders/schemaViewer.ts — schema-map render helpers consumed by htmlBuilder (CSS, JS, embedded data, inlined D3).
  • src/includes/*.cjs — CommonJS modules implementing config, downloader, and Excel generation.
  • messages/generate.json — command summary, descriptions, examples, and error templates.
  • test/ — Mocha + Chai tests, runnable with npm test.

Donation

This plugin is based on the SFDC Data Dictionary Generator by @gavignon.

If this project helps you, you can buy me a coffee:

paypal