cli-commands
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSteedos CLI Commands | Steedos 命令行工具
Steedos CLI 命令参考 | Steedos 命令行工具
Overview | 概述
概述
The Steedos CLI () is an oclif-based command-line tool for managing Steedos projects. It provides commands for starting/restarting servers, managing source code, importing/exporting data, and package operations.
steedosSteedos CLI () 是基于 oclif 的命令行工具,用于管理 Steedos 项目。提供服务器启动/重启、源代码管理、数据导入导出和软件包操作等命令。
steedosSteedos CLI()是一款基于oclif的命令行工具,用于管理Steedos项目。它提供服务器启动/重启、源代码管理、数据导入导出和软件包操作等命令。
steedosCommands Reference | 命令参考
命令参考
steedos start
steedos start
Start the Steedos server. Writes a PID file () to the current working directory for process management.
.steedos.pid启动 Steedos 服务器。在当前工作目录写入 PID 文件 () 用于进程管理。
.steedos.pidbash
steedos startBehavior:
- Resolves and loads module
@steedos/server - Writes current process PID to
.steedos.pid - Registers signal handlers (SIGINT, SIGTERM) to clean up PID file on exit
- Calls to start the server
server.bootstrap()
启动Steedos服务器。在当前工作目录写入PID文件()用于进程管理。
.steedos.pidbash
steedos start行为:
- 解析并加载模块
@steedos/server - 将当前进程PID写入文件
.steedos.pid - 注册信号处理器(SIGINT、SIGTERM),在退出时清理PID文件
- 调用启动服务器
server.bootstrap()
steedos restart
steedos restart
Stop the running Steedos instance and start a new one. Designed for local development scenarios, especially useful for AI-assisted development workflows.
停止运行中的 Steedos 实例并启动新实例。专为本地开发场景设计,特别适用于 AI 辅助开发工作流。
bash
steedos restartBehavior:
- Reads file to find the running process
.steedos.pid - Sends to gracefully stop the process
SIGTERM - Waits up to 30 seconds for the process to exit
- If timeout, sends to force kill
SIGKILL - Starts a new server instance (same as )
steedos start
AI-Assisted Development Workflow | AI 辅助开发工作流:
After AI modifies code (e.g., triggers, functions, objects), use to apply changes:
steedos restartAI 修改代码后(如触发器、函数、对象),使用 应用更改:
steedos restartbash
undefined停止运行中的Steedos实例并启动新实例。专为本地开发场景设计,特别适用于AI辅助开发工作流。
bash
steedos restart行为:
- 读取文件以查找运行中的进程
.steedos.pid - 发送信号优雅停止进程
SIGTERM - 等待最多30秒让进程退出
- 如果超时,发送信号强制终止进程
SIGKILL - 启动新的服务器实例(与功能相同)
steedos start
AI辅助开发工作流:
AI修改代码后(如触发器、函数、对象),使用应用更改:
steedos restartbash
undefinedAI workflow: modify code → restart → verify
AI工作流:修改代码 → 重启 → 验证
steedos restart
**Important Notes | 重要说明:**
- **Local development only** — 仅用于本地开发环境
- **Not for Docker/cluster deployments** — 不适用于 Docker/集群部署(Docker 使用 supervisord 管理进程,集群使用编排器管理)
- PID file is local to the filesystem — PID 文件是本地文件,无法跨容器操作
- The new server runs in the **foreground** (blocks the terminal) — 新服务在**前台**运行(占用终端)steedos restart
**重要说明:**
- 仅用于本地开发环境
- 不适用于Docker/集群部署(Docker使用supervisord管理进程,集群使用编排器管理)
- PID文件是本地文件,无法跨容器操作
- 新服务在**前台**运行(占用终端)steedos package:start
steedos package:start
Run Steedos packages as Moleculer microservices. Supports clustering and hot reload.
以 Moleculer 微服务方式运行 Steedos 软件包。支持集群和热更新。
bash
steedos package:start [--instances <count|max>] [--hot]Flags:
- : Number of worker processes (number or
--instancesfor CPU count)max - : Enable hot reload for development
--hot
以Moleculer微服务方式运行Steedos软件包。支持集群和热更新。
bash
steedos package:start [--instances <count|max>] [--hot]参数:
- :工作进程数量(数字或
--instances表示CPU核心数)max - :启用开发模式热更新
--hot
steedos source:deploy
steedos source:deploy
Deploy local source metadata to the metadata server.
将本地源代码元数据部署到 metadata server。
bash
steedos source:deploy -p <path>将本地源代码元数据部署到metadata server。
bash
steedos source:deploy -p <path>steedos source:retrieve
steedos source:retrieve
Retrieve source metadata from the metadata server to local.
从 metadata server 获取源代码元数据到本地。
bash
steedos source:retrieve -p <path>从metadata server获取源代码元数据到本地。
bash
steedos source:retrieve -p <path>steedos source:config
steedos source:config
Configure the metadata server connection (interactive).
配置 metadata server 连接(交互式)。
bash
steedos source:config配置metadata server连接(交互式)。
bash
steedos source:configsteedos source:convert
steedos source:convert
Convert legacy format files to the modern source format.
将旧格式文件转换为现代源代码格式。
bash
steedos source:convert -p <path>将旧格式文件转换为现代源代码格式。
bash
steedos source:convert -p <path>steedos source:merge
steedos source:merge
Merge split object-related files (, , etc.) into a single file.
.field.yml.listview.yml.object.yml合并拆分的对象相关文件为单个 文件。
.object.ymlbash
steedos source:merge -p <path>合并拆分的对象相关文件(、等)为单个文件。
.field.yml.listview.yml.object.ymlbash
steedos source:merge -p <path>steedos data:export
steedos data:export
Export object data to JSON files.
导出对象数据为 JSON 文件。
bash
steedos data:export -o <objectName> [-i <ids>] [-f <fields>]导出对象数据为JSON文件。
bash
steedos data:export -o <objectName> [-i <ids>] [-f <fields>]steedos data:import
steedos data:import
Import data from JSON files or plan files.
从 JSON 文件或 plan 文件导入数据。
bash
steedos data:import -p <path>从JSON文件或plan文件导入数据。
bash
steedos data:import -p <path>steedos auth:login
steedos auth:login
Authenticate with the metadata server.
登录 metadata server。
bash
steedos auth:login -u <username> -p <password>登录metadata server。
bash
steedos auth:login -u <username> -p <password>steedos i18n
steedos i18n
Sync internationalization resources.
同步国际化资源文件。
bash
steedos i18n同步国际化资源文件。
bash
steedos i18nsteedos package:build
steedos package:build
Build/compress a Steedos package.
构建/压缩 Steedos 软件包。
bash
steedos package:build构建/压缩Steedos软件包。
bash
steedos package:buildPID File Management | PID 文件管理
PID文件管理
The and commands use a file for process tracking:
startrestart.steedos.pidstartrestart.steedos.pid- Location:
{project_root}/.steedos.pid - Content: Process ID (PID) as plain text
- Created: On or
steedos startsteedos restart - Removed: On process exit (SIGINT, SIGTERM, or normal exit)
- Scope: Local to the filesystem (single machine, single instance)
Add to :
.steedos.pid.gitignoregitignore
.steedos.pidstartrestart.steedos.pid- 位置:
{project_root}/.steedos.pid - 内容:纯文本格式的进程ID(PID)
- 创建时机:执行或
steedos start时steedos restart - 删除时机:进程退出时(SIGINT、SIGTERM或正常退出)
- 作用范围:本地文件系统(单机器、单实例)
将添加到:
.steedos.pid.gitignoregitignore
.steedos.pidDeployment Contexts | 部署场景
部署场景
| Context | Restart Method | Notes |
|---|---|---|
| Local development | | Uses PID file, foreground process |
| Docker single container | supervisord | |
| Docker Swarm / K8s cluster | Orchestrator rolling update | |
| Moleculer microservice | | Hot reload for development |
| 场景 | 重启方式 | 说明 |
|---|---|---|
| 本地开发 | | 使用PID文件,前台进程 |
| Docker单容器 | supervisord | 由supervisord管理 |
| Docker Swarm / K8s集群 | 编排器滚动更新 | 使用 |
| Moleculer微服务 | | 开发模式支持热更新 |
Best Practices | 最佳实践
最佳实践
For AI-Assisted Development | AI 辅助开发
AI辅助开发
- Use in an async terminal to run the server in background
steedos start - After code modifications, run to apply changes
steedos restart - Wait for the server to fully start before testing changes
- The restart command handles graceful shutdown automatically
AI 辅助开发工作流:
- 在异步终端中用 启动服务
steedos start - 修改代码后,运行 应用更改
steedos restart - 等待服务完全启动后再测试
- restart 命令会自动处理优雅关闭
- 在异步终端中使用在后台运行服务器
steedos start - 修改代码后,运行应用更改
steedos restart - 等待服务器完全启动后再测试更改
- restart命令会自动处理优雅关闭