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.
- Use setup commands when starting a workspace.
- Use check and test commands in the daily Apex loop.
- Use report, editor, and plugin commands for larger teams.
All commands are local unless you point Glade at an external path or start a server. 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.
Verified with Glade v0.2.14.
glade doctor, glade update, glade init, glade config, and shell completion.Check, inspect, and refactorglade parse, glade inspect, glade schema, glade refactor, and glade check.TestRun all tests, one class, one method, changed tests, daemon mode, and cache controls.ReportsAssessment, cruft, refactor-proof, saved run reports, and CI artifacts.Editor and debugLSP, DAP, VS Code install, debug-log parsing, and profile analysis.Terminal UIOpen project, test, data, and plugin workflows in one terminal board.PluginsInstall, link, inspect, lock, restore, and run first-party plugins.Server and playgroundStart local Salesforce API routes and browser playground examples.sf targetCreate, start, and register a local Glade org target for supported sf commands.DatabaseSeed, import, query, describe, inspect, reset, and export persistent local org state.glade version
Print build and version information.
glade versionglade 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.
glade update --dry-run
GLADE_UPDATE_ALLOW_SHELL=1 glade updateglade doctor
Check the local environment and project discovery basics.
glade doctor --project .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.
glade toolchain status
glade toolchain status --json
glade toolchain install --from .glade completion
Generate shell completion scripts.
source <(glade completion bash)
glade completion zsh > ~/.zsh/completions/_glade
glade completion fish > ~/.config/fish/completions/glade.fishDiscovery commands
Use these when you are not sure where to start:
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 supportglade without arguments shows the short workflow doorway. glade help commands shows the full command inventory.
glade config
Inspect, validate, and create glade.yml.
glade config show --project .
glade config show --project . --json
glade config validate --project .
glade config init --project . --yes --package-dir force-appglade init is a top-level alias for glade config init.
glade parse
Parse Apex files and report parser diagnostics.
glade parse force-app/main/default/classes/RefinementService.cls
glade parse force-app/main/default/classes --progress
glade parse force-app/main/default/classes --jsonglade inspect symbols
Build the project symbol index and print declarations, members, triggers, and schema objects.
glade inspect symbols --project .
glade inspect symbols --project . --kind class
glade inspect symbols --project . --full-paths
glade inspect symbols --project . --jsonglade inspect graph
Build the enterprise graph for Apex, triggers, metadata references, SObjects, and code-intelligence references with conservative fallbacks.
glade inspect graph --project . --jsonglade inspect definition
Resolve a symbol or source location to its definition.
glade inspect definition --project . --symbol RefinementService
glade inspect definition --project . --file force-app/main/default/classes/RefinementService.cls --line 6 --column 13Use --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.
glade inspect references --project . --symbol RefinementService.total --json
glade inspect references --project . --symbol Account.Name --include-declarationglade 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.
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 --writeglade schema load
Load supported Salesforce metadata from a Salesforce DX project.
glade schema load --project .
glade schema load --project . --jsonglade 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.
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.
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-cacheFor 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:
mkdir -p reports
glade check --project . --cpu-profile reports/check.cpu.pprof --mem-profile reports/check.mem.pprof --perf-json reports/check.perf.jsonThese 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.
glade report assess --project . --format json
mkdir -p reports
glade report assess --project . --format html --out reports/glade-assessment.html --include-metadata --include-testsglade report cruft
Classify conservative delete, deprecate, review, and do-not-delete candidates.
glade report cruft --project . --format json
mkdir -p reports
glade report cruft --project . --format html --out reports/glade-cruft.htmlglade report refactor-proof
Collect local evidence for changed Apex and metadata.
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.htmlglade 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.
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. 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.
--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:
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.jsonThey 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.
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 testRefinesFileRow --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 .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:
glade test clear-cache --project .
glade test --project . --no-cache --class RefinementServiceTestUse exact class files, deterministic shards, saved duration history, and per-test timeouts for larger suites:
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. Unfiltered, unsharded runs maintain the default duration history. Test --no-cache bypasses startup and semantic cache disk operations plus semantic memory reuse. On memory-constrained hosts, --gc-aggressive reduces heap growth at the cost of more frequent garbage collection.
Run glade help test for the full flag list.
glade tui
Open the terminal UI for project, test, data, and plugin workflows.
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-uiglade dev and glade report
Run the human-focused test loop and save artifacts under .glade/runs.
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.htmlServe local Visualforce pages with hot reload. This is a preview feature for useful local /apex rendering, not exact hosted Visualforce behavior:
glade dev vf --project . --port 8080
glade dev vf --project . --addr 127.0.0.1:0 --ready-file /tmp/glade-vf-ready.jsonThe 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:
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.jsonThe 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.
glade lsp --project .
glade lsp --project . --diagnostics-onceglade profile analyze
Read a Glade native trace and emit terminal, JSON, Markdown, or pprof-compatible profile output.
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.gzglade 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.
# 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 restoreThe 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:
glade performance scan --project . --json
glade package capture --target-org packaging --namespace pkg --output .glade/packages/pkg.glade-package.json --config-snippetSee Plugins for first-party install and lock-file docs.
glade debug
Parse, profile, explain, analyze for editors, and synthesize from Salesforce debug logs.
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 . --jsonglade 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.
glade editor doctor vscode
glade editor install vscode --force
glade dap --project .glade package
Build, inspect, validate, diff, and capture managed package artifacts.
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-snippetglade 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.
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 strictglade 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.
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.apexSee 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.
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.jsonglade playground
Start the local browser playground for editing classes, running anonymous Apex, and inspecting logs, limits, traces, and org diffs.
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 . --examplesUseful flags:
--list-examplesprints built-in example ids, names, file counts, and tags. Add--project-ref name=pathto 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--projector--project-ref.--no-dbkeeps org state in memory and writes no.glade/playground/org.sqlite.--reset-on-startclears the scratch workspace and local org state before serving. It refuses--project <path>so project source is not deleted.
Built-in examples:
| ID | Name | Command |
|---|---|---|
contact-relationship-drill | Account + Contact Query | glade playground --example contact-relationship-drill |
refinement-service | Refinement Service | glade playground --example refinement-service |
trigger-contact-task | Before Insert Trigger | glade playground --example trigger-contact-task |
bulk-trigger-rollup | Bulk Trigger Rollup | glade playground --example bulk-trigger-rollup |
collection-selector | Collection Selector | glade playground --example collection-selector |
deal-desk-discount-guard | Deal Desk Discount Guard | glade playground --example deal-desk-discount-guard |
limit-counter-drill | Governor Counter Drill | glade playground --example limit-counter-drill |
governor-limits-strict | Governor Limits (strict) | glade playground --example governor-limits-strict |
map-selector-drill | Map Selector Drill | glade playground --example map-selector-drill |
org-diff-review-loop | Org Diff Review Loop | glade playground --example org-diff-review-loop |
org-diff-dml | Org Diff after DML | glade playground --example org-diff-dml |
persist-mode-ledger | Persist Mode Ledger | glade playground --example persist-mode-ledger |
renewal-health-scorecard | Renewal Health Scorecard | glade playground --example renewal-health-scorecard |
Local workbench
Open the local playground with examples:
glade playground --examples --addr 127.0.0.1:1789 --open