Skip to content

Commit 82cede2

Browse files
committed
feat(desktop): add Tauri shell
1 parent 9ffba03 commit 82cede2

27 files changed

Lines changed: 653 additions & 5 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: desktop-build
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- 'src-tauri/**'
8+
- 'tools/desktop/**'
9+
- 'web-ui/**'
10+
- 'cli.js'
11+
- 'cli/**'
12+
- 'lib/**'
13+
- 'plugins/**'
14+
- 'package.json'
15+
- 'package-lock.json'
16+
- '.github/workflows/desktop-build.yml'
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
tauri:
23+
name: ${{ matrix.name }}
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- name: macOS
30+
os: macos-latest
31+
- name: Windows
32+
os: windows-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '22'
41+
cache: npm
42+
43+
- name: Setup Rust
44+
uses: dtolnay/rust-toolchain@stable
45+
46+
- name: Install dependencies
47+
run: npm ci
48+
49+
- name: Prepare desktop config
50+
run: npm run desktop:prepare
51+
52+
- name: Build desktop app
53+
run: npm run desktop:build
54+
55+
- name: Upload desktop bundles
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: codexmate-desktop-${{ matrix.name }}
59+
path: src-tauri/target/release/bundle/**
60+
if-no-files-found: error

doc/desktop.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Codex Mate Desktop (Tauri)
2+
3+
Codex Mate 的桌面版使用 Tauri 作为 Windows / macOS 外壳,复用现有 Node CLI 与 Web UI 服务。
4+
5+
## 架构
6+
7+
- Tauri 负责桌面窗口、系统打包和平台安装包。
8+
- 现有 `cli.js run --host 127.0.0.1 --no-browser` 继续提供本地 Web UI 与 `/api`
9+
- 桌面窗口加载 `http://127.0.0.1:3737`,避免重写现有 Web UI API。
10+
- 生产包会把 `cli.js``cli/``lib/``plugins/``web-ui/``node_modules/` 作为 Tauri resources 带入包内。
11+
12+
## 命令
13+
14+
```bash
15+
npm run desktop:prepare
16+
npm run desktop:dev
17+
npm run desktop:build
18+
```
19+
20+
## 本地要求
21+
22+
桌面构建需要:
23+
24+
- Node.js 18+
25+
- Rust / Cargo
26+
- Tauri 对应平台依赖
27+
28+
当前实现仍通过系统 `node` 启动打包进 resources 的 Codex Mate 后端。后续如果要做完全免 Node 安装的分发,需要把 Node runtime 或预编译 sidecar 纳入打包流程。
29+
30+
## CI
31+
32+
`.github/workflows/desktop-build.yml` 会在 GitHub Actions 上构建:
33+
34+
- macOS bundle / dmg
35+
- Windows installer bundle(由当前 Tauri 平台支持的 targets 决定)
36+
37+
构建产物会以 `codexmate-desktop-macOS` / `codexmate-desktop-Windows` artifact 上传。

package-lock.json

Lines changed: 220 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codexmate",
3-
"version": "0.0.35",
3+
"version": "0.0.33",
44
"description": "Codex/Claude Code/OpenClaw 配置、会话与任务编排 CLI + Web 工具",
55
"main": "cli.js",
66
"bin": {
@@ -16,7 +16,9 @@
1616
"doc/",
1717
"README.md",
1818
"README.zh.md",
19-
"LICENSE"
19+
"LICENSE",
20+
"src-tauri/",
21+
"tools/desktop/"
2022
],
2123
"exports": {
2224
".": "./cli.js",
@@ -42,7 +44,10 @@
4244
"test:e2e": "node tests/e2e/run.js",
4345
"setup:git": "git remote set-url origin https://github.com/SakuraByteCore/codexmate.git && gh auth setup-git",
4446
"reset:dev": "node tools/dev/reset-and-dev.js",
45-
"pretest": "node tools/ci/ensure-test-deps.js"
47+
"pretest": "node tools/ci/ensure-test-deps.js",
48+
"desktop:prepare": "node tools/desktop/prepare-tauri-resources.js",
49+
"desktop:dev": "tauri dev",
50+
"desktop:build": "tauri build"
4651
},
4752
"dependencies": {
4853
"@iarna/toml": "^2.2.5",
@@ -72,6 +77,7 @@
7277
"author": "ymkiux",
7378
"license": "Apache-2.0",
7479
"devDependencies": {
80+
"@tauri-apps/cli": "^2.11.2",
7581
"vitepress": "^1.6.4"
7682
}
7783
}

src-tauri/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target/
4+
/gen/schemas

src-tauri/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
tauri_build::build()
3+
}

0 commit comments

Comments
 (0)