fix: 修复 Windows trans 编码与参数传递

This commit is contained in:
Codex
2026-07-10 13:31:26 +02:00
parent ad93490f4a
commit b6ac6f71f6
6 changed files with 108 additions and 4 deletions
+4
View File
@@ -8,6 +8,10 @@ UniDesk 的统一 CLI 实现入口是根目录 `scripts/cli.ts`,运行方式
`trans` wrapper 是 SSH/WSL/k3s 透传的唯一默认入口:人工/Codex 远端操作、长期参考文档、AGENTS 索引、CLI help、非交互脚本和非交互 `exec` 都必须直接调主 server PATH 上的 `/root/.local/bin/trans`;禁止把 `bun scripts/cli.ts ssh ...``bun scripts/cli.ts trans ...` 或任何带 `bun scripts/cli.ts` 前缀的透传写法作为默认入口。`bun scripts/cli.ts help``config``server``provider``microservice` 等普通根 CLI 子命令不受这条限制,仍使用 `bun scripts/cli.ts <command>`,避免透传命令和根子命令在调用前缀上互相混淆。
误写 `bun scripts/cli.ts trans ...``bun scripts/cli.ts tran ...` 时,根 CLI 必须返回结构化 `trans-root-cli-entrypoint-moved` 错误、`replacementExamples``Use: trans <route> <operation> [args...]` 迁移提示,不能退化成通用 `Unknown command`
Windows `ps` 的参数语义分为两种:单个参数是完整 PowerShell source;多个参数是边界明确的 argv。后者对 native application 使用 Windows 命令行引用规则,必须保留 `python -c` 代码中的路径、`encoding="utf-8"`、字典 key 和嵌套引号,并继承 route 对应的 Windows workspace。PowerShell prelude 将 `Get-Content` 默认编码固定为 UTF-8Windows fs helper 的 `head` / `tail` 同时支持 `-n N``-nN``--lines=N` 和 GNU `-N``wc -l` 必须把选项与路径分开解析。
CLI 可以从 `master` 快速演进,但必须兼容 `deploy.json` 固定的 CI/CD server 和生产运行面。CLI/server 能力协商、unsupported-version 失败语义和 release-line 边界由 `docs/reference/release-governance.md` 与 [GitHub issue #6](https://github.com/pikasTech/unidesk/issues/6) 约束。
## CI/CD Control Boundary