SF Apex
API-native Apex lifecycle workflows for pi: authoring guidance, diagnostics, trace/log/watch, Anonymous Apex, and targeted tests.
What it does
Owns the lean Apex lifecycle loop in pi: native Apex discovery/preflight, authoring plan hints, Apex-owned diagnostics handoff, API-native trace flags, log fetch/watch/analyze, Anonymous Apex probes, coverage summaries, and targeted test runs. Source edits remain normal Pi file operations; full evidence is persisted as Apex Artifacts while tool output stays compact.
Start
Open the extension from its primary command:
text
/sf-apexOpen its Manager detail or change its package state with:
text
/sf-pi open sf-apex
/sf-pi enable sf-apex
/sf-pi disable sf-apexSafety notes
- No startup org probes; Salesforce connections are resolved only during explicit sf_apex tool actions.
- Lifecycle actions use @salesforce/core / Tooling REST APIs as the fast native path; missing lifecycle capabilities should become small native actions instead of subprocess fallbacks.
- Trace flags are bounded by a default TTL and can be stopped explicitly.
- Anonymous Apex bodies are classified for mutation-like tokens and require allow_mutation=true when risky.
- Targeted tests are scoped to explicit classes or methods; v1 does not provide an org-wide test dashboard.
Exact reference
Show commands, tools, providers, and hooks
- Extension id:
sf-apex - Intent: Build apps
- Category: Agent Tool
- Maturity: experimental
- Default state: on
- Commands:
/sf-apex - LLM tools:
sf_apex - Providers: none
- Events/hooks:
session_start,tool_result
For contributors
Troubleshooting
See the Troubleshooting section in the full README for extension-specific recovery steps.