Skip to main content

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:

  1. Prompts for project name (e.g., "TaskFlow")
  2. Prompts for NuGet feed URL (or uses default)
  3. Creates project structure from PearDrop.Minimal.Template
  4. Restores packages and tools
  5. 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

OptionDescriptionExample
--nuget-feedNuGet feed URL--nuget-feed "https://..."
--no-interactiveSkip prompts--no-interactive
--projectOutput 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:

  1. Creates module structure from PearDrop.Module.Template
  2. Creates server and client module projects
  3. Adds server and client project references where applicable
  4. Updates the solution with the new module projects
  5. Updates Program.cs registration and API wiring when target app projects are detected
  6. Updates peardrop.json manifest with module entries in projects[] array and usedModules

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

OptionDescriptionExample
Module nameName of the moduleEquipment, 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 aggregate instead)
  • Related features in same bounded context
  • Early in project (premature modularization)

After Creating Module

  1. Verify project wiring - confirm references, solution entries, and Program.cs updates were applied correctly
  2. Add domain code - aggregates, commands, queries, and projections for the new module
  3. 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:

  1. Validates that the source module exists and the target name is free
  2. Removes old solution entries and project references
  3. Renames server/client module directories and project files
  4. Re-adds solution entries and project references using the new name
  5. Updates peardrop.json manifest metadata

Options

OptionDescriptionExample
Old nameExisting module nameEquipment
New nameNew module nameAssets
--forceSkip 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:

  1. Removes project references from server/client app projects when detected
  2. Removes module projects from the solution
  3. Updates peardrop.json manifest entries
  4. Deletes the server and client module directories

Options

OptionDescriptionExample
Module nameModule to removeEquipment
--forceSkip 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