What I Want to Achieve
I want to create a custom ABP Commercial template that includes my own modifications (custom base classes, custom methods in existing classes,
utilities, etc.) so that every time I create a new ABP project, it starts with my customizations already in place.
Example customization: I added a comment in YourProjectAppService.cs:
protected YourProjectAppService()
{
LocalizationResource = typeof(YourProjectResource);
//this is a test app service comment // <-- My custom addition
}
What I Tried
Attempt 1: Using ~/.abp/templates directory
- Created a new project: abp new MyCustomTemplate -t app-pro
- Made my customizations to the generated files
- Zipped the solution as app-pro-9.2.0.zip
- Placed it in ~/.abp/templates/app-pro-9.2.0.zip
- Ran abp new TestProject -t app-pro
Result: The custom template was not used. ABP used the standard template instead.
Attempt 2: Understanding the cache behavior
I Ran abp clear-download-cache. This deleted all templates in ~/.abp/templates/, including my custom app-pro-9.2.0.zip
Observation: The ~/.abp/templates directory is a managed cache that ABP controls, not a place for custom templates.
My Questions
- How can I use a custom template for project creation with the current ABP Studio CLI?
- Is there a supported way to specify a custom template source directory?
- Can I override the default template download behavior?
- What is the recommended approach for organizations that want to standardize project templates?
- Is there a difference between ABP CLI and ABP Studio CLI regarding template handling?
- I'm using ABP Studio CLI (the current version)
- Should I install the old ABP CLI separately for this feature?
Environment
- ABP Version: 9.2.0
- ABP License: Commercial
- OS: macOS
- CLI: ABP Studio CLI (current version, installed via dotnet tool install -g Volo.Abp.Studio.Cli)