Project Commands
Commands for initializing new PearDrop projects and modules.
peardrop init
Initialize a new PearDrop project with the minimal template.
peardrop init
What it does:
- Prompts for project name (e.g., "TaskFlow")
- Prompts for NuGet feed URL (or uses default)
- Creates project structure from PearDrop.Minimal.Template
- Restores packages and tools
- Builds the project
Interactive prompts:
Enter project name: TaskFlow
Enter NuGet feed URL [default: https://...]:
Non-interactive mode:
peardrop init \
--nuget-feed "https://pkgs.dev.azure.com/myorg/_packaging/PearDrop/nuget/v3/index.json" \
--no-interactive
Project structure created:
TaskFlow/
├── source/
│ ├── TaskFlow.App/ # Server application
│ ├── TaskFlow.App.Client/ # Blazor WASM client
│ └── TaskFlow.Module/ # Your domain module
├── .config/
│ └── dotnet-tools.json # CLI tool manifest
├── TaskFlow.sln # Solution file
└── nuget.config # NuGet feed configuration
Options
| Option | Description | Example |
|---|---|---|
--nuget-feed | NuGet feed URL | --nuget-feed "https://..." |
--no-interactive | Skip prompts | --no-interactive |
--project | Output directory | --project ./MyProjects/TaskFlow |
After Init
# Navigate to project
cd TaskFlow
# Start Docker dependencies
docker-compose up -d
# Apply migrations
peardrop migrate
# Run application
dotnet run --project source/TaskFlow.App
peardrop new project
Alias for peardrop init. Same functionality.
peardrop new project
peardrop new module
Create a new PearDrop module from the module template.
peardrop new module Equipment
What it does:
- Creates module structure from PearDrop.Module.Template
- Creates server and client module projects
- Adds server and client project references where applicable
- Updates the solution with the new module projects
- Updates
Program.csregistration and API wiring when target app projects are detected - Updates
peardrop.jsonmanifest with module entries inprojects[]array andusedModules
Module structure created:
modules/
└── equipment/
└── source/
└── TaskFlow.Equipment/
├── Data/
│ ├── WriteModel/
│ │ ├── EquipmentWriteDbContext.cs
│ │ ├── EntityConfigs/
│ │ └── Migrations/
│ └── ReadModel/
│ ├── EquipmentReadDbContext.cs
│ ├── EquipmentReadModels.cs
│ └── EntityConfigs/
├── Infrastructure/
│ └── Domain/ # Aggregates go here
├── Queries/ # Query handlers
└── Module.cs
Options
| Option | Description | Example |
|---|---|---|
| Module name | Name of the module | Equipment, Billing |
Use Cases
When to create a new module:
- Extracting a bounded context from your main module
- Adding a feature with clear domain separation (Equipment, Invoicing, Shipping)
- Building a reusable module for multiple projects
When NOT to create a new module:
- Simple feature additions (use
add aggregateinstead) - Related features in same bounded context
- Early in project (premature modularization)
After Creating Module
- Verify project wiring - confirm references, solution entries, and
Program.csupdates were applied correctly - Add domain code - aggregates, commands, queries, and projections for the new module
- Apply migrations - run the module's migrations and verify startup/build
peardrop rename module
Rename an existing module across the filesystem, project references, solution entries, and manifest metadata.
peardrop rename module Equipment Assets
peardrop rename module Equipment Assets --force
What it does:
- Validates that the source module exists and the target name is free
- Removes old solution entries and project references
- Renames server/client module directories and project files
- Re-adds solution entries and project references using the new name
- Updates
peardrop.jsonmanifest metadata
Options
| Option | Description | Example |
|---|---|---|
| Old name | Existing module name | Equipment |
| New name | New module name | Assets |
--force | Skip confirmation prompt | --force |
peardrop remove module
Remove an existing module and clean up solution, references, and manifest state.
peardrop remove module Equipment
peardrop remove module Equipment --force
What it does:
- Removes project references from server/client app projects when detected
- Removes module projects from the solution
- Updates
peardrop.jsonmanifest entries - Deletes the server and client module directories
Options
| Option | Description | Example |
|---|---|---|
| Module name | Module to remove | Equipment |
--force | Skip confirmation prompt | --force |
Examples
Example 1: Quick Start
# Initialize with defaults
peardrop init
# Enter project name when prompted
# TaskFlow
# Use default NuGet feed (press Enter)
Example 2: CI/CD Pipeline
# Non-interactive for automation
peardrop init \
--nuget-feed "https://mycompany.com/nuget/v3/index.json" \
--no-interactive \
--project ./output/MyApp
Example 3: Modular Architecture
# Initialize main project
peardrop init
# Create separate modules for bounded contexts
peardrop new module Equipment
peardrop new module Maintenance
peardrop new module Inventory
Troubleshooting
NuGet Feed Authentication
If using private NuGet feed:
# Add credentials to NuGet
dotnet nuget add source "https://pkgs.dev.azure.com/..." \
--name "PearDrop" \
--username "user" \
--password "pat_token"
Template Not Found
# Verify CLI is installed
dotnet tool restore
# Check version
dotnet tool run peardrop --version
Build Errors After Init
# Clean and rebuild
dotnet clean
dotnet restore --force
dotnet build
Next Steps
- Domain Commands - Add aggregates and commands
- Feature Commands - Inject auth or multi-tenancy
- Your First Project - Complete walkthrough