Skip to content

pegasi-ai/open-cowork

Repository files navigation

Claw Cowork

A desktop application interface for OpenClaw built with Tauri, React, and TypeScript.

Features

  • Intuitive desktop interface for OpenClaw interaction
  • Document and resource management through sidebar navigation
  • Real-time chat interface for collaboration
  • Security and system monitoring tabs
  • Cross-platform desktop support (Windows, macOS, Linux)

Tech Stack

  • Frontend: React 18 + TypeScript
  • Build Tool: Vite
  • Desktop Framework: Tauri 2
  • Backend: Rust

Development

Prerequisites

  • Node.js 22+
  • npm
  • Rust (required by Tauri)
  • OpenClaw (see below)

Installing Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Linux system dependencies (Ubuntu/Debian)

Tauri requires WebKit and a few other libraries:

sudo apt update && sudo apt install -y \
  libwebkit2gtk-4.1-dev \
  libappindicator3-dev \
  librsvg2-dev \
  patchelf

macOS

No extra system dependencies needed beyond Rust and Node.js.

Windows

Install the Microsoft C++ Build Tools and WebView2 (included in Windows 10/11 by default).

Getting Started

  1. Install Node dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Build for production:
npm run build

Building from Source (with local openclaw)

Claw Cowork manages the openclaw gateway process. In a distributed app, openclaw is bundled as a sidecar binary inside the app package. During development you can point cowork at a local openclaw source tree instead.

Repository layout

This project assumes the following sibling layout (adjust paths as needed):

workspace/
├── claw_cowork/   ← this repo
└── openclaw/      ← openclaw source (https://github.com/openclaw/openclaw)

Development workflow (no binary compilation needed)

Tauri requires the sidecar file to exist even in dev mode. Run setup:dev once to create a symlink in src-tauri/binaries/ pointing at your openclaw binary.

# 1. One-time setup: create the dev symlink (uses `which openclaw` by default)
npm run setup:dev

# 2. Run cowork
npm run dev

To use your local openclaw source tree instead of a globally installed binary:

# 1. Clone openclaw source (one-time)
git clone https://github.com/kere-nel/openclaw.git ../openclaw
cd ../openclaw && npm install && npm run build && cd -

# 2. Add OPENCLAW_BIN permanently to your shell profile
echo 'export OPENCLAW_BIN="'$(pwd)'/../openclaw/openclaw.mjs"' >> ~/.zshrc
source ~/.zshrc

# 3. Update the Tauri build symlink (one-time, or after changing OPENCLAW_BIN)
npm run setup:dev

# 4. Run cowork
npm run dev

After pulling openclaw source changes, rebuild before restarting cowork:

cd ../openclaw && npm run build && cd -
# then restart cowork (Cmd+R or re-run npm run dev)

Any changes you make to openclaw source take effect on the next gateway restart (cowork auto-restarts the gateway when it detects a disconnect).

Production build (sidecar binary)

For a distributable app, compile openclaw into a self-contained native binary using @yao-pkg/pkg, then build the Tauri bundle:

# Prerequisites
npm install -g @yao-pkg/pkg

# Build openclaw sidecar binary (reads openclaw from ../openclaw by default)
npm run build:sidecar

# Optionally point at a different openclaw directory:
# OPENCLAW_DIR=/path/to/openclaw npm run build:sidecar

# Build the full Tauri app (sidecar is automatically bundled)
npm run build

The sidecar binary is placed in src-tauri/binaries/openclaw-{target-triple}. Tauri picks it up automatically and copies it into the app bundle.

How openclaw is resolved at runtime

Cowork resolves the openclaw binary in this order:

Priority Source When used
1 OPENCLAW_BIN env var Development / CI
2 Bundled sidecar (next to app exe) Production app bundle
3 which openclaw (PATH) Global npm install
4 Bare openclaw fallback Last resort

Project Structure

claw_cowork/
├── src/                      # React frontend source
│   ├── components/          # React components
│   ├── styles/             # Component styles
│   ├── App.tsx             # Main app component
│   ├── main.tsx            # Entry point
│   └── index.css           # Global styles
├── src-tauri/              # Tauri backend
│   ├── src/main.rs        # Rust backend entry
│   ├── Cargo.toml         # Rust dependencies
│   └── tauri.conf.json    # Tauri configuration
├── index.html             # HTML entry point
├── vite.config.ts         # Vite configuration
├── tsconfig.json          # TypeScript configuration
└── package.json           # NPM configuration

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors