Skip to content

ImJohnMDaniel/training-lab-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The deployment-validator CLI Plugin

This repository provides a simple example of a Salesforce CLI plugin that does three things.

  1. Creates a "hello world" CLI command: sf hello world.
  2. Creates a CLI hook that runs before any sf command is executed.
  3. Creates a CLI hook that listens for a "pre deploy" event and takes action based on the contents of the deployment.

TODO: Update the rest of this doc.

Prepare Your CodeBuilder Training Environment

curl https://raw.githubusercontent.com/ImJohnMDaniel/sed24-hot-create-cli-plugin/main/setup-training-lab | bash

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 [email protected]:salesforcecli/deployment-validator

# 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 hello world

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 hello world

Say hello either to the world or someone you know.

USAGE
  $ sf hello world [--json] [-n <value>]

FLAGS
  -n, --name=<value>  [default: World] The name of the person you'd like to say hello to.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Say hello either to the world or someone you know.

  Say hello either to the world or someone you know.

EXAMPLES
  Say hello to the world:

    $ sf hello world

  Say hello to someone you know:

    $ sf hello world --name Astro

About

Training Lab repo for the Salesforce CLI Plugin Workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages