Skip to content
Closed
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
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,33 @@ git pull
docker compose up -d --build
```

**Agent workspace data storage:**
Agent workspace files (soul.md, memory, skills, workspace files) are stored in `./backend/agent_data/` on the host filesystem. Each agent has its own directory named by its UUID (e.g., `backend/agent_data/<agent-id>/`). This directory is mounted into the backend container at `/data/agents/`, making agent data directly accessible from your local filesystem.

**Running as admin user:**
The backend container runs as the `clawith` user by default. To run commands as the `admin` user (with sudo privileges), use:
```bash
# Get an interactive shell as admin (recommended for multiple commands)
docker compose exec --user admin backend bash

# Run a single command as admin
docker compose exec --user admin backend <command>

# Run a command as root via sudo
docker compose exec --user admin backend sudo <command>
```

**Example: Installing packages as admin:**
```bash
# Get admin shell
docker compose exec --user admin backend bash

# Inside the shell, you can use sudo without password
sudo apt-get update
sudo apt-get install -y <package>
sudo npm install -g <package>
```

> **🇨🇳 Docker Registry Mirror (China users):** If `docker compose up -d` fails with a timeout, configure a Docker registry mirror first:
> ```bash
> sudo tee /etc/docker/daemon.json > /dev/null <<EOF
Expand Down
17 changes: 13 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ FROM python:3.12-slim AS production

WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends libpq5 curl shadowsocks-libev && \
apt-get install -y --no-install-recommends libpq5 curl shadowsocks-libev sudo && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g @clawhub/cli && \
rm -rf /var/lib/apt/lists/*

# Copy installed packages from deps stage
Expand All @@ -33,10 +36,16 @@ COPY --from=deps /usr/local/bin/ /usr/local/bin/
# Copy application code
COPY . .

# Non-root user
RUN useradd --create-home clawith && \
# Create both users: admin (with sudo/root access) and clawith (default user)
RUN useradd --create-home --shell /bin/bash admin && \
useradd --create-home --shell /bin/bash clawith && \
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
mkdir -p /data/agents && \
chown -R clawith:clawith /app /data
chown -R clawith:clawith /app /data/agents

# Run as clawith by default (container runs as clawith user)
# - admin user can use sudo to run commands as root
# - To run as admin: docker compose exec backend su - admin
USER clawith

# Health check
Expand Down
92 changes: 92 additions & 0 deletions backend/app/services/skill_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,98 @@
"is_default": True,
"files": [], # populated at runtime from agent_template/skills/MCP_INSTALLER.md
},
# ─── ClawHub CLI (mandatory default) ──────────────
{
"name": "ClawHub",
"description": "Use the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawhub CLI.",
"category": "development",
"icon": "📦",
"folder_name": "clawhub",
"is_default": True,
"files": [
{
"path": "SKILL.md",
"content": """---
name: clawhub
description: Use the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawhub CLI.
metadata:
{
"openclaw":
{
"requires": { "bins": ["clawhub"] },
"install":
[
{
"id": "node",
"kind": "node",
"package": "clawhub",
"bins": ["clawhub"],
"label": "Install ClawHub CLI (npm)",
},
],
},
}
---

# ClawHub CLI

Install

```bash
npm i -g clawhub
```

Auth (publish)

```bash
clawhub login
clawhub whoami
```

Search

```bash
clawhub search "postgres backups"
```

Install

```bash
clawhub install my-skill
clawhub install my-skill --version 1.2.3
```

Update (hash-based match + upgrade)

```bash
clawhub update my-skill
clawhub update my-skill --version 1.2.3
clawhub update --all
clawhub update my-skill --force
clawhub update --all --no-input --force
```

List

```bash
clawhub list
```

Publish

```bash
clawhub publish ./my-skill --slug my-skill --name "My Skill" --version 1.2.0 --changelog "Fixes + docs"
```

Notes

- Default registry: https://clawhub.com (override with CLAWHUB_REGISTRY or --registry)
- Default workdir: cwd (falls back to OpenClaw workspace); install dir: ./skills (override with --workdir / --dir / CLAWHUB_WORKDIR)
- Update command hashes local files, resolves matching version, and upgrades to latest unless --version is set
""",
},
],
},
]


Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
- "8000:8000"
volumes:
- ./backend:/app
- agent_data:/data/agents
- ./backend/agent_data:/data/agents
- /var/run/docker.sock:/var/run/docker.sock
- ./ss-nodes.json:/data/ss-nodes.json:ro
depends_on:
Expand Down Expand Up @@ -79,7 +79,6 @@ services:
volumes:
pgdata:
redisdata:
agent_data:


networks:
Expand Down