@pecometer/peco-cli
v2.0.0
Published
Pecometer Command Line Interface Application with monorepo support
Maintainers
Readme
PecoCLI
A command line app that is primarily used to setup a Node.js project with PecoTS (backend) and Angular (frontend) as the main frameworks. PecoTS is a closed source framework, and this tool has very little use outside of working with the framework.
Create A New App
Use this command to quickly prepare an application directory with a backend, frontend, or both basic applications. The process will ask for various details depending on the options selected.
peco-cli create-appGenerate DOTENV
Generate a .env file for your PecoTS application using the generate-env command. The file will be created in the current directory.
peco-cli generate-envCheck Update
Checks if an update to the CLI package is available.
peco-cli check-updateVersion
Outputs the current package version to the console.
peco-cli versionExecuting your CLI
You may execute your CLI application built in PecoTS by calling this utility from the root folder of your application followed by the commands you have created or those provided by the framework.
peco-cli my-app-command.a-function-to-execute
peco-cli migration.make users
peco-cli rbac.make
peco-cli migration.up
peco-cli migration.downMonorepo Configuration
For monorepo structures where your backend project is not located in the standard ./backend directory, you can configure the backend path using the PECOTS_BACKEND_PATH environment variable.
Environment Variable
Set the PECOTS_BACKEND_PATH environment variable to specify the path to your backend project:
# For relative paths (resolved from current working directory)
export PECOTS_BACKEND_PATH=packages/api/backend
# For absolute paths
export PECOTS_BACKEND_PATH=/full/path/to/backendUsing .env Files
Alternatively, create a .env file in your project root:
# .env file in project root
PECOTS_BACKEND_PATH=packages/api/backendCommon Monorepo Examples
Lerna/Nx Style:
PECOTS_BACKEND_PATH=packages/apiApps/Packages Structure:
PECOTS_BACKEND_PATH=apps/serverNested Backend:
PECOTS_BACKEND_PATH=services/backend/apiWorkspace Structure:
PECOTS_BACKEND_PATH=workspaces/backendDiscovery Order
The CLI searches for your backend project in the following order:
- Environment Variable Path - If
PECOTS_BACKEND_PATHis set (from environment or .env file) - Current Directory - Looks for
index.tsorindex.jsin the current directory - Backend Subdirectory - Looks for
index.tsorindex.jsin./backend/
The CLI will automatically change to the backend directory during execution and return to the original directory when complete.
Copyright
Copyright Pecometer Software Limited
