Skip to content

reference

CLI reference ​

Reference

Find the command you need, then copy a real example. Most project commands accept --project <root> and default to the current directory when a project is discoverable.

Supported source checks and local execution run on your machine. Installation, updates, toolchain downloads, plugin installs, and org-backed imports or captures can use the network. Plugins execute separately with your OS user permissions. Most project commands accept --project PROJECT_ROOT and default to the current directory when a project is discoverable.

Human output is terminal text. Use --json or --format for scripts. See CLI output modes, Automation and JSON, and Exit codes for the stable contract.

Download release: v0.2.15. This reference describes the checked source. A release label is not a verification result; use glade help <command> for the installed binary.

The git examples assume origin/main is your intended base ref and is available locally. Substitute the correct existing ref for your repository before running changed-test or refactor commands.

glade version ​

Print build and version information.

bash
glade version

glade update ​

Update the Glade binary and bundled assets. The default dry run prints the installer command without running it. A real update requires an explicit shell opt-in.

bash
glade update --dry-run
GLADE_UPDATE_ALLOW_SHELL=1 glade update

glade doctor ​

The v0.3.0 release includes the doctor 1.1 schema and its scoped recovery and apexReady contract. Older v0.2.15 binaries emit doctor schema 1.0; consumers must select fields according to the installed version.

Check Apex readiness for one project. Doctor reports the resolved project root, configuration, parser, project Apex API default, local-data state, runtime, and the fact that Salesforce was not contacted. A missing LWC toolchain is an advisory for Apex check/test and blocks LWC compilation and Lightning runtime routes, including Visualforce Lightning Out; packaged releases are expected to include it.

bash
glade doctor --project .
glade doctor --project . --json

Failed rows are followed by project-scoped recovery commands. Ready. and JSON apexReady: true mean the local Apex prerequisites passed. LWC-toolchain and local-data issues remain named advisories for their own workflows. This does not mean a test was selected or that Salesforce deployment, permissions, hosted services, or parity were validated.

Doctor also suggests glade.yml entries for undeclared org features and project permission-set assignments detected in source. JSON exposes this optional advice as orgSetup. Suggestions do not change runtime setup or the command's exit code; review and apply them explicitly. See setup suggestions.

glade toolchain ​

Install or inspect the global LWC toolchain used by local Lightning Out routes. Release installs populate it for normal use; source checkouts can refresh it from the current tree. DataWeave is unsupported in Glade.

bash
glade toolchain status
glade toolchain status --json
glade toolchain install --from path/to/glade

glade completion ​

Generate shell completion scripts.

bash
source <(glade completion bash)
glade completion zsh > ~/.zsh/completions/_glade
glade completion fish > ~/.config/fish/completions/glade.fish

Discovery commands ​

Use these when you are not sure where to start:

bash
glade help workflows
glade help commands
glade help exit-codes
glade examples
glade examples --tag limits
glade examples show refinement-service
glade explain GLADESEMA002
glade support

glade without arguments shows the short workflow doorway. glade help commands shows the full command inventory.

glade config ​

Inspect, validate, and create glade.yml.

bash
glade config show --project .
glade config show --project . --json
glade config validate --project .
glade config init --project . --yes --package-dir force-app

glade init is a top-level alias for glade config init.

glade parse ​

Parse Apex files and report parser diagnostics.

bash
glade parse force-app/main/default/classes/RefinementService.cls
glade parse force-app/main/default/classes --progress
glade parse force-app/main/default/classes --json

glade inspect symbols ​

Build the project symbol index and print declarations, members, triggers, and schema objects.

bash
glade inspect symbols --project .
glade inspect symbols --project . --kind class
glade inspect symbols --project . --full-paths
glade inspect symbols --project . --json

glade inspect graph ​

Build the enterprise graph for Apex, triggers, metadata references, SObjects, and code-intelligence references with conservative fallbacks.

bash
glade inspect graph --project . --json

