Skip to content

a35hie/Nestie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nestie - Your Nest Bestie

Nestie is a beautiful, interactive CLI tool built in Go that makes creating NestJS projects and modules effortless. With its intuitive TUI interface powered by Bubble Tea, Nestie streamlines your NestJS development workflow.

Features

  • Interactive Module Creation: Beautiful TUI for selecting and configuring modules
  • Smart Module Detection: Automatically scans existing modules in your project
  • Proper Entity Generation: Creates entity files with correct .entity.ts naming in src/entities/
  • Intelligent Import Consolidation: Consolidates multiple imports from the same module into single statements in ALL files (both within and outside the module folder) - e.g., import { A, B, C } from '@/module'
  • Clean Index Generation: Creates index.ts files excluding test/spec files and module name files to prevent naming conflicts
  • Non-Interactive Generation: All components generate without user prompts (resource option removed for reliability)
  • Flexible Configuration: Project-level configuration with .nestie.json
  • Post-Processing Options: Clean imports, @/ path conversion, and formatter integration
  • Multiple Output Modes: Execute commands directly or output for manual execution
  • Full-Screen Mode: Immersive full-screen TUI experience

Installation

go install github.com/asboy2035/Nestie@latest

Or build from source:

git clone https://github.com/asboy2035/Nestie.git
cd nestie
go build -o nestie .

Prerequisites

  • NestJS CLI must be installed globally: npm install -g @nestjs/cli
  • Go 1.21 or higher

Usage

Create a New Project

nestie new my-awesome-project

Add Modules Interactively

nestie add

Add a Specific Module

nestie add users

When you provide a module name, Nestie skips the module selection screen and goes directly to the configuration options.

Command Options

  • --config <path>: Specify custom config file path
  • --nestOnly: Output commands without executing them
  • --fullScreen: Run in full-screen mode

Configuration

Create a .nestie.json file in your project root to customize default settings:

{
  "$schema": "https://github.com/asboy2035/Nestie/raw/refs/heads/master/schema.json",
  "generation": {
    "controller": true,
    "service": true,
    "entity": false,
    "interface": false,
    "resource": false,
    "middleware": false,
    "pipe": false,
    "provider": false
  },
  "process": {
    "use@": false,
    "cleanImports": false,
    "formatter": "prettier"
  }
}

JSON Schema Benefits

The JSON schema provides:

  • IntelliSense: Auto-completion in VS Code, WebStorm, and other IDEs
  • Validation: Real-time validation of your configuration
  • Documentation: Hover tooltips with property descriptions
  • Type Safety: Prevents configuration errors before runtime

Configuration Options

Generation Options

  • controller: Generate controller (default: true)
  • service: Generate service (default: true)
  • entity: Generate entity class (default: false)
  • interface: Generate interface (default: false)
  • middleware: Generate middleware (default: false)
  • pipe: Generate pipe (default: false)
  • provider: Generate provider (default: false)

Post-Processing Options

  • use@: Convert imports to use @/ path style (default: false)
  • cleanImports: Create index.ts files and clean imports (default: false)
  • formatter: Run formatter after generation (prettier, eslint, oxfmt, oxlint)

TUI Interface

Nestie features a beautiful, colorful terminal interface with:

  • Module Selection: Choose between creating new modules or adding to existing ones
  • Component Configuration: Interactive checkboxes for selecting components
  • Confirmation Screen: Review your selections before generation
  • Results Display: Clear feedback on generation success or failure

Navigation

  • ↑/↓ or j/k: Navigate options
  • Space: Toggle checkboxes
  • Tab: Switch between new/existing modules
  • Enter: Confirm selection
  • Esc: Go back
  • q: Quit

Development

Project Structure

nestie/
├── cmd/                 # CLI commands
│   ├── root.go         # Root command setup
│   ├── new.go          # New project command
│   ├── add.go          # Add module command
│   └── utils.go        # Utility functions
├── internal/
│   ├── config/         # Configuration management
│   ├── generator/      # NestJS command generation
│   ├── scanner/        # Module detection
│   └── tui/           # Terminal UI components
│       ├── app.go     # TUI application
│       ├── model.go   # Bubble Tea model
│       └── view.go    # UI rendering
├── schema.json        # JSON schema for .nestie.json
└── main.go            # Application entry point

Building

go mod tidy
go build -o nestie .

Testing

go test ./...

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Acknowledgments

About

Your Nest bestie for creating projects/modules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors