CLI
The CLI has been simplified by removing deployment commands, configuration flags, and starter files. A new migration command has been added to help with database schema upgrades.
AddedDirect link to Added
mastra migrate commandDirect link to mastra-migrate-command
A new mastra migrate command helps run database migrations when upgrading Mastra versions. This is particularly useful when upgrading from older versions that may have data incompatibilities.
npx mastra migrate
The command bundles your project, connects to your configured storage, and runs any necessary migrations. Currently supports migrating duplicate spans entries that may prevent unique constraint creation.
See the Storage migration guide for details on when this migration is needed.
RemovedDirect link to Removed
mastra deploy commandDirect link to mastra-deploy-command
The mastra deploy command has been removed from the CLI. This change simplifies the CLI by removing vendor-specific deployment logic.
To migrate, choose one of the deployment platforms of your choice.
--env flag from mastra buildDirect link to --env-flag-from-mastra-build
The --env flag has been removed from the mastra build command. This change simplifies the build command.
To migrate, use mastra start --env <env> to start the build output with a custom environment.
- mastra build --env production
+ mastra build
+ mastra start --env production
--port flag from mastra devDirect link to --port-flag-from-mastra-dev
The --port flag has been removed from the mastra dev command. Port configuration is now handled through the Mastra instance configuration. This change centralizes port configuration.
To migrate, use server.port on the Mastra instance instead of the CLI flag.
const mastra = new Mastra({
server: {
port: 3001,
},
});
Telemetry options from CLIDirect link to Telemetry options from CLI
The telemetry option has been removed from CLI commands including the --no-telemetry / -nt flag. Telemetry configuration has been removed from the CLI. This change reflects the move of telemetry features to the observability package.
To migrate, remove telemetry flags from CLI commands. Use @mastra/observability for tracing features.