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

sf-raven

v1.0.7

Published

A custom sf plugin built by @tomcarman

Downloads

49

Readme

sf-raven

NPM Downloads/week License

A plugin for the Salesforce CLI built by Tom Carman.

sf-raven now replaces sfdx-raven.

Why a new plugin?

I originally built sfdx-raven in 2020, but the Salesforce CLI landscape has changed a lot since then. Rather than attempting to migrate the original plugin from sfdx to sf, it felt cleaner to start a new project and leverage the new architecture and scaffolding tools that come with the new sf cli.

Improvements over sfdx-raven

  • Built on sf not sfdx.
  • Uses the latest version of oclif.
  • Commands now follow the sf command structure guidelines - <topic> <action> <resource | sub-action> [flags]. For example:
    • info:fields becomes object display fields
    • utils:event:listen becomes event subscribe
  • Code now meets ESlint rules for TypeScript, including the Salesforce CLI Plugin custom rules.
  • The Salesforce tooling / documentation for building custom plugins has matured a lot over the past couple years, which will make it easier to update the plugin going forward.

More commands will be ported/added over time - see Todo.

Command Quick Reference

Full details, usage, examples etc are further down, or can be accessed via --help on the commands.

sf raven object display

sf raven audit display

sf raven event

Setup

Quick Install

Assuming you already have the SDFX CLI installed, just run:

sf plugins install sf-raven

Note: You'll be prompted that this is not officially code-signed by Salesforce - like any custom plugin. You can just accept this when prompted, or alternatively you can whitelist it

Updating the plugin

The plugin can be updated to the latest version using

sf plugins update

Install from source

  1. Install the SDFX CLI
  2. Clone the repository: git clone [email protected]:tomcarman/sf-raven.git
  3. Install npm modules: npm install
  4. Link the plugin: sfdx plugins:link .

Compatibility

  • macOS
    • Plugin has been built on macOS and will always run on macOS

Todo

  • Migrate remaining commands from sfdx-raven
    • sfdx raven:utils:deploy:branch2org
    • sfdx raven:utils:diff
    • sfdx raven:utils:dashboarduser:update - tbc
  • Get the sObject Type for a given Id
  • Get the picklist values for a given picklist
  • Clone a record

sf raven object display fields

Show field information for a given sObject.

USAGE
  $ sf raven object display fields -o <value> -s <value> [--json]

FLAGS
  -o, --target-org=<value>  (required) Login username or alias for the target org.
  -s, --sobject=<value>     (required) The API name of the sObject that you want to view fields for.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show field information for a given sObject.

  FieldDefinition metadata is queried for the given sObject. The field Labels, API names, and Type are displayed.

EXAMPLES
  $ sf raven object display fields --target-org dev --sobject Account

  $ sf raven object display fields --target-org dev --sobject My_Custom_Object__c


OUTPUT

Name               Developer Name  Type
────────────────── ─────────────── ─────────────────
Account Number     AccountNumber   Text(40)
Account Source     AccountSource   Picklist
Annual Revenue     AnnualRevenue   Currency(18, 0)
...

sf raven object display recordtypes

Show RecordType information for a given sObject.

USAGE
  $ sf raven object display recordtypes -o <value> -s <value> [--json]

FLAGS
  -o, --target-org=<value>  (required) Login username or alias for the target org.
  -s, --sobject=<value>     (required) The API name of the sObject that you want to view Record Types for.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show RecordType information for a given sObject.

  RecordType metadata is queried for the given sObject. The RecordType Name, DeveloperName, and Id are displayed.

EXAMPLES
  $ sf raven object display recordtypes --target-org dev --sobject Account

  $ sf raven object display recordtypes --target-org dev --sobject My_Custom_Object__c


OUTPUT

Name                Developer Name          Id
─────────────────── ─────────────────────── ──────────────────
Business Account    Business_Account        0124J000000XXXXABC
Person Account      PersonAccount           0124J000000YYYYDEF
...

sf raven audit display

Show recent entries in the Setup Audit Trail.

USAGE
  $ sf raven audit display -o <value> [--json] [-u <value>] [-l <value>]

FLAGS
  -l, --limit=<value>       [default: 20] The number of audit trail entries to return. Maximum is 2000.
  -o, --target-org=<value>  (required) Login username or alias for the target org.
  -u, --username=<value>    Username to filter the audit trail by.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Show recent entries in the Setup Audit Trail.

  Returns the 20 most recent Setup Audit Trail entries, but this can be increased up to 2000 using the optional --limit flag. The results can be filtered by a particular user using the --username flag.

EXAMPLES
  $ sf raven audit display --target-org dev

  $ sf raven audit display --target-org dev --limit 200

  $ sf raven audit display --target-org dev --username [email protected]

  $ sf raven audit display --target-org dev --limit 50 --username [email protected]


OUTPUT

Date                Username      Type         Action                                                      Delegate User
─────────────────── ───────────── ──────────── ─────────────────────────────────────────────────────────── ────────────────────
2023-09-29 17:23:47 [email protected]  Apex Trigger Changed Account Created Trigger code: AccountTrigger        null
2023-09-29 17:23:43 [email protected]  Apex Trigger Created Account Created Trigger code: AccountCreatedTrigger null
...

sf raven event subscribe

Subscribe to Platform Events.

USAGE
  $ sf raven event subscribe -o <value> -e <value> [--json] [-r <value>] [-t <value>]

FLAGS
  -e, --event=<value>       (required) The name of the Platform Event that you want to subscribe with '/event/' prefix eg. /event/My_Event__e.
  -o, --target-org=<value>  (required) Login username or alias for the target org.
  -r, --replayid=<value>    The replay id to replay events from eg. 21980378.
  -t, --timeout=<value>     [default: 3] How long to subscribe for before timing out in minutes eg. 10. Default is 3 minutes.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Subscribe to Platform Events.

  Platform Events are printed to the terminal. An optional flag can be used to relay events from a given relayid. Defaut timeout is 3 minutes, but can be extended to 30 minutes.

EXAMPLES
  $ sf raven event subscribe --target-org dev --event /event/My_Event__e

  $ sf raven event subscribe --target-org dev --event /event/My_Event__e --replayid 21980378

  $ sf raven event subscribe --target-org dev --event /event/My_Event__e --timeout 10

  $ sf raven event subscribe --target-org dev --event /event/My_Event__e --replayid 21980378 --timeout 10


OUTPUT

❯ 🔌 Connecting to org... done
❯ 📡 Listening for events...

{
  "schema": "XdDXhymeO5NOxuhzFpgDJA",
  "payload": {
    "Some_Event_Field__c": "Hello World",
    "CreatedDate": "2021-03-15T19:16:54.929Z",
  },
  "event": {
    "replayId": 21980379
  }
}