Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/desktop-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: desktop-build

on:
workflow_dispatch:
pull_request:
paths:
- 'src-tauri/**'
- 'tools/desktop/**'
- 'web-ui/**'
- 'cli.js'
- 'cli/**'
- 'lib/**'
- 'plugins/**'
- 'package.json'
- 'package-lock.json'
- '.github/workflows/desktop-build.yml'

permissions:
contents: read

jobs:
tauri:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-latest
- name: Windows
os: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: npm ci

- name: Prepare desktop config
run: npm run desktop:prepare

- name: Build desktop app
run: npm run desktop:build

- name: Upload desktop bundles
uses: actions/upload-artifact@v4
with:
name: codexmate-desktop-${{ matrix.name }}
path: src-tauri/target/release/bundle/**
if-no-files-found: error
37 changes: 37 additions & 0 deletions doc/desktop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Codex Mate Desktop (Tauri)

Codex Mate 的桌面版使用 Tauri 作为 Windows / macOS 外壳,复用现有 Node CLI 与 Web UI 服务。

## 架构

- Tauri 负责桌面窗口、系统打包和平台安装包。
- 现有 `cli.js run --host 127.0.0.1 --no-browser` 继续提供本地 Web UI 与 `/api`。
- 桌面窗口加载 `http://127.0.0.1:3737`,避免重写现有 Web UI API。
- 生产包会把 `cli.js`、`cli/`、`lib/`、`plugins/`、`web-ui/` 和 `node_modules/` 作为 Tauri resources 带入包内。

## 命令

```bash
npm run desktop:prepare
npm run desktop:dev
npm run desktop:build
```

## 本地要求

桌面构建需要:

- Node.js 18+
- Rust / Cargo
- Tauri 对应平台依赖

当前实现仍通过系统 `node` 启动打包进 resources 的 Codex Mate 后端。后续如果要做完全免 Node 安装的分发,需要把 Node runtime 或预编译 sidecar 纳入打包流程。

## CI

`.github/workflows/desktop-build.yml` 会在 GitHub Actions 上构建:

- macOS bundle / dmg
- Windows installer bundle(由当前 Tauri 平台支持的 targets 决定)

构建产物会以 `codexmate-desktop-macOS` / `codexmate-desktop-Windows` artifact 上传。
222 changes: 220 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codexmate",
"version": "0.0.35",
"version": "0.0.33",
"description": "Codex/Claude Code/OpenClaw 配置、会话与任务编排 CLI + Web 工具",
"main": "cli.js",
"bin": {
Expand Down Expand Up @@ -42,7 +42,10 @@
"test:e2e": "node tests/e2e/run.js",
"setup:git": "git remote set-url origin https://github.com/SakuraByteCore/codexmate.git && gh auth setup-git",
"reset:dev": "node tools/dev/reset-and-dev.js",
"pretest": "node tools/ci/ensure-test-deps.js"
"pretest": "node tools/ci/ensure-test-deps.js",
"desktop:prepare": "node tools/desktop/prepare-tauri-resources.js",
"desktop:dev": "tauri dev",
"desktop:build": "tauri build"
},
"dependencies": {
"@iarna/toml": "^2.2.5",
Expand Down Expand Up @@ -72,6 +75,7 @@
"author": "ymkiux",
"license": "Apache-2.0",
"devDependencies": {
"@tauri-apps/cli": "^2.11.2",
"vitepress": "^1.6.4"
}
}
4 changes: 4 additions & 0 deletions src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas
Loading
Loading