Skip to content
Merged
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
61 changes: 61 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Dependencies — must be installed inside the container, never copied from host
node_modules
**/node_modules

# Build output
.next
**/.next
dist
**/dist
build
**/build

# Generated Prisma client (regenerated in container)
packages/api/src/generated

# TypeScript incremental build info — stale buildinfo causes tsc to skip
# emitting .d.ts files in the container. Must be recursive (**) since the
# files live inside each package directory.
*.tsbuildinfo
**/*.tsbuildinfo

# Git
.git
.gitignore

# Editor / OS
.vscode
.idea
.DS_Store
**/.DS_Store

# Logs
*.log
**/*.log
npm-debug.log*
pnpm-debug.log*

# Env files (mounted at runtime, not baked into images)
.env
.env.local
.env.*.local
**/.env
**/.env.local
**/.env.*.local

# Test artifacts
coverage
**/coverage
.nyc_output
playwright-report
test-results

# Misc
.turbo
.cache
**/.turbo
**/.cache

# References / docs (not needed in image)
references
docs
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,49 @@ docker compose -f docker-compose.prod.yml up -d --build
docker compose -f docker-compose.prod.yml logs api | grep '\[bootstrap\]'
```

## Uninstallation

Remove Clawix completely with:

```bash
pnpm run uninstall:clawix # preserve host data
pnpm run uninstall:clawix -- --full # complete removal
```

### Flags

| Flag | Description |
| --------------- | ----------------------------------------------------------------------- |
| `--full` / `-f` | Remove Docker resources AND host data (.env, ./data/, ./skills/custom/) |
| `--yes` / `-y` | Skip confirmation prompt |

### What gets removed

**Docker cleanup (default):**

- Containers from both dev and prod environments
- Images built by compose + `clawix-agent:latest`
- Named volumes (`postgres_data`, `redis_data`, etc.)
- Orphan containers

**Host data (with `--full`):**

- `.env` — configuration and secrets
- `./data/` — runtime data, user workspaces
- `./skills/custom/` — user-created skills

### Fresh reinstall

```bash
# Full cleanup
pnpm run uninstall:clawix -- --full -y

