@tsed/cli
![backers](https://opencollective.com/tsed/tiers/badge.svg)
CLI for the Ts.ED framework
Features
Please refer to the documentation for more details.
Requirement
The CLI needs at least Node.js v12 and NPM v7/8.
Installation
npm install -g @tsed/cli
Proxy configuration
Ts.ED CLI uses the npm proxy configuration.
Use these commands to configure the proxy:
npm config set proxy http://username:password@host:port
npm config set https-proxy http://username:password@host:port
Or you can edit directly your ~/.npmrc file:
proxy=http://username:password@host:port
https-proxy=http://username:password@host:port
https_proxy=http://username:password@host:port
Note: The following environment variables can be also used to configure the proxy HTTPS_PROXY
, HTTP_PROXY
and NODE_TLS_REJECT_UNAUTHORIZED
.
Commands
Usage: tsed [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
add [options] [name] Add cli plugin to the current project
generate|g [options] [type] [name] Generate a new provider class
update [options] Update all Ts.ED packages used by your project
init [options] [root] Init a new Ts.ED project
run [options] <command> Run a project level command
help [command] display help for commands
Init project
Usage: tsed init [options] [root]
Init a new Ts.ED project
Arguments:
root Root directory to initialize the Ts.ED project (default: ".")
Options:
-n, --project-name <projectName> Set the project name. By default, the project is the same as the name directory. (default: "")
-a, --arch <architecture> Set the default architecture convention (default or feature) (default: "default")
-c, --convention <convention> Set the default project convention (default or feature) (default: "default")
-p, --platform <platform> Set the default platform for Ts.ED (express or koa) (default: "express")
--features <features...> List of the Ts.ED features. (default: [])
-m, --package-manager <packageManager> The default package manager to install the project (default: "yarn")
-t, --tsed-version <version> Use a specific version of Ts.ED (format: 5.x.x). (default: "latest")
-f, --file <path> Location of a file in which the features are defined.
-s, --skip-prompt Skip the prompt. (default: false)
-r, --root-dir <path> Project root directory
--verbose Verbose mode
-h, --help display help for command
Interactive prompt:
tsed init .
Skip prompt:
tsed init . --platform express --package-manager yarn --features swagger,jest,eslint,lintstaged,prettier --skip-prompt
Use file to generate project
A file can be defined to generate project. For example create a tsed.template.yml
and add this code:
projectName: project-example
platform: express
architecture: default
convention: default
skipPrompt: true
packageManager: yarn
features:
- graphql
- socketio
- swagger
- oidc
- passportjs
- commands
- db
- prisma
- mongoose
- typeorm
- typeorm:mysql
- testing
- jest
- mocha
- linter
- eslint
- lintstaged
- prettier
- bundler
- babel
- babel:webpack
Note: The CLI support yml
and json
file!
Then:
tsed init . --file ./tsed.template.yml
Run Cli from code
import {Cli} from "@tsed/cli";
Cli.dispatch("init", {
});
Contributors
Please read contributing guidelines here
![](https://opencollective.com/tsed/contributors.svg?width=890)
Backers
Thank you to all our backers! 🙏 [Become a backer]
![](https://opencollective.com/tsed/tiers/backer.svg?width=890)
Support this project by becoming a sponsor. Your logo will show up here with a link to your
website. [Become a sponsor]
License
The MIT License (MIT)
Copyright (c) 2016 - 2023 Romain Lenzotti
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.