Skip to content

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:

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

Start on one built-in example:

bash
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

bash
glade playground --project . --db .glade/playground/org.sqlite --open

Print a ready command without starting the server:

bash
glade playground --wizard --project . --examples

Persist or reset local state

Persist playground org state to SQLite:

bash
glade playground --db .glade/playground/org.sqlite --addr 127.0.0.1:1789 --open

Clear the scratch workspace and local org state before startup:

bash
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:

bash
glade playground --no-db --addr 127.0.0.1:1789 --open

Start a local playground server:

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

List examples

Print local examples without starting a server:

bash
glade playground --list-examples

Built-in examples

GroupExampleCommand
Data and SOQLAccount + Contact Queryglade playground --example contact-relationship-drill
Data and SOQLRefinement Serviceglade playground --example refinement-service
Triggers and DMLBefore Insert Triggerglade playground --example trigger-contact-task
Triggers and DMLBulk Trigger Rollupglade playground --example bulk-trigger-rollup
Data and SOQLCollection Selectorglade playground --example collection-selector
Business workflowDeal Desk Discount Guardglade playground --example deal-desk-discount-guard
LimitsGovernor Counter Drillglade playground --example limit-counter-drill
LimitsGovernor Limits (strict)glade playground --example governor-limits-strict
Data and SOQLMap Selector Drillglade playground --example map-selector-drill
Org diff and persistenceOrg Diff Review Loopglade playground --example org-diff-review-loop
Org diff and persistenceOrg Diff after DMLglade playground --example org-diff-dml
Org diff and persistencePersist Mode Ledgerglade playground --example persist-mode-ledger
Business workflowRenewal Health Scorecardglade 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:

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

Glade is local-first Apex tooling.