ABP CLI (Command Line Interface) is a command line tool to perform some common operations for ABP based solutions.
ABP CLI is a dotnet global tool. Install it using a command line window:
dotnet tool install -g Volo.Abp.Cli
To update an existing installation:
dotnet tool update -g Volo.Abp.Cli
Generates a new solution based on the ABP startup templates.
abp new <solution-name> [options]
abp new Acme.BookStore
- Acme.BookStore is the solution name here.
- Common convention is to name a solution is like YourCompany.YourProject. However, you can use different naming like YourProject (single level namespacing) or YourCompany.YourProduct.YourModule (three levels namespacing).
-t: Specifies the template name. Default template name is
mvc. Available templates:
mvc(default): ASP.NET Core MVC application template. Additional options:
-d: Specifies the database provider. Default provider is
ef. Available providers:
ef: Entity Framework Core.
--tiered: Creates a tiered solution where Web and Http API layers are physically separated. If not specified, it creates a layered solution which is less complex and suitable for most scenarios.
mvc-module: ASP.NET Core MVC module template. Additional options:
--no-ui: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI).
-o: Specifies the output folder. Default value is the current directory.
Adds a new ABP package to a project by,
- Adding related nuget package as a dependency to the project.
[DependsOn(...)]attribute to the module class in the project (see the module development document).
Notice that the added module may require additional configuration which is generally indicated in the documentation of the related package.
abp add-package <package-name> [options]
abp add-package Volo.Abp.MongoDB
- This example adds the Volo.Abp.MongoDB package to the project.
-p: Specifies the project (.csproj) file path. If not specified, CLI tries to find a .csproj file in the current directory.
Adds a multi-package module to a solution by finding all packages of the module, finding related projects in the solution and adding each package to the corresponding project in the solution.
A business module generally consists of several packages (because of layering, different database providr options or other reasons). Using
add-modulecommand dramatically simplifies adding a module to a solution. However, each module may require some additional configurations which is generally indicated in the documentation of the related module.
abp add-module <module-name> [options]
abp add-module Volo.Blogging
- This example add the Volo.Blogging module to the solution.
-s: Specifies the solution (.sln) file path. If not specified, CLI tries to find a .sln file in the current directory.
--skip-db-migrations: For EF Core database provider, it automatically adds a new code first migration (
Add-Migration) and updates the database (
Update-Database) if necessary. Specify this option to skip this operation.
Updating all ABP related packages can be tedious since there are many packages of the framework and modules. This command automatically updates all ABP NuGet related packages and NPM packages in a solution or project to the latest versions.
abp update [options]
- If you run in a directory with a .sln file, it updates all ABP related packages of the all projects of the solution to the latest versions.
- If you run in a directory with a .csproj file, it updates all ABP related packages of the project to the latest versions.
-p: Includes preview, beta and rc packages while checking the latest versions.
Writes basic usage information of the CLI.
abp help [command-name]
abp help # Shows a general help. abp help new # Shows help about the "new" command.