@mars-stack/cli 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -0
- package/dist/index.js +7884 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# @mars-stack/cli
|
|
2
|
+
|
|
3
|
+
CLI for scaffolding and managing MARS projects. Designed to be used by AI agents (via skills) or directly by developers.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Use without installing (recommended)
|
|
9
|
+
npx @mars-stack/cli create my-app
|
|
10
|
+
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm i -g @mars-stack/cli
|
|
13
|
+
mars create my-app
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Commands
|
|
17
|
+
|
|
18
|
+
### `mars create [name]`
|
|
19
|
+
|
|
20
|
+
Scaffold a new project. Walks through four interactive prompt groups:
|
|
21
|
+
|
|
22
|
+
1. **Project info** -- name (kebab-case), display name, description, URL, support email
|
|
23
|
+
2. **Features** -- toggle 24 features across auth, app, infrastructure, and architecture categories
|
|
24
|
+
3. **Services** -- pick providers for database, email, storage, payments, analytics, search, realtime, and background jobs
|
|
25
|
+
4. **Theme** -- brand colour, font family, design direction
|
|
26
|
+
|
|
27
|
+
Outputs a complete Next.js application with auth, design tokens, database schema, agent infrastructure (AGENTS.md, skills, rules, docs), and a working dev environment.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
mars create my-app
|
|
31
|
+
# → interactive prompts
|
|
32
|
+
# → scaffolds ~200 files
|
|
33
|
+
# → prints next steps
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### `mars add feature <name>`
|
|
37
|
+
|
|
38
|
+
Generate a feature module at `src/features/<name>/` with:
|
|
39
|
+
- `server/index.ts` -- typed CRUD operations with `import 'server-only'`
|
|
40
|
+
- `types.ts` -- Zod validation schemas and TypeScript types
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
mars add feature billing
|
|
44
|
+
# → src/features/billing/server/index.ts
|
|
45
|
+
# → src/features/billing/types.ts
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `mars add page <path> [--protected]`
|
|
49
|
+
|
|
50
|
+
Create a page component with a loading skeleton.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mars add page pricing # → src/app/pricing/page.tsx
|
|
54
|
+
mars add page dashboard/analytics -p # → src/app/(protected)/dashboard/analytics/page.tsx
|
|
55
|
+
mars add page blog/[slug] # → src/app/blog/[slug]/page.tsx
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `mars add model <name>`
|
|
59
|
+
|
|
60
|
+
Create a Prisma schema file with a starter model, timestamps, and user relation.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
mars add model Product
|
|
64
|
+
# → prisma/schema/product.prisma (with Product model)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `mars add component <name> [--type primitive|pattern]`
|
|
68
|
+
|
|
69
|
+
Create a UI component in the correct directory.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
mars add component Toggle # → src/components/primitives/Toggle.tsx
|
|
73
|
+
mars add component DataGrid --type pattern # → src/components/patterns/DataGrid.tsx
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `mars add email <name>`
|
|
77
|
+
|
|
78
|
+
Create a React Email template with the base layout, inline styles, and email-client-safe markup.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
mars add email team-invite
|
|
82
|
+
# → src/lib/core/email/templates/team-invite-email.ts
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### `mars configure [service]`
|
|
86
|
+
|
|
87
|
+
Configure a service provider. Installs the SDK, updates `app.config.ts`, and writes env vars to `.env`.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mars configure payments # → installs stripe, updates config, adds env vars
|
|
91
|
+
mars configure email # → prompts for SendGrid or Resend, installs SDK
|
|
92
|
+
mars configure storage # → prompts for Vercel Blob, S3, or local
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `mars deploy`
|
|
96
|
+
|
|
97
|
+
Guided Vercel deployment:
|
|
98
|
+
|
|
99
|
+
1. Checks `vercel` CLI is installed
|
|
100
|
+
2. Links the project to your Vercel account
|
|
101
|
+
3. Detects configured services from `app.config.ts`
|
|
102
|
+
4. Prompts for and sets each required env var
|
|
103
|
+
5. Runs the deployment
|
|
104
|
+
6. Prints the deployed URL
|
|
105
|
+
|
|
106
|
+
### `mars doctor [--upgrade-check]`
|
|
107
|
+
|
|
108
|
+
Check your development environment: Node version, package manager, dependencies, database connection, required env vars.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
mars doctor # basic health check
|
|
112
|
+
mars doctor --upgrade-check # also check for Mars package updates
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### `mars upgrade`
|
|
116
|
+
|
|
117
|
+
Update `@mars-stack/core` and `@mars-stack/ui` to latest, run install, verify with `mars doctor`.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mars upgrade # upgrade to latest
|
|
121
|
+
mars upgrade --dry-run # preview what would change
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `mars telemetry <enable|disable>`
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
## Agent Usage
|
|
129
|
+
|
|
130
|
+
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:
|
|
131
|
+
|
|
132
|
+
- The `build-complete-feature` meta-skill chains `mars add model`, `mars add feature`, and `mars add page`
|
|
133
|
+
- The `setup-billing` meta-skill runs `mars configure payments` then builds the billing UI
|
|
134
|
+
- The `deploy-to-vercel` skill runs `mars deploy` with guided prompts
|
|
135
|
+
|
|
136
|
+
Skills live in `.cursor/skills/` (installed automatically via `@mars-stack/core` postinstall).
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|