@mars-stack/cli
v3.0.2
Published
MARS CLI: scaffold, configure, and maintain SaaS apps
Maintainers
Readme
@mars-stack/cli
CLI for scaffolding and managing MARS projects. Designed to be used by AI agents (via skills) or directly by developers.
Install
# Use without installing (recommended)
npx @mars-stack/cli create my-app
# Or install globally
npm i -g @mars-stack/cli
mars create my-appCommands
mars create [name]
Scaffold a new project. Walks through four interactive prompt groups:
- Project info -- name (kebab-case), display name, description, URL, support email
- Features -- toggle 24 features across auth, app, infrastructure, and architecture categories
- Services -- pick providers for database, email, storage, payments, analytics, search, realtime, and background jobs
- Theme -- brand colour, font family, design direction
Outputs a complete Next.js application with auth, design tokens, database schema, agent infrastructure (AGENTS.md, skills, rules, docs), and a working dev environment.
mars create my-app
# → interactive prompts
# → scaffolds ~200 files
# → prints next stepsmars add feature <name>
Generate a feature module at src/features/<name>/ with:
server/index.ts-- typed CRUD operations withimport 'server-only'types.ts-- Zod validation schemas and TypeScript types
mars add feature billing
# → src/features/billing/server/index.ts
# → src/features/billing/types.tsmars add page <path> [--protected]
Create a page component with a loading skeleton.
mars add page pricing # → src/app/pricing/page.tsx
mars add page dashboard/analytics -p # → src/app/(protected)/dashboard/analytics/page.tsx
mars add page blog/[slug] # → src/app/blog/[slug]/page.tsxmars add model <name>
Create a Prisma schema file with a starter model, timestamps, and user relation.
mars add model Product
# → prisma/schema/product.prisma (with Product model)mars add component <name> [--type primitive|pattern]
Create a UI component in the correct directory.
mars add component Toggle # → src/components/primitives/Toggle.tsx
mars add component DataGrid --type pattern # → src/components/patterns/DataGrid.tsxmars add email <name>
Create a React Email template with the base layout, inline styles, and email-client-safe markup.
mars add email team-invite
# → src/lib/core/email/templates/team-invite-email.tsmars configure [service]
Configure a service provider. Installs the SDK, updates app.config.ts, and writes env vars to .env.
mars configure payments # → installs stripe, updates config, adds env vars
mars configure email # → prompts for SendGrid or Resend, installs SDK
mars configure storage # → prompts for Vercel Blob, S3, or localmars deploy
Guided Vercel deployment:
- Checks
vercelCLI is installed - Links the project to your Vercel account
- Detects configured services from
app.config.ts - Prompts for and sets each required env var
- Runs the deployment
- Prints the deployed URL
mars doctor [--upgrade-check]
Check your development environment: Node version, package manager, dependencies, database connection, required env vars.
mars doctor # basic health check
mars doctor --upgrade-check # also check for Mars package updatesmars upgrade
Update @mars-stack/core and @mars-stack/ui to latest, run install, verify with mars doctor.
mars upgrade # upgrade to latest
mars upgrade --dry-run # preview what would changemars telemetry <enable|disable>
Opt in or out of anonymous usage analytics. Stored in ~/.marsrc. Tracks command usage and feature selections only -- never project names, file contents, or env vars.
Agent Usage
The CLI is designed to be invoked by AI agents following Mars skills. The agent reads the skill, determines which CLI commands to run, and executes them. For example:
- The
build-complete-featuremeta-skill chainsmars add model,mars add feature, andmars add page - The
setup-billingmeta-skill runsmars configure paymentsthen builds the billing UI - The
deploy-to-vercelskill runsmars deploywith guided prompts
Skills live in .cursor/skills/ (installed automatically via @mars-stack/core postinstall).
License
MIT
