CLI 伴侣工具
oxideterm 是 OxideTerm 的无头管理 CLI。它直接调用与桌面应用相同的 Rust 领域 crate,读取指定配置目录中的数据,不通过本地套接字、命名管道或 RPC 服务控制正在运行的 GUI。
这意味着大多数管理、检查和迁移命令无需先启动桌面应用,适合 shell 脚本、CI、故障恢复和远程无界面环境。oxideterm ssh 是有意的例外:它会在原生桌面应用中打开临时 SSH 终端。
获取 CLI
Section titled “获取 CLI”发布包会附带对应平台的 oxideterm 可执行文件。也可以从源码构建:
./scripts/build-cli.sh开发时可直接运行:
cargo run -p oxideterm-cli -- doctor --strictoxideterm --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:输出机器可读结果。
oxideterm paths --jsonoxideterm diagnose --jsonoxideterm doctor --strictoxideterm report --jsonoxideterm report --bundle ./oxideterm-report.zip支持报告会对敏感信息进行脱敏;分享支持包前仍应自行检查其内容。
oxideterm settings validate --strictoxideterm settings sections --jsonoxideterm settings get ai.providers --jsonoxideterm settings set terminal.fontSize 14 --dry-runoxideterm settings set terminal.fontSize 14 --yesoxideterm settings export --section appearance --jsonset 和 unset 只修改已存在的 JSON path。先使用 --dry-run 检查计划,再用 --yes 确认写入。
oxideterm connections listoxideterm connections search prod --jsonoxideterm connections create --name prod --host example.internal --user deploy --port 22 --dry-runoxideterm connections validate --strictoxideterm forwards list --format json密码和私钥口令应通过 --password-stdin、--password-env、--passphrase-stdin 或 --passphrase-env 传入,不要把凭据值写进 shell 参数或日志。
oxideterm backup create --output ./oxideterm-backup.json --jsonoxideterm backup inspect ./oxideterm-backup.json --summaryoxideterm backup restore ./oxideterm-backup.json --section settings --dry-run --jsonoxideterm backup restore ./oxideterm-backup.json --section settings --yesoxideterm cloud-sync status --jsonoxideterm cloud-sync diff --dirty-only --format tableoxideterm cloud-sync push --dry-run --jsonoxideterm cloud-sync pull --dry-run --jsonoxideterm cloud-sync apply --from remote --strategy merge --dry-runoxideterm cloud-sync secrets status --json云同步凭据命令只应输出状态或提示。写入凭据时使用标准输入或环境变量。
批处理计划可以把设置、连接快照和云同步配置的多项变更合并为一次可审查操作:
oxideterm batch apply ./plan.json --dry-runoxideterm batch apply ./plan.json --yes --jsonShell 补全
Section titled “Shell 补全”oxideterm completion zsh > ~/.zfunc/_oxidetermoxideterm completion path zshoxideterm completion install zsh只有在确定要覆盖已有补全文件时,才为 completion install 添加 --force。
- CLI 不要求桌面应用提供后台服务,也不会连接隐藏的本地控制端口。
- 诊断、报告和凭据状态输出不得包含秘密值。
- 写命令默认要求预览或显式确认,便于在 CI 和恢复流程中审计。
- 可用
--config-dir或--profile隔离测试、迁移和生产配置。
查看某个版本的完整参数时,以内置帮助为准:
oxideterm --helpoxideterm <command> --help