diff --git a/README.md b/README.md index 4d1f454..8f896ae 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,9 @@ npx atxp create my-app --framework express # Create with Cloudflare Workers framework npx atxp create my-app --framework cloudflare +# Create a new Mastra project +npx atxp create my-app --framework mastra + # Skip git initialization npx atxp create my-app --no-git diff --git a/packages/atxp/src/create-project.ts b/packages/atxp/src/create-project.ts index a5e6824..1f2ec35 100644 --- a/packages/atxp/src/create-project.ts +++ b/packages/atxp/src/create-project.ts @@ -4,7 +4,7 @@ import chalk from 'chalk'; import { spawn } from 'child_process'; import inquirer from 'inquirer'; -export type Framework = 'express' | 'cloudflare'; +export type Framework = 'express' | 'cloudflare' | 'mastra'; // Utility function to check if git is available async function isGitAvailable(): Promise { @@ -145,6 +145,10 @@ const TEMPLATES: Record = { cloudflare: { url: 'https://github.com/atxp-dev/atxp-cloudflare-chat-template', humanText: 'Cloudflare (Cloudflare Chat agent with ATXP integration)' + }, + mastra: { + url: 'https://github.com/atxp-dev/atxp-mastra-starter.git', + humanText: 'Mastra (Mastra.js starter template)' } // Future frameworks can be added here // vercel: { diff --git a/packages/atxp/src/index.ts b/packages/atxp/src/index.ts index 876815c..1500313 100644 --- a/packages/atxp/src/index.ts +++ b/packages/atxp/src/index.ts @@ -107,14 +107,20 @@ async function main() { const appName = createOptions.appName; if (!appName) { console.error('Error: App name is required'); - console.log('Usage: npx atxp create [--framework express]'); + console.log('Usage: npx atxp create [--framework express|cloudflare|mastra]'); process.exit(1); } + // Special message for users passing the common typo/alias "mastra" + if ((createOptions.framework as unknown as string) === 'mastra') { + console.log('Mastra support coming soon. Join our Discord at https://discord.gg/FuJXHhe9aW to get notified when Mastra support is available.'); + process.exit(0); + } + const framework: Framework = createOptions.framework || 'express'; // Validate framework - const validFrameworks: Framework[] = ['express', 'cloudflare']; + const validFrameworks: Framework[] = ['express', 'cloudflare', 'mastra']; if (createOptions.framework && !validFrameworks.includes(createOptions.framework)) { console.error(`Error: Unknown framework "${createOptions.framework}". Available frameworks: ${validFrameworks.join(', ')}`); process.exit(1);