Skip to main content
Version: 3.22.0

CLI Commands for AutoCode Solution Generator

Just after running the command, be sure it is the latest version and up-to-date. CLI_is_up_to_date

CLI_is_not_up_to_date *Version numbers are representational. Please check Release Notes for latest version

1) Create​

From scratch​

./genesis create --path {full_or_relative_path_to_new_project}

genesis command may not be in the system path, so you may need to use ./genesis instead of genesis

If the specified path does not exist, it will be created. If you don’t specify a path, it will be created on your current folder with the name of {YourSolutionName}

Some examples:

./genesis create ./
./genesis create --path ./MyUnicornProject

Using an existing config​

If you've already ran create command before, you have config.json file/s in Configs folder.

When you use that JSON file, you'll be skipping all the questions asked throughout generation process.

./genesis create --from-config {your_config_file_in_Configs_folder.json}

Sample config.json:

{
"Path": "/PathSpecified/genesis-osx-x64-2019.12.22",
"TemplateType": 1,
"ApplicationName": "My_Application",
"MicroserviceNames": [
"Microservice1"
],
"BFFName": null,
"BFFPort": null,
"GenesisDatabaseType": 2,
"GenesisConnectionStringChoice": 2,
"UseGenesisDBIfExists": false,
"GenesisConnectionString": "User ID=postgres;Password=123456;Host=localhost;Port=5432;Database=GENESIS_DB_NAME;",
"DatabaseTypes": [
2
],
"ConnectionStringChoices": [
2
],
"Ports": [
5051
],
"ConnectionStrings": [
"User ID=postgres;Password=123456;Host=localhost;Port=5432;Database=YOUR_DB_NAME;"
],
"Tables": [
[
"public.SomeTable1",
"public.SomeTable2",
"public.SomeTable3",
"public.SomeTable4",
]
],
"UIChoice": 2,
"UIPort": 3000,
"IdentityPort": 5000,
"AdminSvcPort": 5050,
"NoBuild": false,
"Verbose": false,
"GitDisabled": null,
"GitAutoMerge": null
}

2) Upgrade​

Upgrades to the latest versions of the frameworks and Nuget packages into specified existing project.

./genesis upgrade --path {full_or_relative_path_to_existing_solution}

You'll be asked:

Please select desired version to proceed.
<f> to filter,
<enter> to continue

❯ v3.22.0 (Current version to retry upgrade)
v3.21.6 (Old version to downgrade)
v3.21.5 (Old version to downgrade)
v3.21.4 (Old version to downgrade)
v3.21.3 (Old version to downgrade)
v3.21.2 (Old version to downgrade)
v3.21.1 (Old version to downgrade)
v3.20.0 (Old version to downgrade)
v3.19.1 (Old version to downgrade)
v1.9.19 (Old version to downgrade)
v1.8.8 (Old version to downgrade)

3) Update​

We recommend making a [complex] ./genesis upgrade first and then continue with update.

a) Start by running the command:

./genesis update --path {full_or_relative_path_to_existing_solution}

b) Please select projects to proceed.

 β—―  Microservice.TypeLib
β—‰ Microservice.DataLib
β—― Microservice.API
β—― IdentityServer
β—― Admin.Type
β—― Admin.Data
β—― Admin.Svc
β—― CoreData
β—― CoreSvc
β—― CoreType
β—― Scheduler.Core
β—― Scheduler.API

c) Choose between Code-First or Database-First approaches:

Please select action to proceed.
(1) - Migration (Code-first approach) - Database will be updated according model/context changes
(2) - Scaffold (Database-first approach) - This will create models by database tables
(3) - Skip

Don't worry! Even if you insist to override the project files, Solution Generator will compare the hash values of the old-new files and if there is a difference, the old one is going to be backed up first.

4) Version​

Check current version of AutoCode Solution Generator

./genesis --version

Note: To see available functions, run ./genesis create --help

Troubleshooting​

If you get any error, that's probably you have an older version of the AutoCode Solution Generator working in your machine, causing mismatch between AutoCode Solution Generator and the latest project boilerplate.

So check and download AutoCode Solution Generator's current version.