# Reinstall from scratch
pnpm run install:clawix
```

> Without `--full`, host data is preserved. The installer detects existing `.env` and skips configuration prompts, reusing your previous settings.

---

## Multi-Provider Support
Expand Down
44 changes: 22 additions & 22 deletions docs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ The page is divided into three sections:

The **Public Agents** table columns:

| Column | Meaning |
| ----------- | ----------------------------------------------- |
| **Agent** | Agent name and internal identifier |
| **Model** | Provider / model name (e.g., `openai / gpt-4o`) |
| **Role** | `primary` or `worker` badge |
| **Type** | `Public` (visible to all users) |
| **Enabled** | Toggle switch; primary agents show "Always on" |
| Column | Meaning |
| ----------- | ------------------------------------------------------------------------------------------------------------------- |
| **Agent** | Agent name and internal identifier |
| **Model** | Provider / model name (e.g., `anthropic / claude-sonnet-4-6`, `openai / gpt-4o`, `gemini / gemini-3-flash-preview`) |
| **Role** | `primary` or `worker` badge |
| **Type** | `Public` (visible to all users) |
| **Enabled** | Toggle switch; primary agents show "Always on" |

---

Expand All @@ -118,9 +118,9 @@ Public agents are available to all users and serve as the shared pool of officia
| **Name** | Yes | 1–255 characters. Used to reference the agent by name in spawn calls. |
| **Description** | No | Up to 2000 characters. Shown in the UI and injected into the primary agent's context so it knows what each worker does. |
| **System Prompt** | Yes | 1–50 000 characters. Defines the agent's persona, instructions, and capabilities. |
| **Provider** | Yes | Select from configured providers (e.g., `openai`, `anthropic`). |
| **Model** | Yes | Model identifier (e.g., `gpt-4o`, `claude-sonnet-4-6`). Must match the selected provider. |
| **API Base URL** | No | Override the provider's default endpoint. Leave blank for standard Anthropic/OpenAI endpoints. |
| **Provider** | Yes | Select from configured providers (e.g., `anthropic`, `openai`, `gemini`, `zai-coding`, `kimi-code`). |
| **Model** | Yes | Model identifier (e.g., `claude-sonnet-4-6`, `gpt-4o`, `gemini-3-flash-preview`). Must match the selected provider. |
| **API Base URL** | No | Override the provider's default endpoint. Leave blank for the provider's built-in default. |
| **Max Tokens per Run** | No | Hard cap on tokens consumed per single run. Default: 100 000. |

4. Click **Create**. The agent appears in the **Public Agents** table.
Expand Down Expand Up @@ -335,18 +335,18 @@ curl -X POST http://localhost:3001/api/v1/agents/sub-agents \

## Field Reference Summary

| Field | Type | Constraints | Default |
| ----------------- | -------- | ----------------------------------------- | ------------------- |
| `name` | string | 1–255 chars, required | — |
| `description` | string | 0–2000 chars, optional | — |
| `systemPrompt` | string | 1–50 000 chars, required | `""` |
| `role` | enum | `primary` or `worker` | `primary` |
| `provider` | string | Must match a configured ProviderConfig ID | `anthropic` |
| `model` | string | Must be compatible with the provider | `claude-sonnet-4-6` |
| `apiBaseUrl` | URL | Valid URL or null | `null` |
| `skillIds` | string[] | Array of Skill CUIDs | `[]` |
| `maxTokensPerRun` | integer | ≥ 1 | `100000` |
| `isActive` | boolean | — | `true` |
| Field | Type | Constraints | Default |
| ----------------- | -------- | ----------------------------------------- | -------------------------- |
| `name` | string | 1–255 chars, required | — |
| `description` | string | 0–2000 chars, optional | — |
| `systemPrompt` | string | 1–50 000 chars, required | `""` |
| `role` | enum | `primary` or `worker` | `primary` |
| `provider` | string | Must match a configured ProviderConfig ID | `anthropic` |
| `model` | string | Must be compatible with the provider | `claude-sonnet-4-20250514` |
| `apiBaseUrl` | URL | Valid URL or null | `null` |
| `skillIds` | string[] | Array of Skill CUIDs | `[]` |
| `maxTokensPerRun` | integer | ≥ 1 | `100000` |
| `isActive` | boolean | — | `true` |

---

Expand Down
14 changes: 8 additions & 6 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ A **Channel** is a configured integration that allows external messaging platfor

### Supported channel types

| Type | Use case | Required credentials |
| ------------ | -------------------------------------------------- | ------------------------- |
| **Telegram** | Bot receives messages from Telegram users | Bot Token from @BotFather |
| **Web** | Built-in web chat widget / dashboard conversations | None — always available |
| **Slack** | Slash commands and DMs via Slack Bolt | App credentials (OAuth) |
| **WhatsApp** | Production messaging via WhatsApp Business API | Business API credentials |
| Type | Use case | Required credentials |
| ------------ | -------------------------------------------------- | ------------------------------------------------- |
| **Telegram** | Bot receives messages from Telegram users | Bot Token from @BotFather |
| **Web** | Built-in web chat widget / dashboard conversations | None — always available |
| **Slack** | Slash commands and DMs via Slack Bolt | App credentials (OAuth) |
| **WhatsApp** | Production messaging via WhatsApp Business API | WhatsApp Business API via @whiskeysockets/baileys |

### Adding a Channel

Expand Down Expand Up @@ -198,6 +198,8 @@ Click **⋯** → **Edit**. API Key field: leave blank to keep the existing key;
| `anthropic` | `claude-opus-4-*`, `claude-sonnet-4-*`, `claude-haiku-4-*` | `ANTHROPIC_API_KEY` |
| `openai` | `gpt-4.1`, `gpt-4o`, `gpt-4o-mini`, `o3`, `codex-*` | `OPENAI_API_KEY` |
| `zai-coding` | `glm-*` | `ZAI_CODING_API_KEY` |
| `gemini` | `gemini-3-pro-preview`, `gemini-3-flash-preview`, etc. | `GEMINI_API_KEY` |
| `kimi-code` | (various) | `KIMI_CODE_API_KEY` |
| `custom` | Any (OpenAI-compatible) — Base URL required | — |

→ **Full detail:** [PROVIDERS.md](./PROVIDERS.md)
Expand Down
66 changes: 50 additions & 16 deletions docs/GET_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Clawix lets you securely run AI-powered agents in isolated containers, coordinat

## Key Features

- **Multi-Provider AI** - Anthropic, OpenAI, Azure, DeepSeek, Gemini, and custom endpoints
- **Multi-Provider AI** - Anthropic, OpenAI, Z.AI Coding, Gemini, Kimi-code, and custom endpoints
- **Container Isolation** - Every agent runs in a sandboxed Docker container with resource limits
- **Warm Container Pool** - Eliminates cold-start latency for primary agents (1-3s → ~50ms)
- **Swarm Orchestration** - Delegate complex tasks to specialized sub-agents with DAG dependencies
Expand All @@ -28,12 +28,13 @@ Clawix lets you securely run AI-powered agents in isolated containers, coordinat
- [Node.js 20+](https://nodejs.org/)
- [pnpm 9+](https://pnpm.io/installation) (`npm install -g pnpm`)
- [Docker](https://docs.docker.com/get-docker/) + Docker Compose
- [Docker Desktop](https://www.docker.com/products/docker-desktop/) (user-friendly platform for container management)

### Installation

```bash
# 1. Clone the repository
git clone https://github.com/clawixAI/clawix.git
git clone https://github.com/jasonli0226/clawix.git
cd clawix