glade inspect definition ​

Resolve a symbol or source location to its definition.

bash
glade inspect definition --project . --symbol RefinementService
glade inspect definition --project . --file force-app/main/default/classes/RefinementService.cls --line 6 --column 13

Use --json when an editor task or script needs the structured result.

glade inspect references ​

Print references for an Apex type, member, SObject, or schema field.

bash
glade inspect references --project . --symbol RefinementService.total --json
glade inspect references --project . --symbol Account.Name --include-declaration

glade refactor rename ​

Plan or apply a safe rename from the same code-intelligence graph. Dry run is the default. Use --write only after reviewing the planned edits.

bash
glade refactor rename --project . --symbol RefinementService --to FileRefinementService --dry-run --json
glade refactor rename --project . --file force-app/main/default/classes/RefinementService.cls --line 5 --column 14 --to totalNet --write

glade schema load ​

Load supported Salesforce metadata from a Salesforce DX project.

bash
glade schema load --project .
glade schema load --project . --json

glade schema import describe ​

Convert captured Salesforce describe JSON into a local Glade schema file. Live org capture belongs in a plugin. The base command only imports a captured catalog.

bash
glade schema import describe --input reports/org-describe.json
glade schema import describe --input reports/org-describe.json --output schema/local.schema.json
glade schema import describe --input reports/org-describe.json --output schema/local.schema.json --project-cache .

--project-cache PROJECT_ROOT writes schema symbols under .glade/symbols for offline definition, reference, and rename queries. That cache is advisory and does not feed local Apex execution. To use imported describe data in check and test, configure the output file and its exact SHA-256 as project.schemaSnapshot and project.schemaSnapshotSHA256 in glade.yml.

glade check ​

Parse and type-check supported Apex and metadata semantics.

bash
glade check --project .
glade check --project . --json
glade check --project . --format sarif --output glade-check.sarif
glade check --project . --format github
glade check --project . --no-cache

For local telemetry, --cpu-profile <path> writes a CPU profile, --mem-profile <path> writes a heap profile, and --perf-json <path> writes opt-in check performance counters:

bash
mkdir -p reports
glade check --project . --cpu-profile reports/check.cpu.pprof --mem-profile reports/check.mem.pprof --perf-json reports/check.perf.json

These artifacts describe local work and do not replace Salesforce validation. Exact results can be reused under .glade/semantic/ from memory, disk, or build. --no-cache bypasses semantic disk and memory reuse. Cache identity covers immutable project source and companion metadata, schema, dependencies, analyzer and platform ABIs, and analysis options; invalid or corrupt entries fail closed.

glade report assess ​

Generate an enterprise assessment report.

bash
glade report assess --project . --format json
mkdir -p reports
glade report assess --project . --format html --out reports/glade-assessment.html --include-metadata --include-tests

glade report cruft ​

Classify conservative delete, deprecate, review, and do-not-delete candidates.

bash
glade report cruft --project . --format json
mkdir -p reports
glade report cruft --project . --format html --out reports/glade-cruft.html

glade report refactor-proof ​

Collect local evidence for changed Apex and metadata.

bash
glade report refactor-proof --project . --since origin/main --format json
mkdir -p reports
glade report refactor-proof --project . --since origin/main --format html --out reports/glade-refactor-proof.html

glade exec ​

Run execute-anonymous Apex against local source and storage. Default output summarizes debug lines and limit counters, then writes the raw log under .glade/logs. The default local running user uses America/Los_Angeles; local Datetime construction and formatting follow that user, while GMT methods retain GMT semantics. Use explicit TimeZoneSidKey values for System.runAs users. URL.getOrgDomainUrl() uses the configured canonical org origin from org.domainUrl, defaulting to https://local.glade.example.

