This document describes the repository build, test, and release commands.
The bundled Codex CLI is pinned to 0.167.1 in scripts/codex-cli-version.txt.
Shell, PowerShell, Docker, and release builds download the same version from /codex-cli/v<version>/<filename> and verify scripts/codex-cli-checksums.txt before installing the runtime.
CODEX_CLI_DOWNLOAD_BASE_URL overrides the mirror root (default https://csgclaw.opencsg.com/codex-cli), not the version or checksum.
To upgrade, upload all six official platform packages into the mirror's v<version>/ directory, verify their SHA-256 digests against the upstream release, then update the version and checksums together in source control.
Builds install the complete official Codex package, preserving its helper binaries, metadata, and resources beside bin/.
Linux command execution requires the packaged bwrap; copying only the main Codex executable is insufficient.
A CSGClaw source upgrade therefore determines the bundled Codex upgrade; builds never resolve latest.
CSGClaw explicitly selects the same v1 memory pipeline for fresh and existing Codex agents, with dual-write and dedicated memory tools disabled. This preserves the current memory document, template, and runtime recreation behavior while using the upgraded Codex runtime. Stable upstream defaults such as shell snapshots remain available without adding version-dependent UI or controls.
make
# same as: make buildThe default build:
- Builds the Web UI into
web/static-dist/. - Builds
bin/csgclaw, the host-platformbin/csgclaw-cli, and the bundledbin/codex.
make build-all is retained as an alias of make build. Codex is bundled with the application; DeepSeek Harness is installed on demand.
Useful targets:
| Target | Description |
|---|---|
make build-server-bin |
Build bin/csgclaw, host-platform bin/csgclaw-cli, and bundled bin/codex |
make run |
Build and run csgclaw serve |
make fmt |
Format Go sources |
make test |
Run go test ./... |
镜像构建可以通过服务端的内部命令生成完整安装包:
csgclaw _prepare-connector --id feishu --directory /opt/csgclaw/connector-packages
chmod -R a+rX /opt/csgclaw/connector-packages命令使用当前内置连接器声明和通用安装器,下载并校验对应平台的 CLI、Skills,
生成 <directory>/<executable>/<version>/{bin,skills,package.json},
标准输出为可执行文件的绝对路径。构建阶段需要下载权限,命令不创建连接器资源或账号配置。
运行服务时设置 CSGCLAW_CONNECTOR_PACKAGES_DIR,值为上述预装目录。
普通连接和旧配置迁移共用安装流程:有效的资源安装直接复用;需要安装时,
匹配版本的预装包复制到资源目录中的临时目录,通过现有校验后完成目录替换。
最终位置仍为 ~/.csgclaw/apps/<resource-id>/package/<version>/。
预装目录可以只读,账号配置继续位于资源的 config/ 中。
未设置预装目录、缺少对应版本,或者 Skills 版本不匹配时,继续在线下载。 已匹配但内容损坏的预装包返回错误,保留现有资源文件。 独立升级 CSGClaw 后,需要镜像提供新的匹配包才能继续离线安装。 该目录应由部署管理员提供,包含可信的可执行文件;复制流程拒绝符号链接和特殊文件。
On Windows hosts that do not have make, use the PowerShell build script:
.\scripts\build.cmd build
.\scripts\build.cmd build-server-bin
.\scripts\build.cmd desktop-package
.\scripts\build.cmd testThe build.cmd wrapper runs scripts/build.ps1 with -ExecutionPolicy Bypass
for the current process only, avoiding machine-wide PowerShell policy changes.
If you call the PowerShell script directly, use:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 buildThe default build target mirrors make build:
- Builds the Web UI into
web/static-dist/. - Builds
bin/csgclaw.exe, the host-platformbin/csgclaw-cli.exe, and bundledbin/codex.exe.
| Target | Description |
|---|---|
make web-install |
Install dependencies with the pinned pnpm toolchain |
make web-dev |
Start the Vite development server |
make build-web |
Build assets into web/static-dist/ |
See web development before changing the Vite application.
Every official csgclaw bundle contains:
csgclaw/
bin/
csgclaw[.exe]
csgclaw-cli[.exe] # companion CLI for the release host platform
codex[.exe] # bundled Codex CLI for the release host platform
codex-code-mode-host[.exe]
codex-exec-server[.exe]
codex-package.json
codex-resources/ # includes Linux bwrap and Windows sandbox helpers
codex-path/
The canonical CSGClaw-platform-to-Codex-artifact mapping is in
scripts/codex-cli-platforms.txt. Shell,
PowerShell, and Docker packaging consume that file; formal release targets remain
in scripts/release-platforms.txt.
| Target | Description |
|---|---|
make package |
Package the current platform |
make package-all |
Build and package the current platform artifacts |
make desktop-package |
Build native desktop installers on macOS/Linux |
make desktop-package-macos-signed VERSION=<version> |
Build, sign, notarize, verify, and locally stage macOS packages. Defaults to both architectures. Use DESKTOP_MACOS_TARGETS=arm64 or amd64 for the current chip only, and DESKTOP_MACOS_FORCE=1 to overwrite an existing local archive. Full commands: Windows and macOS signing guide |
scripts\build.cmd desktop-package |
Build native desktop installers on Windows without make |
make desktop-package-oss VERSION=<version> |
Reuse desktop-package and stage this host's OSS desktop artifacts |
make desktop-oss-manifest VERSION=<version> |
Validate all three website installers and generate downloads.json |
make desktop-oss-publish VERSION=<version> |
Validate and publish all three website installers to OSS |
make desktop-oss-upload-packages VERSION=<version> DESKTOP_OSS_TARGETS=<os-arch> |
Upload only the selected immutable desktop packages without changing OSS channel JSON |
make release |
Build the configured cross-platform release bundles |
Release CI uses .github/workflows/release.yml and .gitlab/ci.yml.
GitHub tag pushes keep the full release path: they attach the server/CLI bundles and native desktop installers to the matching GitHub Release, then publish the complete server/CLI bundle matrix, the two macOS DMGs, the Windows x64 installer, and native Electron update feeds to the beta or release OSS channel.
Without recovery_run_id, a manual GitHub workflow run accepts only an alpha version matching vX.Y.Z-alpha.N and one desktop_target; it builds that desktop target, uploads its immutable packages without changing downloads.json, RELEASES, or RELEASES.json, and shows the download URLs in the Actions summary.
GitLab keeps its existing SSH upload to https://csgclaw.opencsg.com/releases/<tag>/ and publishes the CSGClaw product image.
Its desktop jobs are optional manual builds: successful installers remain GitLab artifacts for one day and are not uploaded to the public release directory.
GitLab macOS and Windows desktop jobs require native runners tagged csgclaw-macos-arm64, csgclaw-macos-amd64, and csgclaw-windows-amd64.
To recover a failed beta release with exactly one failed desktop build, run the same workflow with the existing beta tag as version, the failed desktop_target, and its original recovery_run_id.
Recovery verifies the tag commit, successful source jobs, and unexpired artifact IDs, rebuilds the selected desktop from that original commit, and combines it with the successful packages for GitHub Release and OSS channel publication.
Source artifacts are retained for one day, so start recovery before they expire.
Windows checksum regression checks run under Windows PowerShell and PowerShell 7; CI invokes the packaging script directly in its PowerShell 7 host.
Desktop installers use names such as csgclaw-desktop_v0.4.3_darwin_arm64.dmg. The ordinary desktop-package target keeps the macOS ad-hoc and Windows unsigned defaults when credentials are absent. The strict local macOS target requires a Developer ID identity plus complete notarization credentials and fails instead of emitting a partial signature. It reuses the same Forge package target and asset collector as CI while leaving the established GitHub workflow unchanged; it writes only under desktop/out/local/ and never uploads to OSS. GitHub Release CI configures channel-isolated Electron feeds under channels/<channel>/updates/; the desktop checks in the background and only prompts after the native package has downloaded.
Local desktop outputs are kept under desktop/out/: backend inputs in input/, raw Forge artifacts in make/, and OSS release files and manifests in oss/. The repository-root dist/ remains the Go release and CI runner staging directory.
Failed GitHub Release runs are handled by .github/workflows/release-retry.yml after each attempt completes. It re-runs only failed jobs and their dependent jobs, retaining successful platform builds and artifacts. Each release run gets at most three total attempts (the initial execution plus two automatic retries); cancellation stops automatic retries, and failures at the limit remain visible for manual investigation. Manual re-runs count toward the same limit. The retry workflow must be merged into the default branch before it takes effect.
The CI and local signed macOS packaging paths share scripts/macos-stapler.mjs for app/DMG ticket stapling and validation. Each command has a three-minute timeout and up to three total attempts for transient network errors, with 30-second and 90-second delays. Retries reuse the existing artifact; signature/ticket errors fail immediately, and exhausted network retries still fail the job. This command-level recovery runs before the existing workflow-level retry fallback.