CLI Quickstart
This guide gets you from zero to a successful LATdx CLI test run.
Prerequisites
- A supported LATdx CLI binary for your platform:
latdx-darwin-x64(macOS Intel)latdx-darwin-arm64(macOS Apple Silicon)latdx-linux-x64latdx-linux-arm64latdx-win-x64.exe
- Salesforce CLI (
sf) installed and authenticated. - A Salesforce project workspace with
sfdx-project.json.
Install the CLI Binary
Download the latest binary from GitHub Releases and place it on your PATH.
macOS/Linux example:
chmod +x ./latdx-<platform>
sudo mv ./latdx-<platform> /usr/local/bin/latdxWindows (PowerShell) example:
Move-Item .\latdx-win-x64.exe $env:USERPROFILE\bin\latdx.exe
# Add $env:USERPROFILE\bin to PATH if neededVerify command availability:
latdx --helpLocal Repo Development Build
If you are developing inside this repository:
bun install
bun run --filter "@latdx/cli" buildAuthenticate Salesforce Org
Set a default org or pass one per command.
sf org login web --alias my-org --set-defaultFirst Run: Org Mode
Run specific test classes from org:
latdx test run -n AccountServiceTest -o my-orgRun specific methods (Class.method):
latdx test run -t AccountServiceTest.testHappyPath -o my-orgRun all tests in org mode (when no file/dir input is provided):
latdx test run -o my-orgFirst Run: File Mode
Run one local test class file:
latdx test run -f force-app/main/default/classes/AccountServiceTest.cls -o my-orgRun all matching tests in a directory:
latdx test run -d force-app/main/default/classes -p '**/*Test.cls' -o my-orgList Tests Before Running
latdx test list -f force-app/main/default/classes/AccountServiceTest.clsList all discovered test methods from an org:
latdx test list -o my-orgOr, if you already set a default org:
latdx test listCommon Setup Pitfalls
- CLI not built (repo-development mode):
- Symptom:
Cannot find module '../dist/index.js'. - Fix: run
bun run --filter "@latdx/cli" build.
- Symptom:
- No org auth/default org:
- Symptom: org resolution errors.
- Fix: pass
-o <alias>or set default org withsf.
- Wrong mode flags:
--methodonly works with--file.--class-names/--testscannot be mixed with--fileor--dir.
Platform Notes
- Windows ARM64 binaries are not published in v1.