Use the Local Playground
Playground
Use built-in examples when you want a safe scratch workspace. Use --project when you want to run against a local SFDX project.
- Start examples without touching project source.
- Persist or reset local org state.
- Inspect snippets, SOQL, DML, limits, traces, and diffs.
glade playground starts a local browser workbench for Apex snippets, SOQL, DML, logs, limits, traces, and local org diffs. It runs from your machine and can use built-in examples, a scratch workspace, or an SFDX project.
Start with built-in examples
Load built-in examples:
glade playground --examples --addr 127.0.0.1:1789Start on one built-in example:
glade playground --example deal-desk-discount-guard --addr 127.0.0.1:1789 --open--example uses the managed scratch workspace. It cannot be combined with --project or --project-ref.
Start from an SFDX project
glade playground --project . --db .glade/playground/org.sqlite --openPrint a ready command without starting the server:
glade playground --wizard --project . --examplesPersist or reset local state
Persist playground org state to SQLite:
glade playground --db .glade/playground/org.sqlite --addr 127.0.0.1:1789 --openClear the scratch workspace and local org state before startup:
glade playground --examples --reset-on-start --addr 127.0.0.1:1789 --open--reset-on-start refuses --project so it does not delete project source.
Use memory-only state
Use memory-only org state:
glade playground --no-db --addr 127.0.0.1:1789 --openStart a local playground server:
glade playground --addr 127.0.0.1:1789 --openList examples
Print local examples without starting a server:
glade playground --list-examplesBuilt-in examples
| Group | Example | Command |
|---|---|---|
| Data and SOQL | Account + Contact Query | glade playground --example contact-relationship-drill |
| Data and SOQL | Refinement Service | glade playground --example refinement-service |
| Triggers and DML | Before Insert Trigger | glade playground --example trigger-contact-task |
| Triggers and DML | Bulk Trigger Rollup | glade playground --example bulk-trigger-rollup |
| Data and SOQL | Collection Selector | glade playground --example collection-selector |
| Business workflow | Deal Desk Discount Guard | glade playground --example deal-desk-discount-guard |
| Limits | Governor Counter Drill | glade playground --example limit-counter-drill |
| Limits | Governor Limits (strict) | glade playground --example governor-limits-strict |
| Data and SOQL | Map Selector Drill | glade playground --example map-selector-drill |
| Org diff and persistence | Org Diff Review Loop | glade playground --example org-diff-review-loop |
| Org diff and persistence | Org Diff after DML | glade playground --example org-diff-dml |
| Org diff and persistence | Persist Mode Ledger | glade playground --example persist-mode-ledger |
| Business workflow | Renewal Health Scorecard | glade playground --example renewal-health-scorecard |
What the playground shows
- Load built-in examples and inspect every source file.
- Try a small Apex behavior before adding it to a project.
- Inspect SOQL, DML, limits, traces, and org state in one place.
- Reproduce a compatibility gap before writing a fixture.
Troubleshooting
Use --reset-on-start with built-in examples when the scratch workspace or local org state gets stale. Use --no-db when a run should leave no state on disk.
Try it
Start the local playground with built-in examples:
glade playground --examples --addr 127.0.0.1:1789 --open