Skip to Content
Quickstart

CLI Quickstart

This guide gets you from zero to a successful LATdx CLI test run.

Prerequisites

  1. A supported LATdx CLI binary for your platform:
    • latdx-darwin-x64 (macOS Intel)
    • latdx-darwin-arm64 (macOS Apple Silicon)
    • latdx-linux-x64
    • latdx-linux-arm64
    • latdx-win-x64.exe
  2. Salesforce CLI (sf) installed and authenticated.
  3. 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/latdx

Windows (PowerShell) example:

Move-Item .\latdx-win-x64.exe $env:USERPROFILE\bin\latdx.exe # Add $env:USERPROFILE\bin to PATH if needed

Verify command availability:

latdx --help

Local Repo Development Build

If you are developing inside this repository:

bun install bun run --filter "@latdx/cli" build

Authenticate Salesforce Org

Set a default org or pass one per command.

sf org login web --alias my-org --set-default

First Run: Org Mode

Run specific test classes from org:

latdx test run -n AccountServiceTest -o my-org

Run specific methods (Class.method):

latdx test run -t AccountServiceTest.testHappyPath -o my-org

Run all tests in org mode (when no file/dir input is provided):

latdx test run -o my-org

First Run: File Mode

Run one local test class file:

latdx test run -f force-app/main/default/classes/AccountServiceTest.cls -o my-org

Run all matching tests in a directory:

latdx test run -d force-app/main/default/classes -p '**/*Test.cls' -o my-org

List Tests Before Running

latdx test list -f force-app/main/default/classes/AccountServiceTest.cls

List all discovered test methods from an org:

latdx test list -o my-org

Or, if you already set a default org:

latdx test list

Common Setup Pitfalls

  1. CLI not built (repo-development mode):
    • Symptom: Cannot find module '../dist/index.js'.
    • Fix: run bun run --filter "@latdx/cli" build.
  2. No org auth/default org:
    • Symptom: org resolution errors.
    • Fix: pass -o <alias> or set default org with sf.
  3. Wrong mode flags:
    • --method only works with --file.
    • --class-names/--tests cannot be mixed with --file or --dir.

Platform Notes

  • Windows ARM64 binaries are not published in v1.