From 4fcef92a504c0d7f455161c75bb38c5ad56a5987 Mon Sep 17 00:00:00 2001 From: Yun Long Date: Sun, 12 Jul 2026 19:30:54 +0800 Subject: [PATCH] fix(windows): Make it compatible with codex.cmd --- docs/cli.md | 3 +- docs/cli.zh.md | 2 +- docs/config.md | 3 +- docs/config.zh.md | 2 +- internal/api/handler.go | 2 +- internal/codexcli/command.go | 30 ++++++++++ internal/codexcli/command_nonwindows.go | 12 ++++ internal/codexcli/command_test.go | 41 +++++++++++++ internal/codexcli/command_windows.go | 28 +++++++++ internal/codexcli/command_windows_test.go | 39 ++++++++++++ internal/codexcli/installer_test.go | 48 ++++++++++++++- internal/codexcli/locator.go | 30 ++++++---- internal/codexcli/locator_test.go | 59 +++++++++++++++++-- internal/runtime/codex/appserver_manager.go | 13 ++-- .../runtime/codex/appserver_manager_test.go | 4 +- internal/runtimecatalog/service_test.go | 25 ++++++++ 16 files changed, 308 insertions(+), 33 deletions(-) create mode 100644 internal/codexcli/command.go create mode 100644 internal/codexcli/command_nonwindows.go create mode 100644 internal/codexcli/command_test.go create mode 100644 internal/codexcli/command_windows.go create mode 100644 internal/codexcli/command_windows_test.go diff --git a/docs/cli.md b/docs/cli.md index e80d5100..9b303498 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -377,8 +377,7 @@ Notes: - `--runtime codex` requires a local `codex` CLI that supports `app-server --listen stdio://`. - Binary lookup uses `PATH` by default and can be overridden with `CSGCLAW_CODEX_PATH`. - On Windows, use a native `codex.exe` rather than the PowerShell `codex.ps1` shim. - Legacy `codex.cmd` and `codex.bat` values fall back to a sibling or CSGClaw-managed native executable. + On Windows, native `codex.exe` and npm's `codex.cmd`/`codex.bat` shims are supported; the PowerShell `codex.ps1` shim is not. ### `csgclaw user` diff --git a/docs/cli.zh.md b/docs/cli.zh.md index 584ee7d7..30fdc9e2 100644 --- a/docs/cli.zh.md +++ b/docs/cli.zh.md @@ -376,7 +376,7 @@ csgclaw agent delete --all --force 说明: - `--runtime codex` 依赖本地已安装且支持 `app-server --listen stdio://` 的 `codex` CLI。 -- 默认从 `PATH` 查找二进制,也可以用 `CSGCLAW_CODEX_PATH` 显式覆盖。Windows 下请使用 `codex.cmd` 或 `codex.exe`,不要使用 PowerShell 的 `codex.ps1` shim。 +- 默认从 `PATH` 查找二进制,也可以用 `CSGCLAW_CODEX_PATH` 显式覆盖。Windows 支持 `codex.cmd`、`codex.bat` 和 `codex.exe`,但不支持 PowerShell 的 `codex.ps1` shim。 ### `csgclaw user` diff --git a/docs/config.md b/docs/config.md index ad815f06..f4d365f3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -128,8 +128,7 @@ For complete Codex worker profiles, CSGClaw writes `~/.csgclaw/agents/