cli-commands

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Steedos CLI Commands | Steedos 命令行工具

Steedos CLI 命令参考 | Steedos 命令行工具

Overview | 概述

概述

The Steedos CLI (
steedos
) 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.
Steedos CLI (
steedos
) 是基于 oclif 的命令行工具,用于管理 Steedos 项目。提供服务器启动/重启、源代码管理、数据导入导出和软件包操作等命令。
Steedos CLI(
steedos
)是一款基于oclif的命令行工具,用于管理Steedos项目。它提供服务器启动/重启、源代码管理、数据导入导出和软件包操作等命令。

Commands Reference | 命令参考

命令参考

steedos start

steedos start

Start the Steedos server. Writes a PID file (
.steedos.pid
) to the current working directory for process management.
启动 Steedos 服务器。在当前工作目录写入 PID 文件 (
.steedos.pid
) 用于进程管理。
bash
steedos start
Behavior:
  • Resolves and loads
    @steedos/server
    module
  • Writes current process PID to
    .steedos.pid
  • Registers signal handlers (SIGINT, SIGTERM) to clean up PID file on exit
  • Calls
    server.bootstrap()
    to start the server
启动Steedos服务器。在当前工作目录写入PID文件(
.steedos.pid
)用于进程管理。
bash
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 restart
Behavior:
  1. Reads
    .steedos.pid
    file to find the running process
  2. Sends
    SIGTERM
    to gracefully stop the process
  3. Waits up to 30 seconds for the process to exit
  4. If timeout, sends
    SIGKILL
    to force kill
  5. Starts a new server instance (same as
    steedos start
    )
AI-Assisted Development Workflow | AI 辅助开发工作流:
After AI modifies code (e.g., triggers, functions, objects), use
steedos restart
to apply changes:
AI 修改代码后(如触发器、函数、对象),使用
steedos restart
应用更改:
bash
undefined
停止运行中的Steedos实例并启动新实例。专为本地开发场景设计,特别适用于AI辅助开发工作流。
bash
steedos restart
行为:
  1. 读取
    .steedos.pid
    文件以查找运行中的进程
  2. 发送
    SIGTERM
    信号优雅停止进程
  3. 等待最多30秒让进程退出
  4. 如果超时,发送
    SIGKILL
    信号强制终止进程
  5. 启动新的服务器实例(与
    steedos start
    功能相同)
AI辅助开发工作流:
AI修改代码后(如触发器、函数、对象),使用
steedos restart
应用更改:
bash
undefined

AI 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:
  • --instances
    : Number of worker processes (number or
    max
    for CPU count)
  • --hot
    : Enable hot reload for development
以Moleculer微服务方式运行Steedos软件包。支持集群和热更新。
bash
steedos package:start [--instances <count|max>] [--hot]
参数:
  • --instances
    :工作进程数量(数字或
    max
    表示CPU核心数)
  • --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:config

steedos 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 (
.field.yml
,
.listview.yml
, etc.) into a single
.object.yml
file.
合并拆分的对象相关文件为单个
.object.yml
文件。
bash
steedos source:merge -p <path>
合并拆分的对象相关文件(
.field.yml
.listview.yml
等)为单个
.object.yml
文件。
bash
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 i18n

steedos package:build

steedos package:build

Build/compress a Steedos package.
构建/压缩 Steedos 软件包。
bash
steedos package:build
构建/压缩Steedos软件包。
bash
steedos package:build

PID File Management | PID 文件管理

PID文件管理

The
start
and
restart
commands use a
.steedos.pid
file for process tracking:
start
restart
命令使用
.steedos.pid
文件进行进程跟踪:
  • Location:
    {project_root}/.steedos.pid
  • Content: Process ID (PID) as plain text
  • Created: On
    steedos start
    or
    steedos restart
  • Removed: On process exit (SIGINT, SIGTERM, or normal exit)
  • Scope: Local to the filesystem (single machine, single instance)
Add
.steedos.pid
to
.gitignore
:
gitignore
.steedos.pid
start
restart
命令使用
.steedos.pid
文件进行进程跟踪:
  • 位置
    {project_root}/.steedos.pid
  • 内容:纯文本格式的进程ID(PID)
  • 创建时机:执行
    steedos start
    steedos restart
  • 删除时机:进程退出时(SIGINT、SIGTERM或正常退出)
  • 作用范围:本地文件系统(单机器、单实例)
.steedos.pid
添加到
.gitignore
gitignore
.steedos.pid

Deployment Contexts | 部署场景

部署场景

ContextRestart MethodNotes
Local development
steedos restart
Uses PID file, foreground process
Docker single containersupervisord
autorestart
steedos start
managed by supervisord
Docker Swarm / K8s clusterOrchestrator rolling update
docker service update
or
kubectl rollout
Moleculer microservice
steedos package:start --hot
Hot reload for development
场景重启方式说明
本地开发
steedos restart
使用PID文件,前台进程
Docker单容器supervisord
autorestart
由supervisord管理
steedos start
进程
Docker Swarm / K8s集群编排器滚动更新使用
docker service update
kubectl rollout
Moleculer微服务
steedos package:start --hot
开发模式支持热更新

Best Practices | 最佳实践

最佳实践

For AI-Assisted Development | AI 辅助开发

AI辅助开发

  1. Use
    steedos start
    in an async terminal to run the server in background
  2. After code modifications, run
    steedos restart
    to apply changes
  3. Wait for the server to fully start before testing changes
  4. The restart command handles graceful shutdown automatically
AI 辅助开发工作流:
  1. 异步终端中用
    steedos start
    启动服务
  2. 修改代码后,运行
    steedos restart
    应用更改
  3. 等待服务完全启动后再测试
  4. restart 命令会自动处理优雅关闭
  1. 异步终端中使用
    steedos start
    在后台运行服务器
  2. 修改代码后,运行
    steedos restart
    应用更改
  3. 等待服务器完全启动后再测试更改
  4. restart命令会自动处理优雅关闭