create-mastra 0.0.0-new-button-export-20251219133013 → 0.0.0-om-20260129012647
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/CHANGELOG.md +109 -1
- package/README.md +1 -1
- package/dist/index.js +91 -14
- package/dist/index.js.map +1 -1
- package/dist/templates/dev.entry.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-om-20260129012647
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix workflow run input caching bug in studio UI ([#11784](https://github.com/mastra-ai/mastra/pull/11784))
|
|
8
|
+
|
|
9
|
+
## 1.0.1
|
|
10
|
+
|
|
11
|
+
## 1.0.1-alpha.0
|
|
12
|
+
|
|
13
|
+
## 1.0.0
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
|
6
16
|
|
|
@@ -10,13 +20,30 @@
|
|
|
10
20
|
|
|
11
21
|
- Mark as stable ([`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc))
|
|
12
22
|
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- Add Antigravity IDE support to create-mastra CLI. Users can now select Antigravity during project initialization and automatically configure the global Mastra MCP server for the IDE, reducing manual setup and enabling immediate use of Mastra agents. ([#11374](https://github.com/mastra-ai/mastra/pull/11374))
|
|
26
|
+
|
|
13
27
|
### Patch Changes
|
|
14
28
|
|
|
29
|
+
- Remove `streamVNext`, `resumeStreamVNext`, and `observeStreamVNext` methods, call `stream`, `resumeStream` and `observeStream` directly ([#11499](https://github.com/mastra-ai/mastra/pull/11499))
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
+ const run = await workflow.createRun({ runId: '123' });
|
|
33
|
+
- const stream = await run.streamVNext({ inputData: { ... } });
|
|
34
|
+
+ const stream = await run.stream({ inputData: { ... } });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- Replace deprecated client.getTraces with a client.listTraces ([#11711](https://github.com/mastra-ai/mastra/pull/11711))
|
|
38
|
+
|
|
15
39
|
- Fix select options overflow when list is long by adding maximum height ([#10813](https://github.com/mastra-ai/mastra/pull/10813))
|
|
16
40
|
|
|
17
41
|
- dependencies updates: ([#10111](https://github.com/mastra-ai/mastra/pull/10111))
|
|
18
42
|
- Updated dependency [`pino@^10.1.0` ↗︎](https://www.npmjs.com/package/pino/v/10.1.0) (from `^9.7.0`, in `dependencies`)
|
|
19
43
|
|
|
44
|
+
- dependencies updates: ([#11642](https://github.com/mastra-ai/mastra/pull/11642))
|
|
45
|
+
- Updated dependency [`fs-extra@^11.3.3` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.3) (from `^11.3.2`, in `dependencies`)
|
|
46
|
+
|
|
20
47
|
- dependencies updates: ([#9781](https://github.com/mastra-ai/mastra/pull/9781))
|
|
21
48
|
- Updated dependency [`posthog-node@^5.11.2` ↗︎](https://www.npmjs.com/package/posthog-node/v/5.11.2) (from `^4.18.0`, in `dependencies`)
|
|
22
49
|
|
|
@@ -39,6 +66,18 @@
|
|
|
39
66
|
|
|
40
67
|
- Make MainSidebar toggle button sticky to bottom, always visible ([#9682](https://github.com/mastra-ai/mastra/pull/9682))
|
|
41
68
|
|
|
69
|
+
- Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
|
|
70
|
+
- Add suspend/resume capabilities to agent network
|
|
71
|
+
- Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
|
|
72
|
+
|
|
73
|
+
`agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
|
|
74
|
+
|
|
75
|
+
- Fix peer dependency conflicts in browsing-agent template. Updated template dependencies to align with @browserbasehq/stagehand@2.5.6 requirements: ([#11346](https://github.com/mastra-ai/mastra/pull/11346))
|
|
76
|
+
- Updated `dotenv` from `^17.2.1` to `^16.4.5`
|
|
77
|
+
- Updated `zod` from `^3.25.76` to `^3.25.67`
|
|
78
|
+
|
|
79
|
+
This ensures `npx create-mastra@latest --template browsing-agent` can be installed and run without peer dependency errors.
|
|
80
|
+
|
|
42
81
|
- Detect bun runtime and cleanup on failure ([#10242](https://github.com/mastra-ai/mastra/pull/10242))
|
|
43
82
|
|
|
44
83
|
- Add `Run` instance to client-js. `workflow.createRun` returns the `Run` instance which can be used for the different run methods. ([#11207](https://github.com/mastra-ai/mastra/pull/11207))
|
|
@@ -52,12 +91,18 @@
|
|
|
52
91
|
|
|
53
92
|
- Add timeTravel APIs and add timeTravel feature to studio ([#10361](https://github.com/mastra-ai/mastra/pull/10361))
|
|
54
93
|
|
|
94
|
+
- Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
|
|
95
|
+
|
|
55
96
|
- Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
|
|
56
97
|
|
|
57
98
|
```typescript
|
|
58
99
|
await workflow.deleteWorkflowRunById(runId);
|
|
59
100
|
```
|
|
60
101
|
|
|
102
|
+
- Add initial state input to workflow form in studio ([#11560](https://github.com/mastra-ai/mastra/pull/11560))
|
|
103
|
+
|
|
104
|
+
- Make initialState optional in studio ([#11744](https://github.com/mastra-ai/mastra/pull/11744))
|
|
105
|
+
|
|
61
106
|
- Fix discriminatedUnion schema information lost when json schema is converted to zod ([#10500](https://github.com/mastra-ai/mastra/pull/10500))
|
|
62
107
|
|
|
63
108
|
- Move useScorers down to trace page to trigger it once for all trace spans ([#10985](https://github.com/mastra-ai/mastra/pull/10985))
|
|
@@ -72,8 +117,71 @@
|
|
|
72
117
|
|
|
73
118
|
- Fix double scroll on agent chat container ([#10253](https://github.com/mastra-ai/mastra/pull/10253))
|
|
74
119
|
|
|
120
|
+
- Display network completion validation results and scorer feedback in the Playground when viewing agent network runs, letting users see pass/fail status and actionable feedback from completion scorers ([#11562](https://github.com/mastra-ai/mastra/pull/11562))
|
|
121
|
+
|
|
75
122
|
- fix isTopLevelSpan value definition on SpanScoring to properly recognize lack of span?.parentSpanId value (null or empty string) ([#11083](https://github.com/mastra-ai/mastra/pull/11083))
|
|
76
123
|
|
|
124
|
+
## 1.0.0-beta.19
|
|
125
|
+
|
|
126
|
+
## 1.0.0-beta.18
|
|
127
|
+
|
|
128
|
+
## 1.0.0-beta.17
|
|
129
|
+
|
|
130
|
+
## 1.0.0-beta.16
|
|
131
|
+
|
|
132
|
+
## 1.0.0-beta.15
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- Add human-in-the-loop (HITL) support to agent networks ([#11678](https://github.com/mastra-ai/mastra/pull/11678))
|
|
137
|
+
- Add suspend/resume capabilities to agent network
|
|
138
|
+
- Enable auto-resume for suspended network execution via `autoResumeSuspendedTools`
|
|
139
|
+
|
|
140
|
+
`agent.resumeNetwork`, `agent.approveNetworkToolCall`, `agent.declineNetworkToolCall`
|
|
141
|
+
|
|
142
|
+
## 1.0.0-beta.14
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- Replace deprecated client.getTraces with a client.listTraces ([#11711](https://github.com/mastra-ai/mastra/pull/11711))
|
|
147
|
+
|
|
148
|
+
- dependencies updates: ([#11642](https://github.com/mastra-ai/mastra/pull/11642))
|
|
149
|
+
- Updated dependency [`fs-extra@^11.3.3` ↗︎](https://www.npmjs.com/package/fs-extra/v/11.3.3) (from `^11.3.2`, in `dependencies`)
|
|
150
|
+
|
|
151
|
+
- Make initialState optional in studio ([#11744](https://github.com/mastra-ai/mastra/pull/11744))
|
|
152
|
+
|
|
153
|
+
## 1.0.0-beta.13
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Remove `streamVNext`, `resumeStreamVNext`, and `observeStreamVNext` methods, call `stream`, `resumeStream` and `observeStream` directly ([#11499](https://github.com/mastra-ai/mastra/pull/11499))
|
|
158
|
+
|
|
159
|
+
```diff
|
|
160
|
+
+ const run = await workflow.createRun({ runId: '123' });
|
|
161
|
+
- const stream = await run.streamVNext({ inputData: { ... } });
|
|
162
|
+
+ const stream = await run.stream({ inputData: { ... } });
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- Fix peer dependency conflicts in browsing-agent template. Updated template dependencies to align with @browserbasehq/stagehand@2.5.6 requirements: ([#11346](https://github.com/mastra-ai/mastra/pull/11346))
|
|
166
|
+
- Updated `dotenv` from `^17.2.1` to `^16.4.5`
|
|
167
|
+
- Updated `zod` from `^3.25.76` to `^3.25.67`
|
|
168
|
+
|
|
169
|
+
This ensures `npx create-mastra@latest --template browsing-agent` can be installed and run without peer dependency errors.
|
|
170
|
+
|
|
171
|
+
- Add initial state input to workflow form in studio ([#11560](https://github.com/mastra-ai/mastra/pull/11560))
|
|
172
|
+
|
|
173
|
+
- Display network completion validation results and scorer feedback in the Playground when viewing agent network runs, letting users see pass/fail status and actionable feedback from completion scorers ([#11562](https://github.com/mastra-ai/mastra/pull/11562))
|
|
174
|
+
|
|
175
|
+
## 1.0.0-beta.12
|
|
176
|
+
|
|
177
|
+
### Minor Changes
|
|
178
|
+
|
|
179
|
+
- Add Antigravity IDE support to create-mastra CLI. Users can now select Antigravity during project initialization and automatically configure the global Mastra MCP server for the IDE, reducing manual setup and enabling immediate use of Mastra agents. ([#11374](https://github.com/mastra-ai/mastra/pull/11374))
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- Add debugger-like click-through UI to workflow graph ([#11350](https://github.com/mastra-ai/mastra/pull/11350))
|
|
184
|
+
|
|
77
185
|
## 1.0.0-beta.11
|
|
78
186
|
|
|
79
187
|
## 1.0.0-beta.10
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ It includes everything you need to go from early prototypes to production-ready
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
> [!IMPORTANT]
|
|
12
|
-
> Make sure that you have Node.js
|
|
12
|
+
> Make sure that you have Node.js 22.13.0 or later installed on your system.
|
|
13
13
|
|
|
14
14
|
Using npm:
|
|
15
15
|
|
package/dist/index.js
CHANGED
|
@@ -22,8 +22,8 @@ import fsExtra$1 from 'fs-extra';
|
|
|
22
22
|
import pino from 'pino';
|
|
23
23
|
import pretty from 'pino-pretty';
|
|
24
24
|
|
|
25
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
26
|
-
var __dirname = path3.dirname(__filename);
|
|
25
|
+
var __filename$1 = fileURLToPath(import.meta.url);
|
|
26
|
+
var __dirname$1 = path3.dirname(__filename$1);
|
|
27
27
|
var analyticsInstance = null;
|
|
28
28
|
function getAnalytics() {
|
|
29
29
|
return analyticsInstance;
|
|
@@ -39,7 +39,7 @@ var PosthogAnalytics = class {
|
|
|
39
39
|
host = "https://app.posthog.com"
|
|
40
40
|
}) {
|
|
41
41
|
this.version = version;
|
|
42
|
-
const cliConfigPath = path3.join(__dirname, "mastra-cli.json");
|
|
42
|
+
const cliConfigPath = path3.join(__dirname$1, "mastra-cli.json");
|
|
43
43
|
if (existsSync(cliConfigPath)) {
|
|
44
44
|
try {
|
|
45
45
|
const { distinctId, sessionId } = JSON.parse(readFileSync(cliConfigPath, "utf-8"));
|
|
@@ -67,7 +67,7 @@ var PosthogAnalytics = class {
|
|
|
67
67
|
}
|
|
68
68
|
writeCliConfig({ distinctId, sessionId }) {
|
|
69
69
|
try {
|
|
70
|
-
writeFileSync(path3.join(__dirname, "mastra-cli.json"), JSON.stringify({ distinctId, sessionId }));
|
|
70
|
+
writeFileSync(path3.join(__dirname$1, "mastra-cli.json"), JSON.stringify({ distinctId, sessionId }));
|
|
71
71
|
} catch {
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -105,6 +105,10 @@ var PosthogAnalytics = class {
|
|
|
105
105
|
machine_id: os.hostname()
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
+
getDurationMs(startTime) {
|
|
109
|
+
const [seconds, nanoseconds] = process.hrtime(startTime);
|
|
110
|
+
return seconds * 1e3 + nanoseconds / 1e6;
|
|
111
|
+
}
|
|
108
112
|
captureSessionStart() {
|
|
109
113
|
if (!this.client) {
|
|
110
114
|
return;
|
|
@@ -173,8 +177,7 @@ var PosthogAnalytics = class {
|
|
|
173
177
|
const startTime = process.hrtime();
|
|
174
178
|
try {
|
|
175
179
|
const result = await execution();
|
|
176
|
-
const
|
|
177
|
-
const durationMs = seconds * 1e3 + nanoseconds / 1e6;
|
|
180
|
+
const durationMs = this.getDurationMs(startTime);
|
|
178
181
|
this.trackCommand({
|
|
179
182
|
command,
|
|
180
183
|
args,
|
|
@@ -184,8 +187,7 @@ var PosthogAnalytics = class {
|
|
|
184
187
|
});
|
|
185
188
|
return result;
|
|
186
189
|
} catch (error) {
|
|
187
|
-
const
|
|
188
|
-
const durationMs = seconds * 1e3 + nanoseconds / 1e6;
|
|
190
|
+
const durationMs = this.getDurationMs(startTime);
|
|
189
191
|
this.trackCommand({
|
|
190
192
|
command,
|
|
191
193
|
args,
|
|
@@ -1231,7 +1233,7 @@ var PinoLogger = class _PinoLogger extends MastraLogger {
|
|
|
1231
1233
|
};
|
|
1232
1234
|
|
|
1233
1235
|
var package_default = {
|
|
1234
|
-
version: "1.0.
|
|
1236
|
+
version: "1.0.1"};
|
|
1235
1237
|
function getPackageManagerAddCommand(pm) {
|
|
1236
1238
|
switch (pm) {
|
|
1237
1239
|
case "npm":
|
|
@@ -1252,7 +1254,7 @@ var DepsService = class {
|
|
|
1252
1254
|
this.packageManager = this.getPackageManager();
|
|
1253
1255
|
}
|
|
1254
1256
|
findLockFile(dir) {
|
|
1255
|
-
const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock"];
|
|
1257
|
+
const lockFiles = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock", "bun.lock", "bun.lockb"];
|
|
1256
1258
|
for (const file of lockFiles) {
|
|
1257
1259
|
if (fs3__default__default.existsSync(path3.join(dir, file))) {
|
|
1258
1260
|
return file;
|
|
@@ -1274,6 +1276,7 @@ var DepsService = class {
|
|
|
1274
1276
|
case "yarn.lock":
|
|
1275
1277
|
return "yarn";
|
|
1276
1278
|
case "bun.lock":
|
|
1279
|
+
case "bun.lockb":
|
|
1277
1280
|
return "bun";
|
|
1278
1281
|
default:
|
|
1279
1282
|
return "npm";
|
|
@@ -1491,6 +1494,7 @@ async function writeMergedConfig(configPath, editor, versionTag) {
|
|
|
1491
1494
|
});
|
|
1492
1495
|
}
|
|
1493
1496
|
var windsurfGlobalMCPConfigPath = path3.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
1497
|
+
var antigravityGlobalMCPConfigPath = path3.join(os.homedir(), ".gemini", "antigravity", "mcp_config.json");
|
|
1494
1498
|
var cursorGlobalMCPConfigPath = path3.join(os.homedir(), ".cursor", "mcp.json");
|
|
1495
1499
|
path3.join(process.cwd(), ".vscode", "mcp.json");
|
|
1496
1500
|
var vscodeGlobalMCPConfigPath = path3.join(
|
|
@@ -1522,11 +1526,20 @@ async function installMastraDocsMCPServer({
|
|
|
1522
1526
|
}
|
|
1523
1527
|
await writeMergedConfig(windsurfGlobalMCPConfigPath, editor, versionTag);
|
|
1524
1528
|
}
|
|
1529
|
+
if (editor === `antigravity`) {
|
|
1530
|
+
const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);
|
|
1531
|
+
if (alreadyInstalled) {
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
await writeMergedConfig(antigravityGlobalMCPConfigPath, editor, versionTag);
|
|
1535
|
+
}
|
|
1525
1536
|
}
|
|
1526
1537
|
async function globalMCPIsAlreadyInstalled(editor, versionTag) {
|
|
1527
1538
|
let configPath = ``;
|
|
1528
1539
|
if (editor === "windsurf") {
|
|
1529
1540
|
configPath = windsurfGlobalMCPConfigPath;
|
|
1541
|
+
} else if (editor === "antigravity") {
|
|
1542
|
+
configPath = antigravityGlobalMCPConfigPath;
|
|
1530
1543
|
} else if (editor === "cursor-global") {
|
|
1531
1544
|
configPath = cursorGlobalMCPConfigPath;
|
|
1532
1545
|
} else if (editor === "vscode") {
|
|
@@ -1973,7 +1986,7 @@ export const mastra = new Mastra()
|
|
|
1973
1986
|
import { Mastra } from '@mastra/core/mastra';
|
|
1974
1987
|
import { PinoLogger } from '@mastra/loggers';
|
|
1975
1988
|
import { LibSQLStore } from '@mastra/libsql';
|
|
1976
|
-
import { Observability } from '@mastra/observability';
|
|
1989
|
+
import { Observability, DefaultExporter, CloudExporter, SensitiveDataFilter } from '@mastra/observability';
|
|
1977
1990
|
${addWorkflow ? `import { weatherWorkflow } from './workflows/weather-workflow';` : ""}
|
|
1978
1991
|
${addAgent ? `import { weatherAgent } from './agents/weather-agent';` : ""}
|
|
1979
1992
|
${addScorers ? `import { toolCallAppropriatenessScorer, completenessScorer, translationScorer } from './scorers/weather-scorer';` : ""}
|
|
@@ -1990,8 +2003,18 @@ export const mastra = new Mastra({
|
|
|
1990
2003
|
level: 'info',
|
|
1991
2004
|
}),
|
|
1992
2005
|
observability: new Observability({
|
|
1993
|
-
|
|
1994
|
-
|
|
2006
|
+
configs: {
|
|
2007
|
+
default: {
|
|
2008
|
+
serviceName: 'mastra',
|
|
2009
|
+
exporters: [
|
|
2010
|
+
new DefaultExporter(), // Persists traces to storage for Mastra Studio
|
|
2011
|
+
new CloudExporter(), // Sends traces to Mastra Cloud (if MASTRA_CLOUD_ACCESS_TOKEN is set)
|
|
2012
|
+
],
|
|
2013
|
+
spanOutputProcessors: [
|
|
2014
|
+
new SensitiveDataFilter(), // Redacts sensitive data like passwords, tokens, keys
|
|
2015
|
+
],
|
|
2016
|
+
},
|
|
2017
|
+
},
|
|
1995
2018
|
}),
|
|
1996
2019
|
});
|
|
1997
2020
|
`
|
|
@@ -2114,6 +2137,10 @@ var interactivePrompt = async (args = {}) => {
|
|
|
2114
2137
|
{
|
|
2115
2138
|
value: "vscode",
|
|
2116
2139
|
label: "VSCode"
|
|
2140
|
+
},
|
|
2141
|
+
{
|
|
2142
|
+
value: "antigravity",
|
|
2143
|
+
label: "Antigravity"
|
|
2117
2144
|
}
|
|
2118
2145
|
]
|
|
2119
2146
|
});
|
|
@@ -2150,6 +2177,19 @@ This means the Mastra docs MCP server will be available in all your Windsurf pro
|
|
|
2150
2177
|
return void 0;
|
|
2151
2178
|
}
|
|
2152
2179
|
}
|
|
2180
|
+
if (editor === `antigravity`) {
|
|
2181
|
+
const confirm3 = await ve({
|
|
2182
|
+
message: `Antigravity only supports a global MCP config (at ${antigravityGlobalMCPConfigPath}). Is it ok to add/update that global config?
|
|
2183
|
+
This will make the Mastra docs MCP server available in all Antigravity projects.`,
|
|
2184
|
+
options: [
|
|
2185
|
+
{ value: "yes", label: "Yes, I understand" },
|
|
2186
|
+
{ value: "skip", label: "No, skip for now" }
|
|
2187
|
+
]
|
|
2188
|
+
});
|
|
2189
|
+
if (confirm3 !== `yes`) {
|
|
2190
|
+
return void 0;
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2153
2193
|
return editor;
|
|
2154
2194
|
},
|
|
2155
2195
|
initGit: async () => {
|
|
@@ -2544,6 +2584,42 @@ async function initializePackageJson(pm) {
|
|
|
2544
2584
|
};
|
|
2545
2585
|
await fs4.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
2546
2586
|
}
|
|
2587
|
+
var writeReadmeFile = async ({ dirPath, projectName }) => {
|
|
2588
|
+
const packageManager = getPackageManager();
|
|
2589
|
+
const readmePath = path3.join(dirPath, "README.md");
|
|
2590
|
+
const content = `# ${projectName}
|
|
2591
|
+
|
|
2592
|
+
Welcome to your new [Mastra](https://mastra.ai/) project! We're excited to see what you'll build.
|
|
2593
|
+
|
|
2594
|
+
## Getting Started
|
|
2595
|
+
|
|
2596
|
+
Start the development server:
|
|
2597
|
+
|
|
2598
|
+
\`\`\`shell
|
|
2599
|
+
${packageManager} run dev
|
|
2600
|
+
\`\`\`
|
|
2601
|
+
|
|
2602
|
+
Open [http://localhost:4111](http://localhost:4111) in your browser to access [Mastra Studio](https://mastra.ai/docs/getting-started/studio). It provides an interactive UI for building and testing your agents, along with a REST API that exposes your Mastra application as a local service. This lets you start building without worrying about integration right away.
|
|
2603
|
+
|
|
2604
|
+
You can start editing files inside the \`src/mastra\` directory. The development server will automatically reload whenever you make changes.
|
|
2605
|
+
|
|
2606
|
+
## Learn more
|
|
2607
|
+
|
|
2608
|
+
To learn more about Mastra, visit our [documentation](https://mastra.ai/docs/). Your bootstrapped project includes example code for [agents](https://mastra.ai/docs/agents/overview), [tools](https://mastra.ai/docs/agents/using-tools), [workflows](https://mastra.ai/docs/workflows/overview), [scorers](https://mastra.ai/docs/evals/overview), and [observability](https://mastra.ai/docs/observability/overview).
|
|
2609
|
+
|
|
2610
|
+
If you're new to AI agents, check out our [course](https://mastra.ai/course) and [YouTube videos](https://youtube.com/@mastra-ai). You can also join our [Discord](https://discord.gg/BTYqqHKUrf) community to get help and share your projects.
|
|
2611
|
+
|
|
2612
|
+
## Deploy on Mastra Cloud
|
|
2613
|
+
|
|
2614
|
+
[Mastra Cloud](https://cloud.mastra.ai/) gives you a serverless agent environment with atomic deployments. Access your agents from anywhere and monitor performance. Make sure they don't go off the rails with evals and tracing.
|
|
2615
|
+
|
|
2616
|
+
Check out the [deployment guide](https://mastra.ai/docs/deployment/overview) for more details.`;
|
|
2617
|
+
const formattedContent = await prettier.format(content, {
|
|
2618
|
+
parser: "markdown",
|
|
2619
|
+
singleQuote: true
|
|
2620
|
+
});
|
|
2621
|
+
await fs4.writeFile(readmePath, formattedContent);
|
|
2622
|
+
};
|
|
2547
2623
|
async function installMastraDependency(pm, dependency, versionTag, isDev, timeout) {
|
|
2548
2624
|
let installCommand = getPackageManagerAddCommand(pm);
|
|
2549
2625
|
if (isDev) {
|
|
@@ -2626,6 +2702,7 @@ var createMastraProject = async ({
|
|
|
2626
2702
|
build: "mastra build",
|
|
2627
2703
|
start: "mastra start"
|
|
2628
2704
|
});
|
|
2705
|
+
await writeReadmeFile({ dirPath: process.cwd(), projectName });
|
|
2629
2706
|
} catch (error) {
|
|
2630
2707
|
throw new Error(
|
|
2631
2708
|
`Failed to initialize project structure: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
@@ -3014,7 +3091,7 @@ program.version(`${version}`, "-v, --version").description(`create-mastra ${vers
|
|
|
3014
3091
|
program.name("create-mastra").description("Create a new Mastra project").argument("[project-name]", "Directory name of the project").option(
|
|
3015
3092
|
"-p, --project-name <string>",
|
|
3016
3093
|
"Project name that will be used in package.json and as the project directory name."
|
|
3017
|
-
).option("--default", "Quick start with defaults (src, OpenAI, examples)").option("-c, --components <components>", "Comma-separated list of components (agents, tools, workflows, scorers)").option("-l, --llm <model-provider>", "Default model provider (openai, anthropic, groq, google, or cerebras)").option("-k, --llm-api-key <api-key>", "API key for the model provider").option("-e, --example", "Include example code").option("-n, --no-example", "Do not include example code").option("-t, --timeout [timeout]", "Configurable timeout for package installation, defaults to 60000 ms").option("-d, --dir <directory>", "Target directory for Mastra source code (default: src/)").option("-m, --mcp <mcp>", "MCP Server for code editor (cursor, cursor-global, windsurf, vscode)").option(
|
|
3094
|
+
).option("--default", "Quick start with defaults (src, OpenAI, examples)").option("-c, --components <components>", "Comma-separated list of components (agents, tools, workflows, scorers)").option("-l, --llm <model-provider>", "Default model provider (openai, anthropic, groq, google, or cerebras)").option("-k, --llm-api-key <api-key>", "API key for the model provider").option("-e, --example", "Include example code").option("-n, --no-example", "Do not include example code").option("-t, --timeout [timeout]", "Configurable timeout for package installation, defaults to 60000 ms").option("-d, --dir <directory>", "Target directory for Mastra source code (default: src/)").option("-m, --mcp <mcp>", "MCP Server for code editor (cursor, cursor-global, windsurf, vscode, antigravity)").option(
|
|
3018
3095
|
"--template [template-name]",
|
|
3019
3096
|
"Create project from a template (use template name, public GitHub URL, or leave blank to select from list)"
|
|
3020
3097
|
).action(async (projectNameArg, args) => {
|