@avila-tek/cli
v1.2.1
Published
Cli for Avila Tek projects
Keywords
Readme
avila-cli
A full-stack code CLI for code generation for the multiple tech stacks of Avila Tek
🛠️ Full-Stack Code Generator
A powerful and flexible code generator that scaffolds boilerplate code for multiple technology stacks. Whether you're building a frontend, backend, or fullstack app, this tool helps you kickstart development with best practices, project structure, and consistent code.
🚀 Features
- Generate code for multiple tech stacks:
- Mongoose With RESTful
- Mongoose with GraphQL (In development)
- Prisma with RESTful (In development)
- Prisma with GraphQL (In development)
- CLI-based interactive prompts
- Supports monorepo structures (e.g.,
npm,Turborepo) - Developer-friendly output and clean structure
📦 Installation
You can install it globally via npm:
npm install -g @avila-tel/cli⚙️ Initialization
First you'll need to initialize the tool in order to generate the code, and you can achieve this by running:
avila initYou will be propmted with the following questions
? Project name <project_name>
✔ Select backend architecture GraphQL - RESTful
✔ Select ORM Mongoose - Prisma
✔ Where is your server located? <path_to_server>
✔ What is the name for the client app? <name_of_client>
✔ What is the name for the admin app? <name_of_admin>
✔ What is the name for the API app? <name_of_api>That will generate a config file having the necessary variables in order to work properly!
{
"project": "project",
"backendArchitecture": "GraphQL",
"ORM": "Mongoose",
"serverLocation": "app.ts",
"apps": {
"client": "client",
"admin": "admin",
"api": "api"
},
"ui": []
}🧑💻 Usage
Run the generator and choose from the available commands:
avila <command>Available commands
📦
resource– Generate a full backend resource (model, service, controller, route, web-service)🌐
web-service– Set up a complete backend web service (In development)🎮
controller– Create a controller with route handlers (In development)🧠
service– Generate a backend service (business logic) (In development)🧬
model– Scaffold a data model (e.g., Prisma, Mongoose) (In development)🛣️
route– Add standalone backend routes (In development)🖥️
add– Add user-facing UI components
Example:
> avila resource testing
Creating component: testing
Model created successfully!
Generating API component for: testing
Avoiding overwrite on pagination file
Generted API route
Generating frontend component for: testing
? Where do you want the services for the frontend to be? (Use arrow keys)
❯ Shared
Admin
Clien🛠️ Development
To contribute or extend the generator:
git clone https://github.com/Avila-Tek/avila-cli.git
cd avila-cli
npm install
npm link // This will generate a symbolic link to this folder to the target projectThen in the root of the target project run:
npm link @avila-tek/cliNow you can safely run:
avila generate <command>And start scaffolding the app.
Happy coding!
