Skip to content

shinijs/cli

Repository files navigation

@shinijs/cli

CLI tool for scaffolding NestJS libraries from templates

⚠️ This project is currently under active development. APIs may change without notice.

License: MIT

Installation

# Using pnpm (recommended)
pnpm add -g @shinijs/cli

# Using npm
npm install -g @shinijs/cli

# Using yarn
yarn global add @shinijs/cli

Usage

Create a new project

# Interactive mode (recommended)
shinijs create

# With project name
shinijs create my-library

# With template specification
shinijs create my-library --template nestjs-lib

# With specific template version/branch
shinijs create my-library --template nestjs-lib --version master

# Offline mode (use cached templates only)
shinijs create my-library --offline

Interactive mode

shinijs interactive
# or
shinijs i

Commands

create [projectName]

Create a new project from a template.

Options:

  • -t, --template <name> - Template name to use (default: nestjs-lib)
  • -v, --version <version> - Template version/tag/branch (default: master)
  • --offline - Use cached templates only

Examples:

# Create with default template
shinijs create my-library

# Create with specific template
shinijs create my-library --template nestjs-lib

# Create with specific version
shinijs create my-library --template nestjs-lib --version v1.0.0

interactive

Start interactive mode for guided project creation.

Alias: i

Templates

Templates are fetched from the shinijs/templates GitHub repository.

Available Templates

  • nestjs-lib - Template for creating NestJS libraries with testing, CI/CD, and documentation

Template Caching

Templates are cached locally in ~/.shinijs/templates/ for 24 hours. After this period, templates are automatically refreshed from GitHub.

To force offline mode and use cached templates only, use the --offline flag.

Template Variables

When creating a project, you'll be prompted for:

  • Project Name - Name of your project (must be a valid npm package name)
  • Description - Project description
  • Author - Author name
  • Include Docs - Whether to include VitePress documentation (default: true)
  • Include CI/CD - Whether to include GitHub Actions workflows (default: true)

The following variables are automatically generated:

  • projectName - Your project name
  • moduleName - PascalCase version of your project name (e.g., my-libraryMyLibrary)

Template Structure

Templates support Handlebars syntax for variable substitution:

  • {{projectName}} - Project name
  • {{moduleName}} - Module name in PascalCase
  • {{description}} - Project description
  • {{author}} - Author name
  • {{#if docs}}...{{/if}} - Conditional sections

Development

# Install dependencies
pnpm install

# Build the project
pnpm build

# Run in development mode
pnpm dev

# Run tests
pnpm test

# Lint code
pnpm lint

# Format code
pnpm format

Contributing

Contributions are welcome! Please read our Contributing Guide before submitting pull requests.

License

MIT © Shironex

About

cli for scaffolding new projects with preconfigured templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published