bash
glade exec --project . "System.debug('hello from glade');"
mkdir -p reports
glade exec --project . --trace reports/trace.json "System.debug(1);"
glade exec --project . --debug-log raw "System.debug('hello from glade');"
glade exec --project . --log-out reports/exec.log "System.debug('hello from glade');"
glade exec --project . --limit-mode strict "System.debug(Limits.getDmlStatements());"

glade test ​

Discover and run local Apex tests. The RefinementServiceTest.opensFile examples match the editor walkthrough; substitute a class and method that exist in your project. Use the quickstart sample for a self-contained SampleTest.adds run. Read JSON counts: an empty selection can exit 0, and an unsupported test outcome exits 1 as a test error.

Useful flags include changed --since <ref>, --watch, --watch-once, --last-failed, --wizard, --daemon, --connect, --no-serve, --class, --method, --class-file, --shard-count, --shard-index, --duration-history, --write-class-shards, --test-timeout, --gc-aggressive, --json, --junit, and --limit-mode.

The per-test wall-clock cap defaults to 10 minutes and also applies to @TestSetup. Choose a Go duration such as 90s or 15m with GLADE_TEST_TIMEOUT; --test-timeout takes precedence over the environment, then the default. Invalid or negative settings are errors. 0 disables the per-test cap. This policy also applies to daemon, watch, and glade dev test/watch runs. CPU and governor limits are independent and unchanged. Timeout failures name the applied setting and explain how to raise or disable it. The VM checks cancellation every 64 Apex statements. A long native operation (such as a SOQL/DML scan, JSON conversion, regex or sort) can run beyond the cap before reaching the next cancellation check. Caller deadlines and the connected daemon's one-hour request timeout remain separate; --test-timeout 0 disables the per-test cap only.

Keep an explicit cap in CI:

bash
glade test --test-timeout 2m

For a longer local run or to disable the cap:

bash
GLADE_TEST_TIMEOUT=15m glade test
GLADE_TEST_TIMEOUT=0 glade test

--cpu-profile <path> writes a CPU profile, --mem-profile <path> writes a heap profile, and --perf-json <path> writes opt-in performance counters. CPU and heap profiles capture the lifetime of the local command, including daemon or watch mode, and are written when it exits; they cannot be combined with --connect. --perf-json is for a local one-shot run and cannot be combined with daemon, watch, watch-once, connect, wizard, last-failed, or shard-plan-only modes:

bash
mkdir -p reports
glade test --project . --no-serve --no-cache --cpu-profile reports/test.cpu.pprof --mem-profile reports/test.mem.pprof --perf-json reports/test.perf.json

They are local telemetry artifacts and do not replace Salesforce validation. The versioned JSON records effective execution and cache policy. semanticCache.source identifies memory, disk, or build provenance, alongside safe-miss reasons, waits, retained bytes, and evictions.

glade test serve keeps the runtime warm across CLI invocations. Later runs auto-connect through .glade/test/serve.sock unless --no-serve is set.

Eligible modes cache warmed harness state on disk at .glade/test/startup.meta.json plus a hashed payload after a cold build. One-shot parallel-method runs with more than one effective worker bypass this restored-runtime payload. Semantic results are independent and live under .glade/semantic/. See Test Startup Cache for freshness rules.

bash
glade test serve --project .
glade test daemon status --project .
glade test --project .
glade test --project . --class RefinementServiceTest --json
mkdir -p reports
glade test --project . --class RefinementServiceTest --method opensFile --junit reports/glade-junit.xml
glade test --project . --connect --class RefinementServiceTest
glade test changed --project . --since origin/main --json --no-progress
glade test failed --project .
glade test --project . --wizard
glade test --project . --watch
glade test --project . --daemon --watch
glade test --project . --limit-mode permissive --json
glade test daemon stop --project .

The persistent test server uses daemon protocol 3. Stop a server started by an older binary before upgrading, then restart it with the new binary:

bash
glade test daemon stop --project .
glade test serve --project .

