@mbc-cqrs-serverless/cli

0.1.52-beta.0 • Public • Published

MBC CQRS serverless framework

MBC CQRS serverless framework CLI package

Description

The MBC CLI is a command-line interface tool that helps you initialize and manage MBC CQRS Serverless applications. It provides commands for project creation, version management, and development workflow automation.

Installation

To install the mbc command globally, run:

npm install -g @mbc-cqrs-serverless/cli

Usage

Project Creation

The CLI provides flexible options for creating new projects:

mbc new [projectName[@version]]

Basic Usage Examples

  1. Create a new project in the current directory:
mbc new
  1. Create a project with a specific name:
mbc new my-cqrs-app
  1. Create a project with a specific version:
mbc new my-cqrs-app@0.1.45

Project Structure

The CLI creates a standardized project structure:

my-cqrs-app/
├── src/
│   ├── commands/       # Command handlers
│   ├── events/        # Event handlers
│   ├── interfaces/    # TypeScript interfaces
│   └── services/      # Business logic services
├── test/
│   ├── e2e/          # End-to-end tests
│   └── unit/         # Unit tests
├── package.json
└── serverless.yml    # Serverless Framework configuration

Development Workflow

  1. After creating a project, install dependencies:
cd my-cqrs-app
npm install
  1. Build the project:
npm run build
  1. Start local development environment:
npm run offline:docker  # Start local infrastructure
npm run migrate        # Run database migrations
npm run offline:sls    # Start serverless offline

Available Commands

  • mbc new: Create a new project
  • mbc version: Display CLI version
  • mbc help: Show command help
  • mbc list: List available project templates

Configuration

The CLI supports configuration through:

  • Command line arguments
  • Environment variables
  • Configuration files

Example configuration file (.mbcrc.json):

{
  "defaultTemplate": "basic",
  "region": "ap-northeast-1",
  "stage": "dev"
}

Documentation

Visit https://mbc-cqrs-serverless.mbc-net.com/ to view the full documentation, including:

  • Detailed CLI commands and options
  • Project setup and configuration
  • Development server setup
  • Available endpoints and services

Troubleshooting

Common issues and solutions:

  1. Version not found:
mbc new myapp@999.999.999
# Error: Version not found. Available versions: [0.1.45, 0.1.44, ...]

Solution: Use mbc list versions to see available versions.

  1. Project creation fails:
mbc new my-project
# Error: Directory not empty

Solution: Use a new directory or remove existing files.

License

Copyright © 2024, Murakami Business Consulting, Inc. https://www.mbc-net.com/
This project and sub projects are under the MIT License.

Package Sidebar

Install

npm i @mbc-cqrs-serverless/cli

Weekly Downloads

124

Version

0.1.52-beta.0

License

MIT

Unpacked Size

615 kB

Total Files

180

Last publish

Collaborators

  • koichi.murakami
  • hai.do