aer exec
Execute anonymous Apex code
Synopsis
Execute anonymous Apex code.
The Apex code can be provided as a positional argument or piped via stdin. Use the –path flag to specify source directories containing additional Apex classes.
aer exec [apex-code] [flags]Options
--allow-callouts allow outbound HTTP callouts to endpoints permitted by Remote Site Settings or Named Credentials
--bootstrap-db string bootstrap SQLite database to seed before execution
--certificate strings load a PEM-encoded certificate key file; the certificate name is derived from the filename (extension stripped; repeatable)
--certificate-dir strings load every PEM file (.pem/.crt/.cer/.key) in a directory as certificate keys named after their filenames (repeatable)
--certificate-key strings associate a certificate developer name with an inline base64-encoded PEM key (format: CertName=BASE64; e.g. the output of 'openssl base64 -A'; repeatable)
--db string SQLite database file to use (for debugging, default: in-memory)
--debug Enable debug mode with DAP server
-d, --default-namespace string treat loaded code as if it belongs to the specified namespace
--enforce-governor-limits enforce governor limit checks during anonymous execution
--feature strings enable optional features (PersonAccounts, HealthCloud, LiveAgent, MultiCurrency, FinancialServicesCloud, B2BCommerce, RevenueCloud, LifeSciencesCloud, ConsumerGoodsCloud, ManufacturingCloud, Scheduler, CRMAnalytics, PrivacyCenter, ExperienceCloud, FieldService, Knowledge, StateAndCountryPicklist)
-h, --help help for exec
--package strings package files to load (can be specified multiple times)
--package-dir strings directories containing .pkg files to load (can be specified multiple times)
-p, --path strings source paths containing Apex classes (can be specified multiple times)
--profile file[="-"] write Apex profiling data to file (use --profile without a file to open in Perfetto)
--sandbox set Organization.IsSandbox to true
--timezone string default timezone for users (e.g., America/Los_Angeles, America/Chicago)
--trace file[="-"] write Apex execution trace to file (use --trace without a file to open in Perfetto)Options inherited from parent commands
-q, --quiet suppress progress output
-v, --verbose count increase verbosity (repeat for more detail)SEE ALSO
- aer - aer is the Apex Execution Runtime