If the new client reports a protocol mismatch, stop the old foreground server with Ctrl-C (or use its original binary's stop command), then start the new server. A newer client's stop command may only remove stale socket/PID files when it cannot speak the old protocol; that does not prove the old process exited.

For daemon-backed watch loops, eligible Apex-only edits update incrementally. Metadata, configuration, project-topology, uncertain, and recovery changes fall back to an authoritative rebuild; selection remains conservative.

Clear the project-local startup and semantic caches, or bypass both for one run:

bash
glade test clear-cache --project .
glade test --project . --no-cache --class RefinementServiceTest

Use exact class files, deterministic shards, saved duration history, and per-test timeouts for larger suites:

bash
glade test --project . --class-file test-classes.txt
glade test --project . --shard-count 4 --shard-index 0
glade test --project . --shard-count 4 --duration-history .glade/test-durations.json --write-class-shards reports/test-shards
glade test --project . --test-timeout 2m

--write-class-shards writes balanced shard-NNN.txt class lists and exits. An empty generated shard contains # glade-empty-class-shard-v1 and safely returns status=empty without selecting the full suite. A hand-written empty or comment-only --class-file is a Selector failure (JSON: status=failed, exit code 1). Both outcomes write requested --junit and --trace artifacts; --perf-json, --cpu-profile, and --mem-profile are rejected for empty class files. JSON status=partial identifies a run with skipped selected tests and no failures. Unfiltered, unsharded runs maintain the default duration history. Test --no-cache bypasses startup and semantic cache disk operations plus semantic memory reuse. With a finite memory limit, --gc-aggressive sets GOGC=off so Go's soft memory limit drives collection instead of a heap-growth percentage. glade test defaults to a 4 GiB soft limit and honors an explicit GOMEMLIMIT. If the effective limit is unlimited (GOMEMLIMIT=off or Go's maximum int64 limit), the flag falls back to GOGC=50. This soft limit is not a hard process RSS cap. Use --no-serve to apply the settings to the process executing the tests; an existing test server retains its own startup GC settings.

Run glade help test for the full flag list.

glade tui ​

Open the terminal UI for project, test, data, and plugin workflows.

bash
glade tui --project .
glade tui --project . --view tests
glade tui --project . --db .glade/refinement-local.sqlite --view data
glade tui --project . --db .glade/refinement-local.sqlite --view data --target-org devhub --object Account
glade tui --project . --no-ui

glade dev and glade report ​

Run the human-focused test loop and save artifacts under .glade/runs.

bash
glade dev --project .
glade dev test --project . --out .glade/runs
glade dev test --project . --failed --out .glade/runs
glade report list --runs-dir .glade/runs
glade report show latest --runs-dir .glade/runs --json
glade report github latest --runs-dir .glade/runs
glade report export latest --runs-dir .glade/runs --format html --output glade-report.html

Serve local Visualforce pages with hot reload. This is a preview feature for useful local /apex rendering, not exact hosted Visualforce behavior:

bash
glade dev vf --project . --port 8080
glade dev vf --project . --addr 127.0.0.1:0 --ready-file /tmp/glade-vf-ready.json

The Visualforce server prints /apex/<PageName> routes and watches .page, .component, .cls, Aura, LWC, and static resource changes.

Serve local LWCs in a Lightning-style shell. This is a preview feature for local routes, not exact hosted Lightning Experience behavior:

bash
glade toolchain install
glade dev lwc --project . --open
glade dev lwc --project . --context accountRecord --open
glade dev lwc --project . --addr 127.0.0.1:0 --ready-file /tmp/glade-lwc-ready.json

The printed base URL opens the Workbench Console, with /lwc available as a stable link. Component Lab filters exposed LWCs and edits their preview properties and context. Page Workbench groups discovered routes, and /lwc/builder opens the draft page composer. The shell also provides /lwc/preview/component/<namespace>/<component>, /lwc/preview/cmp/<namespace>/<component>?c__name=value, /lwc/preview/record/<Object>/<recordId>?page=<FlexiPage>, /lwc/preview/app/<Page>, /lwc/preview/home/<Page>, /lwc/preview/tab/<Tab>, /lwc/preview/utility/<UtilityBar>, /lwc/preview/flow/<FlowApiName>, /lwc/preview/action/<Object>/<recordId>/<Action>, /lwc/preview/action/global/<Action>, /lwc/preview/community/<site>/<page>, and /lwc/preview/community/<site>/cmp/<namespace>/<component> routes. Community routes come from named contexts such as communityAccount; named contexts such as phase3BaseComponents can also open fixture-specific service probes. Visualforce-backed tabs redirect to /apex/<Page> and share the same Lightning Out runtime.

glade lsp ​

Run the Language Server Protocol server over stdio, or emit one diagnostics pass.

bash
glade lsp --project .
glade lsp --project . --diagnostics-once

glade profile analyze ​

Read a Glade native trace and emit terminal, JSON, Markdown, or pprof-compatible profile output.

bash
mkdir -p reports
glade exec --project . --trace reports/trace.json "System.debug(1);"
glade profile analyze reports/trace.json
glade profile analyze reports/trace.json --json
glade profile analyze reports/trace.json --format markdown
glade profile analyze reports/trace.json --format pprof > reports/trace.pb.gz

glade plugins ​

Install, link, list, inspect, lock, and restore executable plugins. First-party plugins provide advisory scanners and org package capture without putting that work in the base runtime.

bash
# Uses the default public registry; custom registries, archives, and links are also supported.
glade plugins available
glade plugins install @glade/performance
glade plugins install @glade/orgpackage
glade plugins list
glade plugins search quality
glade plugins info @glade/performance
glade plugins doctor
glade plugins which performance
glade plugins lock
glade plugins restore

The short aliases performance and orgpackage resolve to @glade/performance and @glade/orgpackage. available lists configured registry plugins that can be installed.

Once installed, plugin command roots behave like Glade commands:

bash
glade performance scan --project . --json
glade package capture --target-org packaging --namespace pkg --output .glade/packages/pkg.glade-package.json --config-snippet

See Plugins for first-party install and lock-file docs.

glade debug ​

Parse, profile, explain, analyze for editors, and synthesize from Salesforce debug logs.

bash
glade debug parse --log apex.log --json
glade debug profile --log apex.log
glade debug profile --log apex.log --format markdown
glade debug explain --log apex.log --project . --json
glade debug editor --log apex.log --project . --json
glade debug repro --log apex.log --project . > ReproTest.cls
glade debug replay --log apex.log --project . --json

glade debug profile --log apex.log profiles a Salesforce debug log. glade profile analyze reports/trace.json profiles a Glade native trace.

glade editor and glade dap ​

Install and check editor integrations, or run the Debug Adapter Protocol server.

bash
glade editor doctor vscode
glade editor install vscode --force
glade dap --project .

glade package ​

Build, inspect, validate, diff, and capture managed package artifacts.

bash
glade package build --project . --namespace pkg --output pkg.json --progress
glade package info pkg.json --json
glade package validate pkg.json
glade package diff old.json pkg.json --json
glade plugins install @glade/orgpackage
glade package capture --target-org packaging --namespace pkg --output .glade/packages/pkg.glade-package.json --config-snippet

glade package capture is a bridge to the orgpackage plugin. Base Glade keeps artifact loading, type checking, and local runtime behavior; the plugin owns live Salesforce org capture.

glade server ​

Start the local Salesforce API baseline. Use --db for persistence and --limit-mode for execute-anonymous limit behavior.

bash
glade server --addr 127.0.0.1:8080
glade server --project . --db .glade/refinement-local.sqlite --addr 127.0.0.1:8080
glade server --project . --limit-mode strict

glade org ​

Create, start, and register a local Glade org target for supported sf commands. This is a Glade-backed local API target, not a Salesforce scratch org.

bash
glade org create refinement-local
glade org start refinement-local --project .
glade org auth refinement-local --project .
sf data create record -o refinement-local -s FileRow__c -v "Name='Refine 01'"
sf apex run -o refinement-local -f scripts/refinement.apex

See Use Glade as an sf target for the data import path and support boundary.

glade db ​

Seed, import, query, describe, inspect, reset, and export local org storage fixtures.

bash
glade db reset --db .glade/refinement-local.sqlite --json
glade db seed --wizard --db .glade/refinement-local.sqlite --project . data/file-rows.json
glade db seed --db .glade/refinement-local.sqlite --project . --progress data/file-rows.json
glade db import sf --target-org devhub --db .glade/refinement-local.sqlite --project . --object Account --fields Id,Name --limit 25 --json
glade db import sf --target-org devhub --list-objects --category custom --json
glade db ui --db .glade/refinement-local.sqlite --project .
glade db --ui --db .glade/refinement-local.sqlite --project .
glade db inspect --db .glade/refinement-local.sqlite --json
glade db query --db .glade/refinement-local.sqlite --project . --json "SELECT Id, Name FROM FileRow__c"
glade db describe --db .glade/refinement-local.sqlite --project . --json FileRow__c
glade db export --db .glade/refinement-local.sqlite > refinement-export.json

glade playground ​

Start the local browser playground for editing classes, running anonymous Apex, and inspecting logs, limits, traces, and org diffs.

The --once example materializer shown below is included in v0.3.0. It writes a managed project without starting a server. Use --open to start the browser workbench.

bash
glade playground --db .glade/playground/org.sqlite --addr 127.0.0.1:1789 --open
glade playground --examples --db .glade/playground/org.sqlite
glade playground --example deal-desk-discount-guard --once
glade playground --list-examples
glade playground --no-db --addr 127.0.0.1:1789 --open
glade playground --examples --reset-on-start
glade playground --project . --db .glade/playground/org.sqlite
glade playground --wizard --project . --examples

Useful flags:

  • --list-examples prints built-in example ids, names, file counts, and tags. Add --project-ref name=path to include a local project reference.
  • --example <id> enables built-in examples and starts at /playground/?example=<id>. It uses the managed scratch workspace and cannot be combined with --project or --project-ref.
  • --no-db keeps org state in memory and writes no .glade/playground/org.sqlite.
  • --reset-on-start clears the scratch workspace and local org state before serving. It refuses --project <path> so project source is not deleted.

Built-in examples:

IDNameCommand
contact-relationship-drillAccount + Contact Queryglade playground --example contact-relationship-drill
refinement-serviceRefinement Serviceglade playground --example refinement-service
trigger-contact-taskBefore Insert Triggerglade playground --example trigger-contact-task
bulk-trigger-rollupBulk Trigger Rollupglade playground --example bulk-trigger-rollup
collection-selectorCollection Selectorglade playground --example collection-selector
deal-desk-discount-guardDeal Desk Discount Guardglade playground --example deal-desk-discount-guard
limit-counter-drillGovernor Counter Drillglade playground --example limit-counter-drill
governor-limits-strictGovernor Limits (strict)glade playground --example governor-limits-strict
map-selector-drillMap Selector Drillglade playground --example map-selector-drill
org-diff-review-loopOrg Diff Review Loopglade playground --example org-diff-review-loop
org-diff-dmlOrg Diff after DMLglade playground --example org-diff-dml
persist-mode-ledgerPersist Mode Ledgerglade playground --example persist-mode-ledger
renewal-health-scorecardRenewal Health Scorecardglade playground --example renewal-health-scorecard

Local workbench

Open the local playground with examples:

bash
glade playground --examples --addr 127.0.0.1:1789 --open

Glade is an independent project and is not affiliated with, sponsored by, or endorsed by Salesforce. Salesforce and Apex are trademarks of Salesforce, Inc. · Contributors · Security · Releases · Apache-2.0