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 Salesforce DX 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 a Salesforce DX project.

Read the surface

Glade Playground showing built-in examples, Apex source, the Run action, and a passing local result

  1. Examples or project tree selects the source workspace.
  2. Apex Source shows the current class.
  3. Execute Anonymous holds the runnable scenario.
  4. Run executes the supported path against the selected local state.
  5. Output shows status, time, DML, rows, logs, variables, limits, org diff, and problems.
  6. The database control and reset action show whether state is memory-only or persisted.

Two-minute first scenario

Start the built-in examples with memory-only state:

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

Choose Account + Contact Query, read the Apex class and anonymous script, then press Run beside Execute Anonymous.

Expected: Status shows pass, DML shows 2, Rows shows 4, and Logs contains contacts: 3. Close the server with Ctrl-C; memory-only state is discarded.

Start directly on another built-in example when the basic loop is familiar:

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 a Salesforce DX 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 an independent project and is not affiliated with, sponsored by, or endorsed by Salesforce. Salesforce and Apex are trademarks of Salesforce, Inc. · Maintainer · Security · Releases · Apache-2.0