Apx is a VS Code extension for guided @syntax-syllogism/apx Salesforce CLI workflows: generating Apex Enterprise Pattern (AEP) artifacts (selectors, domains, services, unit-of-work, and AT4DX injection/binding metadata) without leaving the editor.
Features
- Command Palette entries and Apx sidebar actions for every supported command.
- AEP Generation commands:
SF Apx: Generate (Multiple)(sf apx generate)SF Apx: Generate Selector(sf apx generate selector)SF Apx: Generate Domain(sf apx generate domain)SF Apx: Generate Service(sf apx generate service)SF Apx: Generate Unit of Work(sf apx generate unitofwork)SF Apx: Selector Method(sf apx generate selector method)SF Apx: Selector Field Injection(sf apx generate selector field-injection)SF Apx: Generate Action(sf apx generate action)SF Apx: Generate Criteria(sf apx generate criteria)
- Dedicated Apx activity-bar view, with AEP commands grouped into Pattern Layers, Selector Injection (AT4DX), and Domain Processes (AT4DX).
- Guided native inputs:
- Salesforce org picker with
apx.defaultTargetOrgfallback. - Quick Pick-first folder picker for
--output-path. - QuickPick enums for flags such as
--trigger-operation. - Single-select QuickPick for the mutually exclusive AEP flavor choice (
--at4dxor--fflib). - Multi-select QuickPick for boolean options, including
--dry-runand the aggregate artifact toggles. - InputBox prompts for string values such as SObject names, class names, prefixes, and ordering tokens.
- Salesforce org picker with
- Aggregate generation (
apx generate) validates that at least one artifact group is selected: selector, domain, or unit of work. - Org-less helper commands (
generate action,generate criteria,generate selector method,generate selector field-injection) run without prompting for an org;generate servicelets the org prompt be skipped. - Background
sf apx ...execution throughchild_process.spawn, streamed to theApxOutput Channel. - Cancellable progress notifications while commands run.
- Human-readable CLI output by default; the extension does not force
--json. - Optional dry-run support for generation commands, with an Open Folder action after successful file generation.
- Pre-run detection for the Salesforce CLI and the apx plugin, with an install action when the plugin is missing.
Requirements
Install the Salesforce CLI and the apx plugin before running commands:
sf plugins install @syntax-syllogism/apx
The extension checks for sf and sf apx --help before the first command run. If the plugin is missing, it offers an install action.
Extension Settings
apx.defaultTargetOrg: default Salesforce org alias or username for Apx commands.
Development
Quick Start
npm install
npm test
npm run package:vsix
See docs/README.md for comprehensive developer documentation, including:
- Architecture Overview — Design and components
- Input System — How user input is collected
- Command Runner — Command execution
- Command Registry — Command definitions and generation
- Extending the Extension — Adding new commands and features
- Testing Guide — Writing and running tests
Updating Commands
Refresh the committed command registry from an apx oclif manifest:
npm run gen:commands -- vendor/apx.oclif.manifest.json src/registry/commands.generated.ts
This is needed when the apx plugin adds new commands or changes flag definitions. vendor/apx.oclif.manifest.json is a manually vendored, point-in-time copy of the apx CLI's oclif.manifest.json (generated by that repo's build) — refresh it by copying the file over whenever the CLI changes.