Scaffold Your Project
Create a new MastraKit project with the CLI
Create Your Project
Run the scaffold command with your license key:
npx mastrakit my-project --key sk_live_your_key_hereOr set the key as an environment variable first:
export MASTRAKIT_LICENSE_KEY=sk_live_your_key_here
npx mastrakit my-projectThe CLI will prompt you for:
| Prompt | Options | Default |
|---|---|---|
| Auth provider | Better Auth | Better Auth |
| Payments | Stripe, Polar | Stripe |
| Include metering | Yes / No | No |
| Include docs site | Yes / No | No |
| LLM provider | Anthropic, OpenAI | Anthropic |
| Currency | EUR, USD | EUR |
| Version control & CI/CD | GitHub (recommended), None | GitHub |
CLI Flags
npx mastrakit [project-name] [flags]| Flag | Description |
|---|---|
--key <license-key> | License key (or set MASTRAKIT_LICENSE_KEY env var) |
--owner <owner> | GitHub user or org to create the repo under |
--deploy | Run the deploy wizard after scaffolding |
--skip-install | Skip pnpm install |
--no-github | Skip GitHub repo creation |
--no-cache | Force fresh template download |
--yes | Accept all defaults (non-interactive) |
--dry-run | Preview what would be scaffolded without writing files |
--local-template <path> | Use a local template directory (dev mode) |
What Gets Created
my-project/
├── apps/
│ ├── web/ # TanStack Start frontend
│ ├── api/ # Hono REST API
│ ├── auth/ # Better Auth service
│ ├── mastra/ # AI agent + MCP server
│ └── metering/ # Credit ledger (if selected)
├── packages/
│ └── shared/ # Types, schemas, plans, i18n
├── scripts/
│ ├── conductor/ # Workspace automation (if GitHub selected)
│ ├── env/ # Environment secret management
│ └── dev/ # Local development helpers
├── .github/
│ └── workflows/ # CI/CD pipelines (if GitHub selected)
└── .mastrakit/
└── config.json # Your scaffold selectionsGitHub Setup (if selected)
When you choose GitHub as your CI/CD option, the scaffold:
- Runs
git initand creates an initial commit - Prompts for repository visibility (private or public)
- Prompts for the GitHub owner (your user or one of your orgs)
- Creates a GitHub repository via
gh repo create <owner>/<name> - Pushes the initial commit
The gh CLI must be installed and authenticated (gh auth login). If it's not available, the scaffold will warn you and fall back to "None".
Choosing an Organization
If your authenticated gh user belongs to any organizations, the CLI prompts:
? Create GitHub repository under:
❯ jan-doe (personal)
themakers-labs
my-other-orgOrganizations are discovered via gh api user/orgs. To create under an org non-interactively, pass --owner:
npx mastrakit my-project --owner themakers-labsIf your gh user has no organizations, the scaffold skips the prompt and uses your personal account.
Non-Interactive Mode
Skip all prompts with --yes to accept defaults. Combine with --owner to pin the GitHub target:
npx mastrakit my-project \
--yes \
--key sk_live_your_key_here \
--owner themakers-labsSkip dependency installation:
npx mastrakit my-project --skip-installPreview without writing files:
npx mastrakit my-project --dry-runConfiguration File
After scaffolding, your selections are saved to .mastrakit/config.json in the project root:
{
"version": "0.1.14",
"createdAt": "2026-04-21T12:00:00.000Z",
"components": {
"auth": "better-auth",
"llm": "anthropic",
"payments": "stripe",
"currency": "eur",
"metering": false,
"docs": false,
"cicd": "github"
}
}This file is used by the deploy wizard (npx mastrakit deploy) to know which services to provision and configure. Don't delete it.
After Scaffolding
cd my-project
pnpm install # Install dependencies (if --skip-install was used)
pnpm dev # Start all services locallyWhen ready to deploy, run the deploy wizard:
npx mastrakit deployOr use a deploy config file for non-interactive deployment:
npx mastrakit deploy --config deploy.json