一键导入
setup-linux
Set up NanoClaw on Linux (Ubuntu/Debian recommended). Installs deps, configures .env, optional WhatsApp auth, and optional systemd service.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up NanoClaw on Linux (Ubuntu/Debian recommended). Installs deps, configures .env, optional WhatsApp auth, and optional systemd service.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Enable Discord as a NanoClaw channel (works alongside WhatsApp or Discord-only).
Debug container agent issues. Use when things aren't working, container fails, authentication problems, or to understand how the container system works. Covers logs, environment variables, mounts, and common issues.
Run initial NanoClaw setup. Use when user wants to install dependencies, authenticate WhatsApp, register their main channel, or start the background services. Triggers on "setup", "install", "configure nanoclaw", or first-time setup requests.
Add Gmail integration to NanoClaw. Can be configured as a tool (agent reads/sends emails when triggered from WhatsApp) or as a full channel (emails can trigger the agent, schedule tasks, and receive replies). Guides through GCP OAuth setup and implements the integration.
Add new capabilities or modify NanoClaw behavior. Use when user wants to add channels (Telegram, Slack, email input), change triggers, add integrations, modify the router, or make any other customizations. This is an interactive skill that asks questions to understand what the user wants.
基于 SOC 职业分类
| name | setup-linux |
| description | Set up NanoClaw on Linux (Ubuntu/Debian recommended). Installs deps, configures .env, optional WhatsApp auth, and optional systemd service. |
Run commands automatically. Only pause when user action is required (WhatsApp QR scan, choosing Claude auth).
Notes
- Runs directly on the host (no containers).
- The systemd service uses
npm run dev(tsx), notdist/index.js.
better-sqlite3)Install system packages:
sudo apt-get update
sudo apt-get install -y \
git \
ca-certificates \
build-essential \
python3 \
pkg-config
Optional but useful:
sudo apt-get install -y sqlite3
NanoClaw uses the Claude Agent SDK. Provide either:
CLAUDE_CODE_OAUTH_TOKEN (Claude Code OAuth), orANTHROPIC_API_KEYIf you already have the repo, skip.
git clone https://github.com/gunabot/nanoclaw.git
cd nanoclaw
npm install
If this fails due to better-sqlite3 build errors, see Troubleshooting.
.env)NanoClaw reads env vars from .env in the project root.
Minimum Discord + Claude example:
cat > .env << 'EOF'
ASSISTANT_NAME=Andy
DISCORD_TOKEN=
DISCORD_MAIN_CHANNEL_ID=
ANTHROPIC_API_KEY=
# Or use: CLAUDE_CODE_OAUTH_TOKEN=
EOF
Notes:
DISCORD_TOKEN.USER ACTION REQUIRED
Run:
npm run auth
Tell the user:
A QR code will appear. On your phone:
- Open WhatsApp
- Settings → Linked Devices → Link a Device
- Scan the QR code
When it prints “Successfully authenticated” (or “Already authenticated”), continue.
NanoClaw only needs this if you are using WhatsApp.
Ask the user:
Do you want to use your personal chat (Message Yourself) or a WhatsApp group as your main control channel?
Have them send a message in that chat, then capture recent JIDs by briefly running the app:
timeout 10 npm run dev || true
Then query recent chats:
# Personal chat (ends with @s.whatsapp.net)
sqlite3 store/messages.db \
"SELECT DISTINCT chat_jid FROM messages WHERE chat_jid LIKE '%@s.whatsapp.net' ORDER BY timestamp DESC LIMIT 10;"
# Group chat (ends with @g.us)
sqlite3 store/messages.db \
"SELECT DISTINCT chat_jid FROM messages WHERE chat_jid LIKE '%@g.us' ORDER BY timestamp DESC LIMIT 10;"
Create/update data/registered_groups.json (choose a trigger word; default is @Andy):
mkdir -p data
NOW=$(date -Is)
cat > data/registered_groups.json << EOF
{
"JID_HERE": {
"name": "main",
"folder": "main",
"trigger": "@Andy",
"added_at": "${NOW}"
}
}
EOF
Ensure the group folder exists:
mkdir -p groups/main/logs
Foreground (dev runner via tsx):
npm run dev
Create a service unit (adjust user/project path):
PROJECT_PATH=$(pwd)
NPM_BIN=$(command -v npm)
sudo tee /etc/systemd/system/nanoclaw.service > /dev/null << EOF
[Unit]
Description=NanoClaw assistant
After=network.target
[Service]
Type=simple
User=$USER
WorkingDirectory=${PROJECT_PATH}
EnvironmentFile=${PROJECT_PATH}/.env
ExecStart=${NPM_BIN} run dev
Restart=on-failure
RestartSec=3
# Hardening (best-effort)
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ReadWritePaths=${PROJECT_PATH}
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now nanoclaw.service
Check status and logs:
systemctl status nanoclaw.service --no-pager
journalctl -u nanoclaw.service -f
DISCORD_MAIN_CHANNEL_ID → expect a response.@Andy hello → expect a response.better-sqlite3 fails to install / buildSymptoms: node-gyp errors during npm install.
Fix:
sudo apt-get update
sudo apt-get install -y build-essential python3 pkg-config
rm -rf node_modules package-lock.json
npm install
sqlite3: command not foundInstall the CLI (NanoClaw itself does not strictly require it, but setup queries do):
sudo apt-get install -y sqlite3
npm run auth
sudo systemctl restart nanoclaw.service
DISCORD_TOKEN is set and channel is allowed.@Andy) and data/registered_groups.json contains the chat JID.journalctl -u nanoclaw.service -f
.env exists in the project rootEnvironmentFile= path is correct and restart the service