diff --git a/docs/en/cli/index.md b/docs/en/cli/index.md index b9dc63b59c2..d0048bc4d89 100644 --- a/docs/en/cli/index.md +++ b/docs/en/cli/index.md @@ -1,19 +1,19 @@ # ABP CLI -ABP CLI (Command Line Interface) is a command line tool to perform some common operations for ABP based solutions. +ABP CLI (Command Line Interface) is a command line tool to perform some common operations for ABP based solutions or ABP Studio features. ## Installation ABP CLI is a [dotnet global tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). Install it using a command line window: ````bash -dotnet tool install -g Volo.Abp.Cli +dotnet tool install -g Volo.Abp.Studio.Cli ```` To update an existing installation: ````bash -dotnet tool update -g Volo.Abp.Cli +dotnet tool update -g Volo.Abp.Studio.Cli ```` ## Global Options @@ -29,13 +29,24 @@ Here, is the list of all available commands before explaining their details: * **`help`**: Shows help on the usage of the ABP CLI. * **`cli`**: Update or remove ABP CLI. * **`new`**: Generates a new solution based on the ABP [startup templates](../solution-templates). +* **`new-module`**: Generates a new module based on the given template. +* **`new-package`**: Generates a new package based on the given template. * **`update`**: Automatically updates all ABP related NuGet and NPM packages in a solution. * **`clean`**: Deletes all `BIN` and `OBJ` folders in the current folder. * **`add-package`**: Adds an ABP package to a project. -* **`add-module`**: Adds a [multi-package application module](../modules) to a solution. +* **`add-package-ref`**: Adds package to given project. +* **`install-module`**: Adds a [multi-package application module](../modules) to a given module. +* **`install-local-module`**: Installs a local module to given module. * **`list-modules`**: Lists names of open-source application modules. * **`list-templates`**: Lists the names of available templates to create a solution. * **`get-source`**: Downloads the source code of a module. +* **`add-source-code`**: Downloads the source code and replaces package references with project references. +* **`init-solution`**: Creates ABP Studio configuration files for a given solution. +* **`kube-connect`**: Connects to kubernetes environment. +* **`kube-intercept`**: Intercepts a service running in Kubernetes environment. +* **`list-module-sources`**: Lists the remote module sources. +* **`add-module-source`**: Adds a remote module source. +* **`delete-module-source`**: Deletes a remote module source. * **`generate-proxy`**: Generates client side proxies to use HTTP API endpoints. * **`remove-proxy`**: Removes previously generated client side proxies. * **`switch-to-preview`**: Switches to the latest preview version of the ABP. @@ -110,8 +121,10 @@ For more samples, go to [ABP CLI Create Solution Samples](new-command-samples.md #### Options -* `--template` or `-t`: Specifies the template name. Default template name is `app`, which generates a web application. Available templates: - * **`app`** (default): [Application template](../solution-templates/layered-web-application). Additional options: +* `--template` or `-t`: Specifies the template name. Default template name is `app`, which generates a application solution. Available templates: + * **`empty`**: Empty solution template. + + * **`app`**: Application template. Additional options: * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: * `mvc`: ASP.NET Core MVC. There are some additional options for this template: * `--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. @@ -123,54 +136,159 @@ For more samples, go to [ABP CLI Create Solution Samples](new-command-samples.md * `--pwa`: Specifies the project as Progressive Web Application. * `blazor-server`: Blazor Server UI. There are some additional options for this template: * `--tiered`: The Auth Server and the API Host project comes as separate projects and run at different endpoints. It has 3 startup projects: *HttpApi.Host*, *AuthServer* and *Blazor* and and each runs on different endpoints. If not specified, you will have a single endpoint for your web project. - * `none`: Without UI. No front-end layer will be created. There are some additional options for this template: + * `maui-blazor`: Blazor Maui UI. There are some additional options for this template: + * `--tiered`: The Auth Server and the API Host project comes as separate projects and run at different endpoints. It has 3 startup projects: *HttpApi.Host*, *AuthServer* and *Blazor* and and each runs on different endpoints. If not specified, you will have a single endpoint for your web project. + * `no-ui`: Without UI. No front-end layer will be created. There are some additional options for this template: * `--separate-auth-server`: The Auth Server project comes as a separate project and runs at a different endpoint. It separates the Auth Server from the API Host application. If not specified, you will have a single endpoint in the server side. - * `--mobile` or `-m`: Specifies the mobile application framework. If not specified, no mobile application will be created. Available options: + * `--mobile` or `-m`: Specifies the mobile application framework. Default value is `react-native`. Available frameworks: + * `none`: Without any mobile application. * `react-native`: React Native. * `maui`: MAUI. This mobile option is only available for ABP. * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: * `ef`: Entity Framework Core. * `mongodb`: MongoDB. - * `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes: - * `leptonx-lite`: [LeptonX Lite Theme](../ui-themes/lepton-x-lite/asp-net-core.md). - * `basic`: [Basic Theme](../framework/ui/mvc-razor-pages/basic-theme.md). - * **`module`**: [Module template](../solution-templates/application-module). Additional options: - * `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI). - * **`console`**: [Console template](../get-started/console.md). - * **`app-nolayers`**: [Single-layer application template](../solution-templates/single-layer-web-application). Additional options: + * `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](Entity-Framework-Core-Other-DBMS.md) (after creating the solution). + * `--public-website`: Public Website is a front-facing website for describing your project, listing your products and doing SEO for marketing purposes. Users can login and register on your website with this website. This option is only included in PRO templates. + * `--separate-tenant-schema`: Creates a different DbContext for tenant schema. If not specified, the tenant schema is shared with the host schema. This option is only included in PRO templates. + * `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes: + * `leptonx`: LeptonX Theme. + * `basic`: Basic Theme. + + * **`app-nolayers`**: Single-layer application template. Additional options: * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: - * `mvc`: ASP.NET Core MVC. - * `angular`: Angular UI. - * `blazor`: Blazor UI. - * `blazor-server`: Blazor Server UI. - * `none`: Without UI. + * `mvc`: ASP.NET Core MVC. There are some additional options for this template: + * `angular`: Angular UI. There are some additional options for this template: + * `blazor`: Blazor UI. There are some additional options for this template: + * `blazor-server`: Blazor Server UI. There are some additional options for this template: + * `no-ui`: Without UI. No front-end layer will be created. There are some additional options for this template: * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: - * `ef`: Entity Framework Core. - * `mongodb`: MongoDB. - * `--theme`: Specifes the theme. Default theme is `leptonx-lite`. Available themes: - * `leptonx-lite`: [LeptonX Lite Theme](../ui-themes/lepton-x-lite). - * `basic`: [Basic Theme](../framework/ui/mvc-razor-pages/basic-theme.md). - * **`maui`**: .NET MAUI. A minimalist .NET MAUI application will be created if you specify this option. + * `ef`: Entity Framework Core. + * `mongodb`: MongoDB. + * `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](Entity-Framework-Core-Other-DBMS.md) (after creating the solution). + * `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes: + * `leptonx`: LeptonX Theme. + * `basic`: Basic Theme. + + * **`microservice-pro`**: Microservice solution template. Additional options: + * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: + * `mvc`: ASP.NET Core MVC. There are some additional options for this template: + * `angular`: Angular UI. There are some additional options for this template: + * `blazor`: Blazor UI. There are some additional options for this template: + * `blazor-server`: Blazor Server UI. There are some additional options for this template: + * `maui-blazor`: Blazor Maui UI. There are some additional options for this template: + * `no-ui`: Without UI. No front-end layer will be created. There are some additional options for this template: + * `--mobile` or `-m`: Specifies the mobile application framework. Default value is `react-native`. Available frameworks: + * `none`: Without any mobile application. + * `react-native`: React Native. + * `maui`: MAUI. + * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: + * `ef`: Entity Framework Core. + * `mongodb`: MongoDB. + * `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes: + * `leptonx`: LeptonX Theme. + * `basic`: Basic Theme. + * `--public-website`: Public Website is a front-facing website for describing your project, listing your products and doing SEO for marketing purposes. Users can login and register on your website with this website. This option is only included in PRO templates. + * `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. -* `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version. -* `--preview`: Use latest preview version. -* `--template-source` or `-ts`: Specifies a custom template source to use to build the project. Local and network sources can be used(Like `D:\local-template` or `https://.../my-template-file.zip`). +* `--local-framework-ref` or `-lfr`: Uses local projects references to the ABP framework instead of using the NuGet packages. It tries to find the paths from `ide-state.json`. The file is located at `%UserProfile%\.abp\studio\ui\ide-state.json` (for Windows) and `~/.abp/studio/ui/ide-state.json` (for MAC). * `--create-solution-folder` or `-csf`: Specifies if the project will be in a new folder in the output folder or directly the output folder. -* `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](../framework/data/entity-framework-core/other-dbms.md) (after creating the solution). * `--database-management-system` or `-dbms`: Sets the database management system. Default is **SQL Server**. Supported DBMS's: * `SqlServer` * `MySQL` - * `SQLite` - * `Oracle` - * `Oracle-Devart` * `PostgreSQL` -* `--local-framework-ref --abp-path`: Uses local projects references to the ABP instead of using the NuGet packages. This can be useful if you download the ABP source code and have a local reference to the framework from your application. -* `--no-random-port`: Uses template's default ports. -* `--skip-installing-libs` or `-sib`: Skip installing client side packages. -* `--skip-cache` or `-sc`: Always download the latest from our server and refresh their templates folder cache. -* `--with-public-website`: **Public Website** is a front-facing website for describing your project, listing your products and doing SEO for marketing purposes. Users can login and register on your website with this website. + * `SQLite` (`app` & `app-nolayers`) + * `Oracle` (`app` & `app-nolayers`) + * `Oracle-Devart` (`app` & `app-nolayers`) +* `--dont-run-install-libs`: Skip installing client side packages. +* `--dont-run-bundling`: Skip bundling for Blazor packages. +* `--no-kubernetes-configuration` or `-nkc`: Skips the Kubernetes configuration files. +* *Module Options*: You can skip some modules if you don't want to add them to your solution. Available commands: + * `-no-saas`: Skips the Saas module. + * `-no-gdpr`: Skips the GDPR module. + * `-no-openiddict-admin-ui`: Skips the OpenIddict Admin UI module. + * `-no-audit-logging`: Skips the Audit Logging module. + * `-no-file-management`: Skips the File Management module. + * `-no-language-management`: Skips the Language Management module. + * `-no-text-template-management`: Skips the Text Template Management module. + * `-no-chat`: Skips the Chat module. + +### new-module + +Generates a new module. -See some [examples for the new command](./new-command-samples.md) here. +````bash +abp new-module [options] +```` + +Example: + +````bash +abp new-module Acme.BookStore -t module:ddd +```` + +#### options + +* `--template` or `-t`: Specifies the template name. Default template name is `module:ddd`, which generates a DDD module. Module templates are provided by the main template, see their own startup template documentation for available modules. `empty:empty` and `module:ddd` template is available for all solution structure. +* `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. +* `--target-solution` or `-ts`: If set, the new module will be added to the given solution. Otherwise the new module will added to the closest solution in the file system. If no solution found, it will throw an error. +* `--solution-folder` or `-sf`: Specifies the target folder in the [Solution Explorer](./solution-explorer.md#folder) virtual folder system. +* `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. This option is only available if the module template supports it. You can add multiple values separated by commas, such as `ef, mongodb` if the module template supports it. Available providers: + * `ef`: Entity Framework Core. + * `mongodb`: MongoDB. +* `--ui-framework` or `-u`: Specifies the UI framework. This option is only available if the module template supports it. You can add multiple values separated by commas, such as `mvc,angular` if the module template supports it. Available frameworks: + * `mvc`: ASP.NET Core MVC. + * `angular`: Angular UI. + * `blazor`: Blazor UI. + * `blazor-server`: Blazor Server UI. + +### new-package + +Generates a new package. + +````bash +abp new-package [options] +```` + +Example: + +````bash +abp new-package --name Acme.BookStore.Domain --template lib.domain +```` + +#### options + +* `--template` or `-t`: Specifies the template name. This parameter doesn't have a default value and must be set. Available templates and their sub-options: + * `lib.class-library` + * `lib.domain-shared` + * `lib.domain` + * `lib.application-contracts` + * `lib.application` + * `--with-automapper`: Adds automapper configuration. + * `lib.ef` + * `--include-migrations`: Allows migration operations on this package. + * `--connection-string-name`: Default value is the last part of the package's namespace (or package name simply). + * `--connection-string`: Connection string value. Defaut value is null. You can set it alter. + * `lib.mongodb` + * `lib.http-api` + * `lib.http-api-client` + * `lib.mvc` + * `lib.blazor` + * `lib.blazor-wasm` + * `lib.blazor-server` + * `host.http-api` + * `--with-serilog`: Includes Serilog configuration. + * `--with-swagger`: Includes Swagger configuration. + * `host.mvc` + * `--with-serilog`: Includes Serilog configuration. + * `--with-swagger`: Includes Swagger configuration. + * `host.blazor-wasm` + * `--backend`: Name of the backend project in the module (not path). + * `host.blazor-server` + * `csharp.console` + * `csharp.library` +* `--module-file` or `-m`: If set, the new package will be added to the given module. Otherwise the new package will added to the closest module in the file system. If no module found, it will throw an error. +* `--name` or `-n`: Specifies the name of the package. If not set, a name based on the template type and module name will be generated. +* `--folder` or `-f`: Specifies the target folder in the target module's virtual folder system. ### update @@ -243,44 +361,65 @@ abp add-package Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic > - Volo.Abp.AspNetCore.Components.Web.BasicTheme > - Volo.Abp.AspNetCore.Components.Server.BasicTheme +### add-package-ref + +Adds one or more package reference to target project, also adds ABP module dependency. Both reference and target projects must belong to same module. + +````bash +abp add-package-ref [options] +```` -### add-module +Example: + +````bash +abp add-package-ref Acme.BookStore.Domain +abp add-package-ref "Acme.BookStore.Domain Acme.BookStore.Domain.Shared" -t Acme.BookStore.Web +```` -Adds a [multi-package application module](../modules) 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. +#### Options -It can also create a new module for your solution and add it to your solution. See `--new` option. +* `--target-project` or `-t`: Name of the project that reference will be added. If not set, project in the current directory will be used. -> A business module generally consists of several packages (because of layering, different database provider options or other reasons). Using `add-module` command 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. +### install-module -Usage: +Installs a module, that is published as nuget packages, to a local module. Project relations are created according the types of the projects. For example: a `lib.domain-shared` project is added to `lib.domain-shared` project ````bash -abp add-module [options] +abp install-module [options] ```` -Examples: +Example: -```bash -abp add-module Volo.Blogging -``` +````bash +abp install-module Volo.Blogging -* This example adds the `Volo.Blogging` module to the solution. +abp install-module Volo.Blogging -t "modules/crm/Acme.Crm.abpmdl" +```` -```bash -abp add-module ProductManagement --new --add-to-solution-file -``` +#### Options + +* `--target-module` or `-t`: Path (or folder path) of the target module that the other module will be installed to. If not set, the closest module to the current directory will be used. +* `--version` or `-v`: Nuget version of the module to be installed. -* This command creates a fresh new module customized for your solution (named `ProductManagement`) and adds it to your solution. +### install-local-module +Installs one module to another. Project relations are created according the types of the projects. For example: a `lib.domain-shared` project is added to `lib.domain-shared` project + +````bash +abp install-local-module [options] +```` + +Example: + +````bash +abp install-local-module Acme.OrderManagement + +abp install-local-module Acme.OrderManagement -t "modules/crm/Acme.Crm.abpmdl" +```` #### Options -* `--solution` or `-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. -* `-sp` or `--startup-project`: Relative path to the project folder of the startup project. Default value is the current folder. -* `--new`: Creates a fresh new module (customized for your solution) and adds it to your solution. -* `--with-source-code`: Downloads the source code of the module to your solution folder and uses local project references instead of NuGet/NPM packages. This options is always `True` if `--new` is used. -* `--add-to-solution-file`: Adds the downloaded/created module to your solution file, so you will also see the projects of the module when you open the solution on a IDE. (only available when `--with-source-code` is `True`.) +* `--target-module` or `-t`: Path (or folder path) of the target module that the other module will be installed to. If not set, the closest module to the current directory will be used. ### list-modules @@ -337,6 +476,157 @@ abp get-source Volo.Blogging --local-framework-ref --abp-path D:\GitHub\abp * `--preview`: If no version option is specified, this option specifies if latest [preview version](../release-info/previews.md) will be used instead of latest stable version. * `--local-framework-ref --abp-path`: Path of [ABP GitHub repository](https://github.com/abpframework/abp) in your computer. This will be used for converting project references to your local system. If this is not specified, project references will be converted to NuGet references. +### add-source-code + +Downloads the source code of a module and replaces package references with project references. This command only works if your ABP Commercial License has source-code access, or if source-code of the target module is free to all type of ABP Commercial Licenses. + +````bash +abp add-source-code [options] +```` + +Example: + +````bash +abp add-source-code Volo.Chat --add-to-solution-file +```` + +#### Options + +* `--target-module` or `-t`: The module that will refer the downloaded source code. If not set, the module in the current directory will be used. +* `--add-to-solution-file`: Adds the downloaded source code to C# solution file and ABP Studio solution file. + +### init-solution + +Creates necessary files for a solution to be readable by ABP Studio. If the solution is generated via ABP Studio, you don't need this command. But it is not generated by ABP Studio, you need this command to make it work with ABP Studio. + +````bash +abp init-solution [options] +```` + +Example: + +````bash +abp init-solution --name Acme.BookStore +```` + +#### Options + +* `--name` or `-n`: Name for the solution. If not set, it will be the same as the name of closest c# solution in the file system. + +### kube-connect + +Connects to Kubernetes cluster. Press `ctrl+c` to disconnect. + +````bash +abp kube-connect [options] +```` + +Example: + +````bash +abp kube-connect + +abp kube-connect -p Default.abpk8s.json + +abp kube-connect -c docker-desktop -ns mycrm-local +```` + +#### Options + +* `--profile` or `-p`: Kubernetes Profile path or name to be used. Path can be relative (to current directory) or full path, or you can simply give the name of profile if you run this command in same directory with the solution or profile. This parameter is not needed if you use `--namespace` and `--context` parameters. +* `--namespace` or `-ns`: The namespace that services running on. +* `--context` or `-c`: The context that services running in. +* `--wireguard-password` or `-wp`: Wireguard password for the profile. This is not needed if you already set it on the ABP Studio user interface. +* `--solution-id` or `-si`: Id of the solution. If not set, the closest solution in file system will be used. + +### kube-intercept + +Intercepts a service running in Kubernetes environment. Press `ctrl+c` to stop interception. + +````bash +abp kube-intercept [options] +```` + +Example: + +````bash +abp kube-intercept mycrm-product-service -ns mycrm-local + +abp kube-intercept mycrm-product-service -ns mycrm-local -a MyCrm.ProductService.HttpApi.Host.csproj + +abp kube-intercept mycrm-product-service -ns mycrm-local -a MyCrm.ProductService.HttpApi.Host.csproj -pm 8080:80,8081:443 +```` + +#### Options + +* `--application` or `-a`: Relative or full path of the project that will intercept the service. If not set, the project in the current directory will be used. +* `--namespace` or `-ns`: The namespace that service running on. +* `--context` or `-sc`: The context that service running in. Default value is `docker-desktop`. +* `--port-mappings` or `-pm`: Port mappings for the service. + +### list-module-sources + +With this command, you can see the list of remote module sources that you can use to install modules. It is similar to the NuGet feed list in Visual Studio. + +````bash +abp list-module-sources +```` + +### add-module-source + +Adds a remote module source to the list of sources that you can use to install modules. + +````bash +abp add-module-source [options] +```` + +You can create your own module source and add it to the list. It accepts a name and a url or a path as parameter. If you provide a path, it should be a local path that contains the modules json file. If you provide a url, it should be a url that contains the modules json file. The json file should be in the following format: + +````json +{ + "name": "ABP Open Source Modules", + "modules" : { + "Volo.Abp.Account": {}, + "Volo.Abp.AuditLogging": {}, + "Volo.Abp.Identity": {}, + ... + } +} +```` + +When you add a module source, you can install modules from that source using the `install-module` command. It attempts to find the package from NuGet, such as `Volo.Abp.Account.Installer`. You can configure a private NuGet feed and publish your modules to that feed. Each module has an installer package that is utilized to install the module into a solution. When you publish your module to a private feed, you should also publish the installer package to the same feed. + +Example: + +````bash +abp add-module-source -n "Custom Source" -p "D:\packages\abp\modules.json" + +abp add-module-source -n "Custom Http Source" -p "https://raw.githubusercontent.com/x/abp-module-store/main/abp-module-store.json" +```` + +#### Options + +* `--name` or `-n`: The name of the module source. +* `--path` or `-p`: The path of the module source. It can be a local path or a url. + +### delete-module-source + +Deletes a remote module source from the list of sources that you can use to install modules. + +````bash +abp delete-module-source [options] +```` + +Example: + +````bash +abp delete-module-source -n "Custom Source" +```` + +#### Options + +* `--name` or `-n`: The name of the module source. + ### generate-proxy Generates Angular, C# or JavaScript service proxies for your HTTP APIs to make easy to consume your services from the client side. Your host (server) application must be up and running before running this command. diff --git a/docs/en/cli/new-command-samples.md b/docs/en/cli/new-command-samples.md index a30ce692e0a..ad451666152 100644 --- a/docs/en/cli/new-command-samples.md +++ b/docs/en/cli/new-command-samples.md @@ -67,7 +67,7 @@ The following commands are for creating MVC UI projects: * **Public Website**, Entity Framework Core, no mobile app, creates the project in a new folder: ```bash - abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef -csf --with-public-website + abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef -csf --public-website ``` _Note that Public Website is only included in PRO templates._ @@ -146,61 +146,18 @@ It's a template of a basic .NET console application with ABP module architecture ## Module -Module are reusable sub applications used by your main project. Using ABP Module is a best practice if you are building a microservice solution. As modules are not final applications, each module has all the frontend UI projects and database providers. The module template comes with an MVC UI to be able to develop without the final solution. But if you will develop your module under a final solution, you add `--no-ui` parameter to exclude MVC UI project. +Module are reusable sub applications used by your main project. Using ABP Module is a best practice if you are building a microservice solution. As modules are not final applications, each module could contains different frontend UI projects and database providers. -* Included frontends: `MVC`, `Angular`, `Blazor`. Included database providers: `Entity Framework Core`, `MongoDB`. Includes MVC startup project. +* Available frontends: `MVC`, `Angular`, `Blazor`. Available database providers: `Entity Framework Core`, `MongoDB`. ```bash - abp new Acme.IssueManagement -t module + abp new-module Acme.IssueManagement ``` -* The same with the upper but doesn't include MVC startup project. - ```bash - abp new Acme.IssueManagement -t module --no-ui - ``` - -* Creates the module and adds it to your solution - - ```bash - abp new Acme.IssueManagement -t module --add-to-solution-file - ``` - -## Create a solution from a specific version - -When you create a solution, it always creates with the latest version. To create a project from an older version, you can pass the `--version` parameter. - -* Create a solution from v3.3.0, with Angular UI and Entity Framework Core. - - ```bash - abp new Acme.BookStore -t app -u angular -m none --database-provider ef -csf --version 3.3.0 - ``` - -To get the ABP version list, checkout following link: https://www.nuget.org/packages/Volo.Abp.Core/ - -## Create from a custom template - -ABP CLI uses the default [app template](https://github.com/abpframework/abp/tree/dev/templates/app) to create your project. If you want to create a new solution from your customized template, you can use the parameter `--template-source`. - -* MVC UI, Entity Framework Core, no mobile app, using the template in `c:\MyProjects\templates\app` directory. - - ```bash - abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef --template-source "c:\MyProjects\templates\app" - ``` - -* Same with the previous one except this command retrieves the template from the URL `https://myabp.com/app-template.zip`. - - ```bash - abp new Acme.BookStore -t app -u mvc --mobile none --database-provider ef --template-source https://myabp.com/app-template.zip - ``` - -## Create a preview version - -ABP CLI always uses the latest version. In order to create a solution from a preview (RC) version add the `--preview` parameter. - -* Blazor UI, Entity Framework Core, no mobile, **preview version**, creates the project in a new folder: +* The same with the upper but includes MVC and angular projects. ```bash - abp new Acme.BookStore -t app -u blazor --mobile none -csf --preview + abp new-module Acme.IssueManagement -u mvc,angular ``` ## Choose database management system @@ -213,18 +170,6 @@ The default database management system (DBMS) is `Entity Framework Core` / ` SQL abp new Acme.BookStore -u angular --database-management-system PostgreSQL -csf ``` - - -## Use static HTTP ports - -ABP CLI always assigns random ports to the hostable projects. If you need to keep the default ports and create a solution always with the same HTTP ports, add the parameter `--no-random-port`. - -* MVC UI, Entity Framework Core, **static ports**, creates the project in a new folder: - - ```bash - abp new Acme.BookStore --no-random-port -csf - ``` - ## Use local ABP references ABP libraries are referenced from NuGet by default in the ABP solutions. Sometimes you need to reference ABP libraries locally to your solution. This is useful to debug the framework itself. Your local ABP 's root directory must have the `Volo.Abp.sln` file. You can copy the content of the following directory to your file system https://github.com/abpframework/abp/tree/dev/framework diff --git a/docs/en/studio/cli.md b/docs/en/studio/cli.md deleted file mode 100644 index 2315bf65e0e..00000000000 --- a/docs/en/studio/cli.md +++ /dev/null @@ -1,355 +0,0 @@ -# ABP Studio CLI - -ABP Studio CLI is a command line tool that extends [ABP CLI](../cli) by adding more commands to perform operations of ABP Studio features. - -## Installation - -ABP Studio CLI is installed automatically when you install ABP Studio. - -## Commands - -As ABP Studio CLI extends [ABP CLI](../cli), all commands provided by [ABP CLI](../cli) is also valid for ABP Studio CLI. Here, is the list of additional commands before explaining their details: - -* new-solution: Generates a new solution based on the ABP Studio [startup templates](../solution-templates). -* new-module: Generates a new module based on the given template. -* new-package: Generates a new package based on the given template. -* add-package-ref: Adds package to given project. -* add-source: Downloads the source code and replaces package references with project references. -* init-solution: Creates ABP Studio configuration files for a given solution. -* install-local-module: Installs a local module to given module. -* install-module: Installs a module to given module via NuGet packages. -* kube-connect: Connects to kubernetes environment. -* kube-intercept: Intercepts a service running in Kubernetes environment. - -### new-solution - -Generates a new solution based on the ABP Studio [startup templates](../solution-templates). - -````bash -abpc new-solution [options] -```` - -Example: - -````bash -abpc new-solution 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). - -#### options - -* `--template` or `-t`: Specifies the template name. Default template name is `empty`, which generates a empty solution. Available templates: - * **`empty`**: Empty solution template. - * **`app-pro`**: Application template. Additional options: - * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: - * `mvc`: ASP.NET Core MVC. There are some additional options for this template: - * `--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. - * `angular`: Angular UI. There are some additional options for this template: - * `--separate-auth-server`: The Auth Server project comes as a separate project and runs at a different endpoint. It separates the Auth Server from the API Host application. If not specified, you will have a single endpoint in the server side. - * `--pwa`: Specifies the project as Progressive Web Application. - * `blazor`: Blazor UI. There are some additional options for this template: - * `--separate-auth-server`The Auth Server project comes as a separate project and runs at a different endpoint. It separates the Auth Server from the API Host application. If not specified, you will have a single endpoint in the server side. - * `--pwa`: Specifies the project as Progressive Web Application. - * `blazor-server`: Blazor Server UI. There are some additional options for this template: - * `--tiered`: The Auth Server and the API Host project comes as separate projects and run at different endpoints. It has 3 startup projects: *HttpApi.Host*, *AuthServer* and *Blazor* and and each runs on different endpoints. If not specified, you will have a single endpoint for your web project. - * `maui-blazor`: Blazor Maui UI. There are some additional options for this template: - * `--tiered`: The Auth Server and the API Host project comes as separate projects and run at different endpoints. It has 3 startup projects: *HttpApi.Host*, *AuthServer* and *Blazor* and and each runs on different endpoints. If not specified, you will have a single endpoint for your web project. - * `no-ui`: Without UI. No front-end layer will be created. There are some additional options for this template: - * `--separate-auth-server`: The Auth Server project comes as a separate project and runs at a different endpoint. It separates the Auth Server from the API Host application. If not specified, you will have a single endpoint in the server side. - * `--mobile` or `-m`: Specifies the mobile application framework. Default value is `react-native`. Available frameworks: - * `none`: Without any mobile application. - * `react-native`: React Native. - * `maui`: MAUI. - * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: - * `ef`: Entity Framework Core. - * `mongodb`: MongoDB. - * `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](../framework/data/entity-framework-core/other-dbms.md) (after creating the solution). - * `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes: - * `leptonx`: LeptonX Theme. - * `basic`: Basic Theme. - - * **`app-nolayers-pro`**: Single-layer application template. Additional options: - * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: - * `mvc`: ASP.NET Core MVC. There are some additional options for this template: - * `angular`: Angular UI. There are some additional options for this template: - * `blazor`: Blazor UI. There are some additional options for this template: - * `blazor-server`: Blazor Server UI. There are some additional options for this template: - * `no-ui`: Without UI. No front-end layer will be created. There are some additional options for this template: - * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: - * `ef`: Entity Framework Core. - * `mongodb`: MongoDB. - * `--connection-string` or `-cs`: Overwrites the default connection strings in all `appsettings.json` files. The default connection string is `Server=localhost;Database=MyProjectName;Trusted_Connection=True` for EF Core and it is configured to use the SQL Server. If you want to use the EF Core, but need to change the DBMS, you can change it as [described here](../framework/data/entity-framework-core/other-dbms.md) (after creating the solution). - * `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes: - * `leptonx`: LeptonX Theme. - * `basic`: Basic Theme. - - * **`microservice-pro`**: Microservice solution template. Additional options: - * `--ui` or `-u`: Specifies the UI framework. Default framework is `mvc`. Available frameworks: - * `mvc`: ASP.NET Core MVC. There are some additional options for this template: - * `angular`: Angular UI. There are some additional options for this template: - * `blazor`: Blazor UI. There are some additional options for this template: - * `blazor-server`: Blazor Server UI. There are some additional options for this template: - * `maui-blazor`: Blazor Maui UI. There are some additional options for this template: - * `no-ui`: Without UI. No front-end layer will be created. There are some additional options for this template: - * `--mobile` or `-m`: Specifies the mobile application framework. Default value is `react-native`. Available frameworks: - * `none`: Without any mobile application. - * `react-native`: React Native. - * `maui`: MAUI. - * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: - * `ef`: Entity Framework Core. - * `mongodb`: MongoDB. - * `--theme`: Specifes the theme. Default theme is `leptonx`. Available themes: - * `leptonx`: LeptonX Theme. - * `basic`: Basic Theme. -* `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. -* `--database-management-system` or `-dbms`: Sets the database management system. Default is **SQL Server**. Supported DBMS's: - * `SqlServer` - * `MySQL` - * `PostgreSQL` - * `SQLite` (`app-pro` & `app-nolayers-pro`) - * `Oracle` (`app-pro` & `app-nolayers-pro`) - * `Oracle-Devart` (`app-pro` & `app-nolayers-pro`) -* `--dont-run-install-libs`: Skip installing client side packages. -* `--dont-run-bundling`: Skip bundling for Blazor packages. -* `--no-kubernetes-configuration` or `-nkc`: Skips the Kubernetes configuration files. -* *Module Options*: You can skip some modules if you don't want to add them to your solution. Available commands: - * `-no-saas`: Skips the Saas module. - * `-no-gdpr`: Skips the GDPR module. - * `-no-openiddict-admin-ui`: Skips the OpenIddict Admin UI module. - * `-no-audit-logging`: Skips the Audit Logging module. - * `-no-file-management`: Skips the File Management module. - * `-no-language-management`: Skips the Language Management module. - * `-no-text-template-management`: Skips the Text Template Management module. - * `-no-chat`: Skips the Chat module. -### new-module - -Generates a new module. - -````bash -abpc new-module [options] -```` - -Example: - -````bash -abpc new-module Acme.BookStore -t module:ddd -```` - -#### options - -* `--template` or `-t`: Specifies the template name. Default template name is `empty`, which generates a empty module. Module templates are provided by the main template, see their own startup template documentation for available modules. `empty` and `module:ddd` template is available for all solution structure. -* `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. -* `--target-solution` or `-ts`: If set, the new module will be added to the given solution. Otherwise the new module will added to the closest solution in the file system. If no solution found, it will throw an error. -* `--solution-folder` or `-sf`: Specifies the target folder in the [Solution Explorer](./solution-explorer.md#folder) virtual folder system. -* `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. This option is only available if the module template supports it. You can add multiple values separated by commas, such as `ef, mongodb` if the module template supports it. Available providers: - * `ef`: Entity Framework Core. - * `mongodb`: MongoDB. -* `--ui-framework` or `-u`: Specifies the UI framework. Default framework is `mvc`. This option is only available if the module template supports it. You can add multiple values separated by commas, such as `mvc,angular` if the module template supports it. Available frameworks: - * `mvc`: ASP.NET Core MVC. - * `angular`: Angular UI. - * `blazor`: Blazor UI. - * `blazor-server`: Blazor Server UI. - -### new-package - -Generates a new package. - -````bash -abpc new-package [options] -```` - -Example: - -````bash -abpc new-package --name Acme.BookStore.Domain --template lib.domain -```` - -#### options - -* `--template` or `-t`: Specifies the template name. This parameter doesn't have a default value and must be set. Available templates and their sub-options: - * `lib.class-library` - * `lib.domain-shared` - * `lib.domain` - * `lib.application-contracts` - * `lib.application` - * `--with-automapper`: Adds automapper configuration. - * `lib.ef` - * `--include-migrations`: Allows migration operations on this package. - * `--connection-string-name`: Default value is the last part of the package's namespace (or package name simply). - * `--connection-string`: Connection string value. Defaut value is null. You can set it alter. - * `lib.mongodb` - * `lib.http-api` - * `lib.http-api-client` - * `lib.mvc` - * `lib.blazor` - * `lib.blazor-wasm` - * `lib.blazor-server` - * `host.http-api` - * `--with-serilog`: Includes Serilog configuration. - * `--with-swagger`: Includes Swagger configuration. - * `host.mvc` - * `--with-serilog`: Includes Serilog configuration. - * `--with-swagger`: Includes Swagger configuration. - * `host.blazor-wasm` - * `--backend`: Name of the backend project in the module (not path). - * `host.blazor-server` - * `csharp.console` - * `csharp.library` -* `--module-file` or `-m`: If set, the new package will be added to the given module. Otherwise the new package will added to the closest module in the file system. If no module found, it will throw an error. -* `--name` or `-n`: Specifies the name of the package. If not set, a name based on the template type and module name will be generated. -* `--folder` or `-f`: Specifies the target folder in the target module's virtual folder system. - - -### add-package-ref - -Adds one or more package reference to target project, also adds ABP module dependency. Both reference and target projects must belong to same module. - -````bash -abpc add-package-ref [options] -```` - -Example: - -````bash -abpc add-package-ref Acme.BookStore.Domain -abpc add-package-ref "Acme.BookStore.Domain Acme.BookStore.Domain.Shared" -t Acme.BookStore.Web -```` - -#### options - -* `--target-project` or `-t`: Name of the project that reference will be added. If not set, project in the current directory will be used. - -### add-source - -Downloads the source code of a module and replaces package references with project references. This command only works if your ABP License has source-code access, or if source-code of the target module is free to all type of ABP Licenses. - -````bash -abpc add-source [options] -```` - -Example: - -````bash -abpc add-source Volo.Chat --add-to-solution-file -```` - -#### options - -* `--target-module` or `-t`: The module that will refer the downloaded source code. If not set, the module in the current directory will be used. -* `--add-to-solution-file`: Adds the downloaded source code to C# solution file and ABP Studio solution file. - -### init-solution - -Creates necessary files for a solution to be readable by ABP Studio. If the solution is generated via ABP Studio, you don't need this command. But it is not generated by ABP Studio, you need this command to make it work with ABP Studio. - -````bash -abpc init-solution [options] -```` - -Example: - -````bash -abpc init-solution --name Acme.BookStore -```` - -#### options - -* `--name` or `-n`: Name for the solution. If not set, it will be the same as the name of closest c# solution in the file system. - -### install-local-module - -Installs one module to another. Project relations are created according the types of the projects. For example: a `lib.domain-shared` project is added to `lib.domain-shared` project - -````bash -abpc install-local-module [options] -```` - -Example: - -````bash -abpc install-local-module Acme.OrderManagement - -abpc install-local-module Acme.OrderManagement -t "modules/crm/Acme.Crm.abpmdl" -```` - -#### options - -* `--target-module` or `-t`: Path (or folder path) of the target module that the other module will be installed to. If not set, the closest module to the current directory will be used. - -### install-module - -Installs a module, that is published as nuget packages, to a local module. Project relations are created according the types of the projects. For example: a `lib.domain-shared` project is added to `lib.domain-shared` project - -````bash -abpc install-module [options] -```` - -Example: - -````bash -abpc install-module Volo.Blogging - -abpc install-module Volo.Blogging -t "modules/crm/Acme.Crm.abpmdl" -```` - -#### options - -* `--target-module` or `-t`: Path (or folder path) of the target module that the other module will be installed to. If not set, the closest module to the current directory will be used. -* `--version` or `-v`: Nuget version of the module to be installed. - -### kube-connect - -Connects to Kubernetes cluster. Press `ctrl+c` to disconnect. - -````bash -abpc kube-connect [options] -```` - -Example: - -````bash -abpc kube-connect - -abpc kube-connect -p Default.abpk8s.json - -abpc kube-connect -c docker-desktop -ns mycrm-local -```` - -#### options - -* `--profile` or `-p`: Kubernetes Profile path or name to be used. Path can be relative (to current directory) or full path, or you can simply give the name of profile if you run this command in same directory with the solution or profile. This parameter is not needed if you use `--namespace` and `--context` parameters. -* `--namespace` or `-ns`: The namespace that services running on. -* `--context` or `-c`: The context that services running in. -* `--wireguard-password` or `-wp`: Wireguard password for the profile. This is not needed if you already set it on the ABP Studio user interface. -* `--solution-id` or `-si`: Id of the solution. If not set, the closest solution in file system will be used. - -### kube-intercept - -Intercepts a service running in Kubernetes environment. Press `ctrl+c` to stop interception. - -````bash -abpc kube-intercept [options] -```` - -Example: - -````bash -abpc kube-intercept mycrm-product-service -ns mycrm-local - -abpc kube-intercept mycrm-product-service -ns mycrm-local -a MyCrm.ProductService.HttpApi.Host.csproj - -abpc kube-intercept mycrm-product-service -ns mycrm-local -a MyCrm.ProductService.HttpApi.Host.csproj -pm 8080:80,8081:443 -```` - -#### options - -* `--application` or `-a`: Relative or full path of the project that will intercept the service. If not set, the project in the current directory will be used. -* `--namespace` or `-ns`: The namespace that service running on. -* `--context` or `-sc`: The context that service running in. Default value is `docker-desktop`. -* `--port-mappings` or `-pm`: Port mappings for the service. - -## See Also - -* [ABP CLI](../cli) diff --git a/docs/en/studio/images/preference-theme-change.png b/docs/en/studio/images/preference-theme-change.png index 8e2dc109b91..e1d5d95532e 100644 Binary files a/docs/en/studio/images/preference-theme-change.png and b/docs/en/studio/images/preference-theme-change.png differ diff --git a/docs/en/studio/index.md b/docs/en/studio/index.md index 6965a50a040..a44b768cddf 100644 --- a/docs/en/studio/index.md +++ b/docs/en/studio/index.md @@ -16,5 +16,4 @@ If you haven't installed yet, please see [the installation guide](installation.m - Fundamentals - [Solution Explorer](./solution-explorer.md) - [Running Applications](./running-applications.md) - - [Working with Kubernetes](./kubernetes.md) - - [CLI](./cli.md) \ No newline at end of file + - [Working with Kubernetes](./kubernetes.md) \ No newline at end of file