Skip to main content

CLI

Primus provides two command-line tools:

  1. App scaffolder - create a new project from templates.
  2. Primus CLI - add pages and features to an existing project.

Scaffold a new app (create-primus-saas)

Create a full-stack app or pick a specific stack:

npx create-primus-saas my-app --stack fullstack --template saas

Available stacks:

  • fullstack (default) - .NET backend + React frontend + docker-compose
  • backend - .NET backend only
  • frontend - React frontend only
  • frontend-angular - Angular frontend only

What it creates:

  • backend/ ASP.NET Core Web API
  • frontend/ React (or Angular for frontend-angular)
  • docker-compose.yml for fullstack
  • Starter pages (dashboard, users, settings) based on template choice

Install the Primus CLI (primus)

The Primus CLI currently supports a single command: add.

npm install -g @primussoft/primus-cli

Available commands

# Add a page template
primus add page:dashboard

# Generate a CRUD page (requires a model name)
primus add page:crud --model Product

# Generate a CRUD API (requires a model name)
primus add api:crud --model Product

# Scaffold built-in features
primus add auth
primus add notifications

Project layout assumptions

The CLI assumes a conventional project structure:

  • Frontend pages live in src/pages
  • Backend code lives in backend (or ../backend / ../PrimusDemoApi)

If your project uses a different layout, run the CLI from the repo root that matches these paths.