# 2. Prepare your environment file
Expand Down Expand Up @@ -118,6 +119,34 @@ docker compose -f docker-compose.prod.yml up -d --build
docker compose -f docker-compose.prod.yml logs api | grep '\[bootstrap\]'
```

### Uninstallation

Remove Clawix completely:

```bash
pnpm run uninstall:clawix # preserve host data
pnpm run uninstall:clawix -- --full # complete removal
```

| Flag | Description |
| --------------- | ----------------------------------------------------------------------- |
| `--full` / `-f` | Remove Docker resources AND host data (.env, ./data/, ./skills/custom/) |
| `--yes` / `-y` | Skip confirmation prompt |

**What gets removed:**

- **Docker cleanup (default):** containers, images, named volumes from both dev and prod environments
- **Host data (with `--full`):** `.env`, `./data/` (workspaces), `./skills/custom/` (user skills)

**Fresh reinstall:**

```bash
pnpm run uninstall:clawix -- --full -y
pnpm run install:clawix
```

> Without `--full`, host data is preserved. The installer detects existing `.env` and reuses your previous settings.

## Architecture

```
Expand All @@ -134,7 +163,7 @@ docker compose -f docker-compose.prod.yml logs api | grep '\[bootstrap\]'
┌─────────────────────────────────────────────────────────────────┐
│ Core Engine │
│ Reasoning Loops │ Tool Execution │ Swarm Coordinator │
│ Multi-Provider (Anthropic, OpenAI, Azure, Custom) │
│ Multi-Provider (Anthropic, OpenAI, Z.AI Coding, Gemini, Kimi-code, Custom) │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
Expand All @@ -152,15 +181,17 @@ docker compose -f docker-compose.prod.yml logs api | grep '\[bootstrap\]'

Clawix supports multiple AI providers through a unified interface:

| Provider | Detection | Notes | Status |
| ------------ | ------------------------------ | ---------------------- | ----------- |
| Anthropic | model contains "claude" | Primary provider | done |
| OpenAI | model contains "gpt" | Fallback | done |
| Azure OpenAI | config key "azure_openai" | Enterprise deployments | coming soon |
| DeepSeek | model contains "deepseek" | Cost-effective | coming soon |
| Gemini | model contains "gemini" | Google AI | coming soon |
| OpenRouter | API key starts with "sk-or-" | Gateway | coming soon |
| Custom | any OpenAI-compatible endpoint | vLLM, Ollama, etc. | coming soon |
| Provider | Detection | Notes | Status |
| ------------ | ------------------------------ | ---------------------- | ------- |
| Anthropic | model contains "claude" | Primary provider | done |
| OpenAI | model contains "gpt" | Fallback | done |
| Z.AI Coding | model contains "glm" | Z.AI Coding Plan | done |
| Gemini | model contains "gemini" | Google AI | done |
| Kimi-code | model contains "kimi" | Moonshot AI | done |
| Azure OpenAI | config key "azure_openai" | Enterprise deployments | planned |
| DeepSeek | model contains "deepseek" | Cost-effective | planned |
| OpenRouter | API key starts with "sk-or-" | Gateway | planned |
| Custom | any OpenAI-compatible endpoint | vLLM, Ollama, etc. | done |

New providers can be added by defining a `ProviderSpec` entry—no code changes needed.

Expand Down Expand Up @@ -216,7 +247,7 @@ pnpm run test # Run all tests (Vitest)
pnpm run test:coverage # Tests with coverage report
pnpm run lint # ESLint + type check
pnpm run format # Prettier format
pnpm run docker:prod # Start Postgres, Redis, pgAdmin, API, Web
pnpm run docker:dev # Start Postgres, Redis, pgAdmin
pnpm run docker:down # Stop local infra
pnpm run db:migrate # Run Prisma migrations
pnpm run db:studio # Open Prisma Studio
Expand All @@ -236,7 +267,7 @@ pnpm run db:studio # Open Prisma Studio

- **API:** NestJS 11 + Fastify adapter
- **Frontend:** Next.js 15 + Tailwind CSS + shadcn/ui
- **AI:** Multi-provider (Anthropic, OpenAI, Azure, DeepSeek, Gemini, custom)
- **AI:** Multi-provider (Anthropic, OpenAI, Z.AI Coding, Gemini, Kimi-code, custom)
- **Database:** Prisma + PostgreSQL 16
- **Cache:** Redis 7 (ioredis)
- **Testing:** Vitest + Playwright
Expand Down Expand Up @@ -290,7 +321,7 @@ We welcome contributions! Please see our contributing guidelines:

## Security

If you discover a security vulnerability, please open a [GitHub Security Advisory](https://github.com/clawixAI/clawix/security/advisories/new) instead of using the public issue tracker.
If you discover a security vulnerability, please open a [GitHub Security Advisory](https://github.com/jasonli0226/clawix/security/advisories/new) instead of using the public issue tracker.

Security best practices:

Expand All @@ -301,8 +332,11 @@ Security best practices:

## Roadmap

- [ ] WhatsApp Business API integration
- [x] WhatsApp Business API integration
- [ ] Slack integration
- [ ] Azure OpenAI provider support
- [ ] DeepSeek provider support
- [ ] OpenRouter gateway support
- [ ] Advanced analytics dashboard
- [ ] Skill marketplace UI
- [ ] Multi-region deployment support
Expand Down
3 changes: 2 additions & 1 deletion docs/MULTI-USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ flowchart LR

- **Web** — the authenticated JWT carries `userId`; the WebSocket gateway verifies the JWT on connect.
- **Telegram** — each Clawix user can claim one `telegramId`. Messages from an un-claimed Telegram id are rejected.
- **WhatsApp / Slack** — **[pending]** (adapters not implemented).
- **WhatsApp** — implemented via `@whiskeysockets/baileys` (Business API).
- **Slack** — **[pending]** (adapter not implemented).

---

Expand Down
Loading
Loading