This library was generated with Nx.
This project is a lightweight CLI mainly for generating & compiling M Backend Core projects
Install the cli via npm with the following instructions:
npm i -g @m-backend/cli
Note: We highly recommend installing the CLI globally in order to use it as it should be (especially for project generation).
In order to execute anything, prefix the command with the keywords m-cli
Each command has its alternatives, feel free to use one of the possible alternatives for each command.
Command | Arguments | Options | Default Value | Possible values | Description |
---|---|---|---|---|---|
g, generate | {PROJECT_NAME} | - | - | demo | Generates a project |
r, run | - | - | - | - | Main command [run it with the documented options] |
r, run | - | -c, --config | debug | production, dev or debug | Config environment webpack |
r, run | - | -e, --entry | ./src/main.ts | - | Define the entry point |
r, run | - | --ormEntryPath | ./src/app/database | Define the entry path of the orm plugin | |
r, run | - | -o, --out | dist | - | Defines the build output |
v, version | - | - | - | - | Give the version of the Cli |
ws, win-svc | - | - | Autodetect name/project path | demo, C:\Dev | Convert a nodejs app to windows service (lib) |
// | - | -i, --install | install | - | Install windows service |
// | - | -u, --uninstall | uninstall | - | Uninstall windows service |
// | - | --max-old-space-size | - | 1536 | Define the max old space size |
// | - | --domain | - | domain.local | Define domain (used by AD) |
// | - | --account | - | demo | Define user account |
// | - | --password | - | 1596150erofu | Define password |
// | - | --name | Autodetect project name | demo | Define custom project name |
// | - | --path | Autodetect project path (remove project name and /dist) | C:\app\project | Define custom project path directory |
// | - | --script | Concat path + name + dist + app.js | C:\app\project\demo\dist\app.js | Define custom script directory |
m-cli g <YOUR_PROJECT_NAME> or m-cli generate <YOUR_PROJECT_NAME>
m-cli run or m-cli run --config={env}
m-cli ws -i or m-cli win-svc --install
m-cli ws --name <PROJECT_NAME> --path <PATH> -i or m-cli win-svc --name demo --path C:\folders\ --install
m-cli ws -u or m-cli win-svc --uninstall
m-cli ws --name <PROJECT_NAME> --path <PATH> -u or m-cli win-svc --name demo --path C:\folders\ --uninstall