跳转到内容

CLI 伴侣工具

oxideterm 的普通管理命令直接读取指定配置目录,并调用与桌面应用相同的领域服务。

大多数管理、检查和迁移命令无需先启动桌面应用。ssh 打开临时桌面终端,connections open 使用桌面的已保存连接流程,mcp bridge 则将外部标准输入输出客户端连接到运行中应用的公共 MCP 端点。

发布包会附带对应平台的 oxideterm 可执行文件。也可以从源码构建:

Terminal window
./scripts/build/build-cli.sh

开发时可直接运行:

Terminal window
cargo run -p oxideterm-cli -- doctor --strict
Terminal window
oxideterm --config-dir <path> <command>
oxideterm --profile <name> <command>
OXIDETERM_CONFIG_DIR=<path> oxideterm <command>

脚本中优先使用 --json 或 --format json。CI 如果需要把警告也视为失败,可使用 doctor --strict 或对应命令的 --strict。

多数写命令共享以下保护选项:

  • --dry-run:只显示变更计划,不写入。
  • --yes:确认执行真实写入。
  • --json 或 --format json:输出机器可读结果。
Terminal window
oxideterm paths --json
oxideterm diagnose --json
oxideterm doctor --strict
oxideterm report --json
oxideterm report --bundle ./oxideterm-report.zip

支持报告会对敏感信息进行脱敏;分享支持包前仍应自行检查其内容。

Terminal window
oxideterm settings validate --strict
oxideterm settings sections --json
oxideterm settings get ai.providers --json
oxideterm settings set terminal.fontSize 14 --dry-run
oxideterm settings set terminal.fontSize 14 --yes
oxideterm settings export --section appearance --json

set 和 unset 只修改已存在的 JSON path。先使用 --dry-run 检查计划,再用 --yes 确认写入。

Terminal window
oxideterm connections list
oxideterm connections search prod --json
oxideterm connections create --name prod --host example.internal --user deploy --port 22 --dry-run
oxideterm connections validate --strict
oxideterm forwards list --format json

密码和私钥口令应通过 --password-stdin、--password-env、--passphrase-stdin 或 --passphrase-env 传入,不要把凭据值写进 shell 参数或日志。

Terminal window
oxideterm backup create --output ./oxideterm-backup.json --json
oxideterm backup inspect ./oxideterm-backup.json --summary
oxideterm backup restore ./oxideterm-backup.json --section settings --dry-run --json
oxideterm backup restore ./oxideterm-backup.json --section settings --yes
Terminal window
oxideterm cloud-sync status --json
oxideterm cloud-sync diff --dirty-only --format table
oxideterm cloud-sync push --dry-run --json
oxideterm cloud-sync pull --dry-run --json
oxideterm cloud-sync apply --from remote --strategy merge --dry-run
oxideterm cloud-sync secrets status --json

云同步凭据命令只应输出状态或提示。写入凭据时使用标准输入或环境变量。

批处理计划可以把设置、连接快照和云同步配置的多项变更合并为一次可审查操作:

Terminal window
oxideterm batch apply ./plan.json --dry-run
oxideterm batch apply ./plan.json --yes --json

在设置 → 网络与代理 → 外部 MCP 控制创建客户端,将一次性凭据放入外部客户端的秘密环境变量 OXIDETERM_MCP_TOKEN。启动命令为 oxideterm,参数为 ["mcp", "bridge"]。桥接从应用当前配置目录发现本地端点;使用命名配置或自定义目录时,传入相同的 --profile 或 --config-dir。

应用需要保持运行。手动指定端点时,只接受本机回环地址上的 HTTP /mcp。不要把令牌写入命令参数、项目文件或日志。

Terminal window
oxideterm completion zsh > ~/.zfunc/_oxideterm
oxideterm completion path zsh
oxideterm completion install zsh

只有在确定要覆盖已有补全文件时,才为 completion install 添加 --force。

  • CLI 不要求桌面应用提供后台服务,也不会连接隐藏的本地控制端口。
  • 诊断、报告和凭据状态输出不得包含秘密值。
  • 写命令默认要求预览或显式确认,便于在 CI 和恢复流程中审计。
  • 可用 --config-dir 或 --profile 隔离测试、迁移和生产配置。

查看某个版本的完整参数时,以内置帮助为准:

Terminal window
oxideterm --help
oxideterm <command> --help