This is the latest sfdx CLI application, based on the
oclif CLI engine. By default it comes installed with various plugins.
To get started, you'll need to install node v10 or greater, though we recommend using the active LTS for the best experience. While this can be done using an installer from nodejs.com or via an OS-specific package manager, we recommend using nvm to easily manage multiple node versions.
If using nvm, be sure that you've selected the appropriate version with something like nvm use v10.x.y, where x and y are specific to the version that you installed. If you want to use this version by default run nvm alias default node -- otherwise, when you restart your shell nvm will revert to whatever version configured prior to installing the latest.
You'll also need yarn. If you did decide to use nvm, be sure to follow the nvm-specific install instructions.
- From within this repository's root directory, run
yarn(short foryarn install). - Run
bin/runto view the CLI's root help.
When you make changes to this project's .ts. sources, you will need to recompile. Use yarn compile to rebuild. Linting and tests will run as git hooks before pushing.
The following flags are supported by the bin/run script, and can be combined as desired.
- --dev-debug: Sets the
SFDX_DEBUG=1,SFDX_ENV=development, andDEBUG=\*envars for the CLI'snodeprocess, which enables full debug output from bothsfdxand the oclif CLI engine.
The following flags are supported by the bin/run.sh script, which wraps the bin/run script referenced in the rest of this document, and can be combined as desired. They are stripped from the args passed to the CLI application itself.
- --dev-suspend: Starts the
nodebinary with the--inspect-brkflag to allow a remote debugger to attach before running. Does not work with npm-based installs. For this case, you can set the environment variableNODE_OPTIONS='--inspect-brk'. You may also need to set the variableOCLIF_TS_NODE=0for debugger break points to stop on the correct lines. - To set other Node executable flags, the use of the
NODE_OPTIONSenvironment variable is required.
- If you are using a locally linked
cli-engineand making changes, you may want to set up its compile watch withyarn run watch.