docs/en/studio/custom-commands.md
//[doc-seo]
{
"Description": "Learn how to create and manage custom commands in ABP Studio to automate build, deployment, and other workflows."
}
//[doc-nav]
{
"Next": {
"Name": "Working with ABP Suite",
"Path": "studio/working-with-suite"
}
}
Custom commands allow you to define reusable terminal commands that appear in context menus throughout ABP Studio. You can use them to automate repetitive tasks such as building Docker images, installing Helm charts, running deployment scripts, or executing any custom workflow.
Note: This is an advanced feature primarily intended for teams working with Kubernetes deployments or complex build/deployment workflows. If you're developing a standard application without custom DevOps requirements, you may not need this feature.
To manage custom commands, right-click on the solution root in Solution Explorer and select Manage Custom Commands.
The management window displays all defined commands with options to add, edit, or delete them.
Click the Add New Command button to open the command editor dialog.
| Property | Description |
|---|---|
| Command Name | A unique identifier for the command (used internally) |
| Display Name | The text shown in context menus |
| Terminal Command | The PowerShell command to execute. Use &&& to chain multiple commands |
| Working Directory | Optional. The directory where the command runs (relative to solution path) |
| Condition | Optional. A Scriban expression that determines when the command is visible |
| Require Confirmation | When enabled, shows a confirmation dialog before execution |
| Confirmation Text | The message shown in the confirmation dialog |
Trigger targets determine where your command appears in context menus. You can select multiple targets for a single command.
| Target | Location |
|---|---|
| Helm Charts Root | Kubernetes panel > Helm tab > root node |
| Helm Main Chart | Kubernetes panel > Helm tab > main chart |
| Helm Sub Chart | Kubernetes panel > Helm tab > sub chart |
| Kubernetes Service | Kubernetes panel > Kubernetes tab > service |
| Solution Runner Root | Solution Runner panel > profile root |
| Solution Runner Folder | Solution Runner panel > folder |
| Solution Runner Application | Solution Runner panel > application |
Execution targets define where the command actually runs. This enables cascading execution:
Commands support Scriban template syntax for dynamic values. Use {%{{{variable}}}%} to insert context-specific data.
Helm Charts:
| Variable | Description |
|---|---|
profile.name | Kubernetes profile name |
profile.namespace | Kubernetes namespace |
chart.name | Current chart name |
chart.path | Chart directory path |
metadata.* | Hierarchical metadata values (e.g., metadata.imageName) |
secrets.* | Secret values (e.g., secrets.registryPassword) |
Kubernetes Service:
| Variable | Description |
|---|---|
name | Service name |
profile.name | Kubernetes profile name |
profile.namespace | Kubernetes namespace |
mainChart.name | Parent main chart name |
chart.name | Related sub chart name |
chart.metadata.* | Chart-specific metadata |
Solution Runner (Root, Folder, Application):
| Variable | Description |
|---|---|
profile.name | Run profile name |
profile.path | Profile file path |
application.name | Application name (Application context only) |
application.baseUrl | Application URL (Application context only) |
folder.name | Folder name (Folder/Application context) |
metadata.* | Profile metadata values |
secrets.* | Profile secret values |
Here's an example command that builds a Docker image for Helm charts:
Command Properties:
buildDockerImageBuild Docker Image./build-image.ps1 -ProjectPath {%{{{metadata.projectPath}}}%} -ImageName {%{{{metadata.imageName}}}%}etc/helm{%{{{metadata.projectPath}}}%}This command:
projectPath metadata definedbuild-image.ps1 script with dynamic parameters from metadata