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 🙏

© 2024 – Pkg Stats / Ryan Hefner

org-analyzer

v1.1.3

Published

The org-analyzer plugin for the Salesforce CLI provides commands to analyze and report on various aspects of a Salesforce org, including generating data dictionaries, ERD charts, scanning object relationships, identifying metadata dependencies, checking a

Downloads

50

Readme

org-analyzer

CI/CD Pipeline GitHub release (latest by date) CI/CD Pipeline NPM License

Description

Org-analyzer is a Salesforce CLI plugin designed to analyze and generate comprehensive data dictionaries for Salesforce orgs. By default, it extracts all custom objects and standard objects with custom fields. It offers the ability to filter objects based on user access through profiles and permission sets, as well as the capability to crawl object relationships. Additionally, the plugin generates Excel-based data dictionaries and creates Entity Relationship Diagram (ERD) charts. For the Excel file generation, I reused code from the project sfdc-generate-data-dictionary,

Features

  • Analyzes and generates comprehensive data dictionaries for Salesforce orgs

  • Extracts all custom objects and standard objects with custom fields by default

  • Filters objects based on user access through profiles and permission sets

  • Crawls object relationships for detailed insights

  • Generates Excel-based data dictionaries for easy reference

  • Creates visual Entity Relationship Diagram (ERD) charts

  • Generate a data dictionary for all custom objects and standard objects with custom fields in the target org:

    $ sf data-dictionary generate

  • Generate a data dictionary for all custom objects and standard objects with custom fields in the target org and save the output to a specific directory:

    $ sf data-dictionary generate --dir directory

  • Generate a data dictionary for all custom objects and standard objects with custom fields in the specified target org:

    $ sf data-dictionary generate --target-org username

  • Generate a data dictionary that include managed packages in the target org:

    $ sf data-dictionary generate --include-all-managed

  • Generate a data dictionary that include managed packages with specific prefixes in the target org:

    $ sf data-dictionary generate --include-managed-prefixes prefix1,prefix2

  • Generate a data dictionary for objects specified in the target org:

    $ sf data-dictionary generate --sobjects object1,object2

  • Generate a data dictionary for a user-specified list of objects in the target org:

    $ sf data-dictionary generate --username username

  • Generate a data dictionary by crawling through object relationships starting from a specific object:

    $ sf data-dictionary generate --start-object object

  • Generate a data dictionary without charts:

    $ sf data-dictionary generate --skip-charts

  • Specify the batch size for processing SObjects:

    $ sf data-dictionary generate --process-batch-size 50

  • Generate a data dictionary with verbose output:

    $ sf data-dictionary generate --verbose

Install

sf plugins install [email protected]

Build

To build the plugin locally, make sure to have yarn installed and run the following commands:

# Clone the repository
git clone https://github.com/junliu724515/org-analyzer.git

# Install the dependencies and compile
yarn && yarn build

To use your plugin, run using the local ./bin/dev or ./bin/dev.cmd file.

# Run using local run file.
./bin/dev data-dictionary generate

There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.

# Link your plugin to the sf cli
sf plugins link .
# To verify
sf plugins

Commands

sf data-dictionary generate

The data-dictionary feature enables automatic extraction and documentation of metadata from a Salesforce org, offering a detailed overview of objects, fields, and their attributes, including data types, relationships, and descriptions.

USAGE
  $ sf data-dictionary generate [--json] [--flags-dir <value>] [-m] [--api-version <value>] [-o <value>] [-x <value>] [-l
    <value>] [-s <value>] [-d <value>] [--start-object <value>] [--output-time] [--skip-charts] [--include-std-objects
    <value>] [--verbose] [--skip-empty-objects] [--exclude-objects <value>] [--username <value>] [--process-batch-size
    <value>]

FLAGS
  -d, --dir=<value>                       Directory for saving outputs.
  -l, --include-managed-prefixes=<value>  Specifies specific managed package prefixes (comma-separated) to include in
                                          the operation. This flag overrides the --include-all-managed flag, ensuring
                                          only the specified managed packages are included. Default value is null.
  -m, --include-all-managed               Specifies whether to include all managed package components. Default value is
                                          false.
  -o, --target-org=<value>                Username or alias of the target org.
  -s, --sobjects=<value>                  Specifies particular Salesforce objects (comma-separated) to include in the
                                          operation. This flag overrides the --include-all-managed flag if used.
  -x, --exclude-managed-prefixes=<value>  Specifies certain managed package prefixes (comma-separated) to exclude from
                                          the operation. This flag overrides the --include-all-managed flag, removing
                                          the specified packages from the managed components being included. Default
                                          value is null.
      --api-version=<value>               Override the api version used for api requests made by this command
      --exclude-objects=<value>           Specifies the objects to exclude.
      --include-std-objects=<value>       Specifies a comma-separated list of standard objects to include in the crawl.
                                          By default, standard objects are not crawled, but this flag makes exceptions
                                          for the specified objects to explore their relationships.
      --output-time                       Controls the format of the appended timestamp in the output folder name. If
                                          set to true, both date and time are appended; if false, only the date is
                                          appended.
      --process-batch-size=<value>        [default: 100] Specifies the batch size to process SObjects. Default is 100.
      --skip-charts                       Determines whether ERD charts are generated. If set to true, ERD charts and
                                          Lucidchart import files are not generated.
      --skip-empty-objects                Ensures that only objects with a record count greater than 0 are included.
                                          Default value is false, allowing all objects to be included regardless of
                                          their record count.
      --start-object=<value>              Specifies the sObject to begin crawling through its relationships.
      --username=<value>                  Specifies a username to retrieve all objects that a given user can read from
                                          profile and permission set assignments.
      --verbose                           Displays object lists and more details in the output.

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

DESCRIPTION
  The data-dictionary feature enables automatic extraction and documentation of metadata from a Salesforce org, offering
  a detailed overview of objects, fields, and their attributes, including data types, relationships, and descriptions.

  By default, it will list all custom objects and all standard objects with at least one custom field. Additionally, you
  can choose to include or exclude any managed package objects. Above all, a very unique feature is the ability to crawl
  objects through their relationships, which is especially useful for an org split use case to separate the data model
  among multiple apps.

EXAMPLES
  $ sf data-dictionary generate