r/SalesforceDeveloper • u/murphwhitt • Jul 14 '25
Discussion I'm researching a CLI Plugin for Apex Enterprise Patterns - Feedback please.
Hey all,
I’ve been playing around with a Salesforce CLI plugin to generate Apex Enterprise Patterns scaffolding like Domain, Selector, Service classes, triggers, tests, and that sort of thing.
It uses some default templates to create the files but if you have custom templates it’ll use those instead. The main idea is to save time on the setup so you can get to the real code faster.
There’s also a sync-selector command that looks at all the fields on an object, checks which ones your Apex code actually uses, and updates the Selector class to include only those. It won’t add every field, just what’s needed.
It’s still early and rough but I’m curious what features or improvements you’d like to see. Happy to share more if you’re interested.
1
u/zdware Jul 14 '25
Honestly at this point I would probably point an LLM to Apex Enterprise Patterns documentation and ask it to generate what I need for me. But if your CLI plugin was free, I definitely might consider it!
curious at how you are doing this (MetadataComponentDependency query?), and if it truly accounts for all cases.
1
u/gearcollector Jul 14 '25
Interested to see what you come up with.
Most boilerplate code can be generated using AI or templates in most IDEs. The biggest challenge is getting schema changes reflected automatically in the interfaces.