npm package: @taban-framework/cli
Description: Central CLI for Taban Framework to manage modules and commands
Author: farzadblack
Latest version: 1.0.3

��# =؀� Taban Framework CLI

> **Central CLI for Taban Framework** - Manage modules, database, models, seeders, services, and middlewares with powerful shortcuts and beautiful output.

[![npm version](https://img.shields.io/npm/v/@taban-framework/cli.svg)](https://www.npmjs.com/package/@taban-framework/cli)
[![Node.js version](https://img.shields.io/node/v/@taban-framework/cli.svg)](https://nodejs.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## (' Features

- <ب� **Beautiful Color System** - Rich terminal output with emojis and colors
- �& **Smart Short Commands** - Use abbreviations for faster workflow
- <�1� **Advanced Seeder System** - Manage and run database seeders
- =��� **Module Management** - Enable/disable modules dynamically
- =���� **Database Operations** - Migrations, seeding, and schema management
- <���� **Model Management** - Combine and sync Prisma models
- =���� **Service Management** - Manage framework services
- >��� **Middleware Management** - Control application middlewares
- =؀� **Custom Commands** - Run project-specific commands

## =؀� Quick Start

```bash
# use npx
npx @taban-framework/cli

# Check available commands
npx tabanfw help
```

## <د� Command Overview

| Command | Short | Description |
|---------|-------|-------------|
| `module` | `m` | Manage framework modules |
| `db` | `d` | Database operations |
| `models` | `mdl` | Model management |
| `seed` | `s` | Seeder operations |
| `services` | `svc` | Service management |
| `middlewares` | `mdw` | Middleware control |
| `run` | `r` | Execute custom commands |
| `help` | `h` | Show help information |

## <ب� Color System

The CLI features a beautiful color-coded output system:

- =�4� **Red** - Errors and warnings
- =��� **Green** - Success messages
- =��� **Yellow** - Tips and hints
- =�5� **Blue** - Information
- =��� **Magenta** - Command names
- �& **White** - Descriptions
- �& **Gray** - Secondary information

## �& Short Commands

### Command Abbreviations

| Full Command | Short | Full Command | Short |
|--------------|-------|--------------|-------|
| `module` | `m` | `models` | `mdl` |
| `db` | `d` | `seed` | `s` |
| `services` | `svc` | `middlewares` | `mdw` |
| `run` | `r` | `help` | `h` |

### Action Abbreviations

| Full Action | Short | Full Action | Short |
|-------------|-------|-------------|-------|
| `list` | `l` | `enable` | `e` |
| `disable` | `d` | `sync` | `s` |
| `check` | `c` | `migrate` | `m` |
| `combine` | `cb` | `combine-migrate` | `cm` |
| `run` | `r` | `help` | `h` |

## =��� Detailed Commands

### =��� Module Management

```bash
# List all modules
npx tabanfw module list
npx tabanfw m l

# Enable a module
npx tabanfw module enable auth-module
npx tabanfw m e auth-module

# Disable a module
npx tabanfw module disable auth-module
npx tabanfw m d auth-module

# Sync modules
npx tabanfw module sync
npx tabanfw m s
```

### =���� Database Operations

```bash
# Check database connection
npx tabanfw db check
npx tabanfw d c

# Run migrations
npx tabanfw db migrate
npx tabanfw d m

# Combine models into schema.prisma
npx tabanfw db combine
npx tabanfw d cb

# Combine and migrate in one command
npx tabanfw db combine-migrate
npx tabanfw d cm

# Run seeders
npx tabanfw db seed
npx tabanfw d s
```

### =��� Model Management

```bash
# List all models
npx tabanfw models list
npx tabanfw mdl l

# Combine enabled models
npx tabanfw models combine
npx tabanfw mdl cb

# Sync models with filesystem
npx tabanfw models sync
npx tabanfw mdl s

# Enable a model
npx tabanfw models enable user
npx tabanfw mdl e user

# Disable a model
npx tabanfw models disable user
npx tabanfw mdl d user
```

### <�1� Seeder System

```bash
# Run all seeders
npx tabanfw seed run
npx tabanfw s r

# Run specific seeder
npx tabanfw seed run user-seeder
npx tabanfw s r user-seeder

# List all seeders
npx tabanfw seed list
npx tabanfw s l

# Sync seeders with filesystem
npx tabanfw seed sync
npx tabanfw s s

# Enable a seeder
npx tabanfw seed enable user-seeder
npx tabanfw s e user-seeder

# Disable a seeder
npx tabanfw seed disable user-seeder
npx tabanfw s d user-seeder
```

### =���� Service Management

```bash
# List all services
npx tabanfw services list
npx tabanfw svc l

# Sync services with filesystem
npx tabanfw services sync
npx tabanfw svc s

# Enable a service
npx tabanfw services enable auth-manager
npx tabanfw svc e auth-manager

# Disable a service
npx tabanfw services disable auth-manager
npx tabanfw svc d auth-manager
```

### >��� Middleware Management

```bash
# List all middlewares
npx tabanfw middlewares list
npx tabanfw mdw l

# Sync middlewares with filesystem
npx tabanfw middlewares sync
npx tabanfw mdw s

# Enable a middleware
npx tabanfw middlewares enable auth
npx tabanfw mdw e auth

# Disable a middleware
npx tabanfw middlewares disable auth
npx tabanfw mdw d auth
```

### �%� Custom Commands

```bash
# Run custom project commands via run.js
npx tabanfw run start
npx tabanfw r start

# Run migrations
npx tabanfw run migrate
npx tabanfw r migrate

# Run seeders
npx tabanfw run seed
npx tabanfw r seed
```

## =ء� Pro Tips

### =؀� Speed Up Your Workflow

```bash
# Instead of typing:
npx tabanfw module list
npx tabanfw models combine
npx tabanfw db migrate

# Use shortcuts:
npx tabanfw m l
npx tabanfw mdl cb
npx tabanfw d m
```

### =�� Common Workflows

```bash
# Complete setup workflow
npx tabanfw mdl cb    # Combine models
npx tabanfw d m       # Run migrations
npx tabanfw s r       # Run seeders

# Module management
npx tabanfw m l       # List modules
npx tabanfw m e auth  # Enable auth module
npx tabanfw m s       # Sync modules
```

## =���� Installation

### Global Installation

```bash
npm install -g @taban-framework/cli
```

### Project Installation

```bash
npm install @taban-framework/cli
```

### Using npx (Recommended)

```bash
npx @taban-framework/cli
```

## =��� Requirements

- **Node.js**: >= 20.0.0
- **npm**: Latest version recommended

## =�'� Configuration

The CLI automatically detects your Taban Framework project structure and integrates with:

- `services/` - Service managers
- `run.js` - Custom project commands
- Module configuration files
- Database schemas and migrations

## =��� Help System

```bash
# Main help
npx tabanfw help
npx tabanfw h

# Command-specific help
npx tabanfw help module
npx tabanfw h m

# Action-specific help
npx tabanfw help module enable
npx tabanfw h m e
```

## >�� Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## =��� License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## <ؘ� Support

- =��� [Documentation](https://github.com/Taban-FrameWork/cli)
- =�� [Issues](https://github.com/Taban-FrameWork/cli/issues)
- =ج� [Discussions](https://github.com/Taban-FrameWork/cli/discussions)

---

**Made with d'� by the Taban Framework Team**