@outscope/cli
v0.1.2
Published
CLI tool for scaffolding @outscope/orpc-hono projects
Maintainers
Readme
@outscope/cli
CLI tool for scaffolding and managing @outscope/orpc-hono projects.
Features
- 🚀 Quick project scaffolding with interactive prompts
- 📦 Template-based project creation
- 🔧 Code generators for features, controllers, services, and repositories
- ⚡ Automatic dependency installation (optional)
- 🗃️ Prisma support (optional)
- 📝 Smart file transformations - minimal string hardcoding
Installation
# Install globally
pnpm add -g @outscope/cli
# Or use with npx (recommended)
npx @outscope/cli create my-appUsage
Create a New Project
# Interactive mode (recommended)
outscope create
# Or use the short alias
osp create
# With project name
outscope create my-app
# With template flag (for future use)
outscope create my-app --template betaInteractive prompts:
- Project name
- Template selection (currently: beta)
- Include Prisma? (yes/no)
- Install dependencies? (yes/no)
- Initialize database? (yes/no, if Prisma selected)
Generate Code
Generate features, controllers, services, or repositories:
# Interactive mode
outscope generate
# Or use the short alias
osp generate
# Or use the generate alias
outscope g
osp g
# Generate a complete feature (controller + service + repository + contracts + schema)
outscope generate feature user
osp g feature product
# Generate individual files
outscope generate controller order
osp generate service payment
osp generate repository inventoryFor individual file generation, you'll be prompted to select which feature/module to place the file in.
Command Reference
outscope create [project-name] # Create new project
osp create [project-name] # Short alias for create
outscope generate [type] [name] # Generate code
osp generate [type] [name] # Short alias for generate
osp g [type] [name] # Alias for generate
outscope --help # Show help
osp --help # Show help
outscope --version # Show version
osp --version # Show versionTemplates
Currently available templates:
- beta - Full-featured template with:
- Hono + oRPC setup
- Prisma ORM integration
- Example Planet CRUD feature
- OpenAPI documentation
- Pino logger
- Auto-controller loading
Code Generators
Feature Generator
Generates a complete feature module:
outscope g feature user
# Or using short alias
osp g feature userCreates:
src/features/users/
├── user.controller.ts
├── user.service.ts
├── user.repository.ts
└── index.ts
src/contracts/user.ts
src/schemas/user.tsIndividual Generators
Generate specific files within existing features:
# Generate controller
outscope g controller payment
osp g controller payment
# Generate service
outscope g service email
osp g service email
# Generate repository
outscope g repository cache
osp g repository cacheDevelopment
# Install dependencies
pnpm install
# Build
pnpm build
# Development mode (watch)
pnpm dev
# Type checking
pnpm check-typesTemplate Structure
Templates are located in src/templates/ and use symlinks to reference actual project templates in apps/.
Current structure:
src/templates/
└── beta -> ../../../../apps/example-betaArchitecture
- commander - CLI framework
- inquirer - Interactive prompts
- ora - Loading spinners
- picocolors - Terminal colors
- execa - Process execution
- tsup - TypeScript bundler
Files are copied from templates using Node.js fs/promises API with selective transformations for package.json and README.md only.
License
MIT
