命令行接口
🌐 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.
已添加Direct link to 已添加
🌐 Added
mastra migrate 命令Direct link to mastra-migrate-command
🌐 mastra migrate command
一个新的 mastra migrate 命令有助于在升级 Mastra 版本时运行数据库迁移。这在从可能存在数据不兼容的旧版本升级时尤其有用。
🌐 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.
已移除Direct link to 已移除
🌐 Removed
mastra deploy 命令Direct link to mastra-deploy-command
🌐 mastra deploy command
mastra deploy 命令已从命令行接口中移除。此更改通过去除特定供应商的部署逻辑来简化命令行接口。
🌐 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.
mastra build 的 --env 旗Direct link to --env-flag-from-mastra-build
🌐 --env flag from mastra build
mastra build 命令中的 --env 标志已被移除。此更改简化了构建命令。
🌐 The --env flag has been removed from the mastra build command. This change simplifies the build command.
要进行迁移,请使用 mastra start --env <env> 在自定义环境下启动构建输出。
🌐 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
mastra dev 的 --port 旗Direct link to --port-flag-from-mastra-dev
🌐 --port flag from mastra dev
--port 标志已从 mastra dev 命令中删除。端口配置现在通过 Mastra 实例配置进行管理。这一更改实现了端口配置的集中化。
🌐 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.
要进行迁移,请在 Mastra 实例上使用 server.port,而不是使用 CLI 标志。
🌐 To migrate, use server.port on the Mastra instance instead of the CLI flag.
const mastra = new Mastra({
server: {
port: 3001,
},
});
来自 CLI 的遥测选项Direct link to 来自 CLI 的遥测选项
🌐 Telemetry options from CLI
telemetry 选项已从 CLI 命令中移除,包括 --no-telemetry / -nt 标志。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.
要进行迁移,请从 CLI 命令中移除遥测标志。使用 @mastra/observability 来启用追踪功能。
🌐 To migrate, remove telemetry flags from CLI commands. Use @mastra/observability for tracing features.