Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion packages/atxp/src/create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> {
Expand Down Expand Up @@ -145,6 +145,10 @@ const TEMPLATES: Record<Framework, { url: string; humanText: string }> = {
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: {
Expand Down
10 changes: 8 additions & 2 deletions packages/atxp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <app-name> [--framework express]');
console.log('Usage: npx atxp create <app-name> [--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);
Expand Down