### Set Up Development Environment Source: https://github.com/id-robots/clawbox/blob/main/CONTRIBUTING.md Install project dependencies and start the development server. Refer to README.md and CLAUDE.md for detailed setup instructions. ```bash bun install bun run dev ``` -------------------------------- ### Install and Configure Clawkeep Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Steps to build dependencies, install the clawkeep client, and configure it on a Linux device. This includes setting up necessary directories and copying the example configuration file. ```bash sudo apt install -y python3 python3-pip npm install -g @openclaw/cli # only needed off-device pip install --user . # or: sudo pip install . sudo install -d -m 0755 /etc/clawkeep sudo install -d -m 0750 -o clawkeep -g clawkeep /var/lib/clawkeep /var/log/clawkeep sudo cp config.toml.example /etc/clawkeep/config.toml sudo $EDITOR /etc/clawkeep/config.toml ``` -------------------------------- ### Development Setup and Checks Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Commands for setting up the development environment, including installing dependencies in editable mode, running code linters, type checking, and executing tests. ```bash pip install -e '.[dev]' ruff check . mypy clawkeep pytest ``` -------------------------------- ### Install and Run Mintlify CLI Source: https://github.com/id-robots/clawbox/blob/main/docs-site/README.md Commands to install the Mintlify CLI globally and then run the local development server for the documentation site. Opens a live-reloading preview. ```bash # one-time: install the Mintlify CLI npm i -g mint # from the docs-site/ directory cd docs-site mint dev ``` -------------------------------- ### E2E Install AI Provider Configuration Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md Example configuration file for setting up API keys for various AI providers. Missing keys cause tests to skip. ```ini ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... GEMINI_API_KEY=... OPENROUTER_API_KEY=... TELEGRAM_BOT_TOKEN=1234:... ``` -------------------------------- ### Tail Clawbox Install Log Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md Tails the installation log file within the Clawbox container to monitor the setup process in real-time. ```bash docker compose -f e2e-install/docker-compose.test.yml exec clawbox \ tail -f /var/log/clawbox-install.log ``` -------------------------------- ### Install and Run ClawBox Development Server Source: https://github.com/id-robots/clawbox/blob/main/README.md Install project dependencies and run the development server. Use the privileged port for root access. ```bash bun install bun run dev # Port 3000 bun run dev:privileged # Port 80 (requires root) ``` -------------------------------- ### Initialize HTML/CSS/JS Project Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Scaffolds a new HTML/CSS/JS project in the specified directory. Use this to start a new project. ```shell code_project_init("data/code-projects//") ``` -------------------------------- ### Reuse Booted Container for E2E Install Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md Skips the global setup phase by reusing an already booted container for faster subsequent runs. ```bash # Reuse an already-booted container (skip global setup) CLAWBOX_E2E_SKIP_SETUP=1 bash scripts/e2e-install.sh ``` -------------------------------- ### Full E2E Install Script Execution Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md Executes the full end-to-end installation, including build, install, tests, and teardown. ```bash # Full run (build + install + tests + teardown) bash scripts/e2e-install.sh ``` -------------------------------- ### Install ClawBox Software Source: https://github.com/id-robots/clawbox/blob/main/README.md This script installs the ClawBox software. It creates a dedicated user, clones the repository, sets ownership, and executes the main installation script. Ensure you are in the correct directory before running. ```bash id -u clawbox >/dev/null 2>&1 || sudo useradd -m -s /bin/bash clawbox sudo git clone https://github.com/ID-Robots/clawbox.git /home/clawbox/clawbox sudo chown -R clawbox:clawbox /home/clawbox/clawbox cd /home/clawbox/clawbox sudo bash install.sh ``` -------------------------------- ### Install and Enable Systemd Timer Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-restic-migration.md Copies the systemd service and timer files to the system directory, reloads the daemon, and enables/starts the timer. ```bash cp config/clawbox-clawkeep.service /etc/systemd/system/ cp config/clawbox-clawkeep.timer /etc/systemd/system/ systemctl daemon-reload systemctl enable --now clawbox-clawkeep.timer ``` -------------------------------- ### Install Restic Binary Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-restic-migration.md Adds the restic binary to the system. Ensure the RESTIC_VERSION is up-to-date. ```bash # Step: install_restic RESTIC_VERSION="0.17.3" ARCH="$(dpkg --print-architecture)" # arm64 | amd64 curl -fsSL "https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_${ARCH}.bz2" \ | bunzip2 > /usr/local/bin/restic chmod +x /usr/local/bin/restic ``` -------------------------------- ### Enable Systemd Timers for Daily Backups Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Installs and enables systemd service and timer units for automated daily backups and idle-time backups. Ensures the systemd daemon is reloaded after installation. ```bash sudo install systemd/clawkeepd.service /etc/systemd/system/ sudo install systemd/clawkeepd.timer /etc/systemd/system/ sudo install systemd/clawkeep-idle.service /etc/systemd/system/ sudo install systemd/clawkeep-idle.timer /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now clawkeepd.timer clawkeep-idle.timer ``` -------------------------------- ### Register QEMU for ARM64 Emulation Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md One-time command to register QEMU for ARM64 emulation on an x86 host before running the installation script. ```bash # One-time on an x86 host: register qemu for arm64 emulation docker run --privileged --rm tonistiigi/binfmt --install arm64 ``` -------------------------------- ### App and Webapp Management Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Tools for managing applications and web applications, including searching, installing, uninstalling, creating, and updating. ```typescript app_search app_install app_uninstall webapp_create webapp_update ``` -------------------------------- ### Check ClawBox Service Status Source: https://github.com/id-robots/clawbox/blob/main/docs-site/support/updating.mdx Verify that the ClawBox gateway and setup services are active after an update or recovery. Both services should report 'active'. ```bash systemctl is-active clawbox-gateway.service clawbox-setup.service ``` -------------------------------- ### Force Image Rebuild for E2E Install Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md Forces a rebuild of the Docker image during the end-to-end installation process. ```bash # Force image rebuild CLAWBOX_E2E_REBUILD=1 bash scripts/e2e-install.sh ``` -------------------------------- ### App Management Tools Source: https://github.com/id-robots/clawbox/blob/main/README.md Tools for managing applications within the ClawBox environment, including searching, installing, and creating web applications. ```text app_search / app_install / app_uninstall — app store operations webapp_create / webapp_update — create desktop apps from HTML preferences_get / preferences_set — user preferences ``` -------------------------------- ### Pair Device with Portal Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Command to pair the device with your OpenClaw portal account using OAuth2 flow. This is a one-time setup step. ```bash clawkeep pair --server https://openclawhardware.dev ``` -------------------------------- ### UI Control Tools Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Tools for interacting with the user interface, including opening applications, listing installed apps, and displaying notifications. ```typescript ui_open_app ui_list_apps ui_notify ``` -------------------------------- ### Restic Restore Command Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-restic-migration.md Example of the restic command to restore a specific snapshot to a target path. This is used in the restore flow. ```bash restic restore --target ``` -------------------------------- ### Connect to ClawBox via SSH Source: https://github.com/id-robots/clawbox/blob/main/docs-site/support/updating.mdx Connect to your ClawBox using SSH. Ensure you use the device's IP address. The password is the system password set during setup. ```bash ssh clawbox@YOUR_BOX_IP ``` -------------------------------- ### Build Static Site with Mintlify Source: https://github.com/id-robots/clawbox/blob/main/docs-site/README.md Command to generate a static build of the documentation site for self-hosting. ```bash mint build ``` -------------------------------- ### Build and Deploy Project Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Inlines CSS and JS into a single HTML file, deploys it to the desktop, and opens it. Use this to finalize and view your project. ```shell code_project_build() ``` -------------------------------- ### Route Test: GET Telegram Pairing Status Source: https://github.com/id-robots/clawbox/blob/main/docs/superpowers/specs/2026-06-16-telegram-pairing-design.md Tests the GET endpoint for Telegram pairing, verifying responses for configured, not configured, and pending request scenarios. ```typescript GET configured/not/pending ``` -------------------------------- ### Telegram Pairing Route - GET Request Source: https://github.com/id-robots/clawbox/blob/main/docs/superpowers/specs/2026-06-16-telegram-pairing-design.md Handles GET requests for Telegram pairing status. It returns configured status, approved users, and optionally pending requests. ```typescript GET → { configured, approved, pending: [] } ``` -------------------------------- ### Project Structure Overview Source: https://github.com/id-robots/clawbox/blob/main/docs-site/README.md This snippet shows the directory structure of the ClawBox documentation site. It highlights key configuration and content files. ```bash docs-site/ ├── docs.json # site config: nav, theme, colors, logo ├── index.mdx # landing page ├── quickstart.mdx ├── setup/ # first boot, network, AI provider ├── hardware/ # ClawBox Connect, ClawBox Workstation ├── guides/ # messaging channels, subscriptions ├── support/ # troubleshooting, FAQ ├── logo/ # light.png / dark.png ├── images/ └── favicon.png ``` -------------------------------- ### Create Directories with bash Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Use `bash` to create directories, including parent directories if they do not exist. Alternatively, `write_file` can also create parent directories on demand. ```typescript bash("mkdir -p path/to/dir") ``` -------------------------------- ### Build, Lint, and Test ClawBox Source: https://github.com/id-robots/clawbox/blob/main/README.md Commands for building the project, running code linting, and executing unit tests using Vitest. ```bash bun run build bun run lint bun run test # Unit tests (Vitest) ``` -------------------------------- ### Back up ClawBox Settings Source: https://github.com/id-robots/clawbox/blob/main/docs-site/support/updating.mdx Create a backup of your ClawBox data, settings, and channel tokens. This command copies the entire ~/.openclaw directory to a dated backup. ```bash cp -r ~/.openclaw ~/.openclaw.backup-$(date +%F) ``` -------------------------------- ### Run Clawbox CLI System Info Command Source: https://github.com/id-robots/clawbox/blob/main/mcp/README.md Performs a CLI sanity check by retrieving system information using the Clawbox CLI. This command uses the data/.mcp-token fallback if no token is explicitly provided. It expects JSON output. ```bash # 3. CLI sanity (uses the data/.mcp-token fallback) bun run mcp/clawbox-cli.ts system info # → JSON, not "Failed to parse JSON" ``` -------------------------------- ### ClawBox CLI Wrapper - Code Project Management Source: https://github.com/id-robots/clawbox/blob/main/README.md Command-line interface commands for initializing, building, listing files, and searching within code projects. ```bash clawbox code init [template] [color] clawbox code build clawbox code files clawbox code search ``` -------------------------------- ### Restore Backup using AWS CLI Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Steps to restore a backup by minting credentials, listing available snapshots, and downloading the most recent one using `aws s3 cp`. It emphasizes never writing credentials to world-readable paths. ```bash TOKEN=$(sudo cat /var/lib/clawkeep/token) CREDS_FILE=$(mktemp) chmod 600 "$CREDS_FILE" trap 'shred -u "$CREDS_FILE" 2>/dev/null || rm -f "$CREDS_FILE"' EXIT curl -s -X POST -H "Authorization: Bearer $TOKEN" \ https://openclawhardware.dev/api/clawkeep/credentials > "$CREDS_FILE" export AWS_ACCESS_KEY_ID=$(jq -r .accessKeyId "$CREDS_FILE") export AWS_SECRET_ACCESS_KEY=$(jq -r .secretAccessKey "$CREDS_FILE") export AWS_SESSION_TOKEN=$(jq -r .sessionToken "$CREDS_FILE") export AWS_DEFAULT_REGION=auto ENDPOINT=$(jq -r .endpoint "$CREDS_FILE") BUCKET=$(jq -r .bucket "$CREDS_FILE") PREFIX=$(jq -r .prefix "$CREDS_FILE") # List all snapshots under your prefix: aws --endpoint-url "$ENDPOINT" s3 ls "s3://$BUCKET/$PREFIX" # Pull the most recent one: LATEST=$(aws --endpoint-url "$ENDPOINT" s3 ls "s3://$BUCKET/$PREFIX" \ | awk '{print $4}' | sort | tail -1) aws --endpoint-url "$ENDPOINT" s3 cp \ "s3://$BUCKET/$PREFIX$LATEST" /tmp/restore.tar.gz # Then validate the manifest and unpack: openclaw backup verify /tmp/restore.tar.gz tar -xzf /tmp/restore.tar.gz -C /tmp/restore # trap shreds the temp creds file when the shell exits. ``` -------------------------------- ### Configure Systemd Service for Scheduled Backup Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-restic-migration.md Sets up a systemd service and timer to run scheduled ClawKeep backups. The service executes a script that handles password decryption and triggers the backup sync. ```ini [Unit] Description=ClawKeep scheduled backup After=network-online.target clawbox-setup.service [Service] Type=oneshot User=clawbox ExecStart=/usr/local/bin/clawkeep-run StandardOutput=journal StandardError=journal ``` ```ini [Unit] Description=Run ClawKeep on schedule [Timer] OnCalendar=daily Persistent=true Unit=clawbox-clawkeep.service [Install] WantedBy=timers.target ``` -------------------------------- ### ClawBox CLI Wrapper - Webapp and App Management Source: https://github.com/id-robots/clawbox/blob/main/README.md Command-line interface commands for managing web applications and general app operations. ```bash clawbox webapp create [color] < file.html clawbox app open clawbox app list ``` -------------------------------- ### List Projects Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Lists all available code projects managed by Clawbox. ```shell code_project_list() ``` -------------------------------- ### Clawbox Tech Stack Summary Source: https://github.com/id-robots/clawbox/blob/main/README.md Overview of the technologies used across different layers of the Clawbox project, from frontend to AI integration. ```text | Layer | Technology | |-------|-----------| | **Frontend** | Next.js 16, React 19, Tailwind CSS 4 | | **Language** | TypeScript 5 | | **Package Manager** | Bun | | **Runtime** | Node.js 22 (production), Bun (dev/build) | | **AI Engine** | [OpenClaw](https://github.com/openclaw/openclaw) via MCP | | **Local Models** | Ollama (Llama, Gemma, Mistral) | | **Networking** | NetworkManager (WiFi AP), Avahi (mDNS) | | **Testing** | Vitest + Playwright | ``` -------------------------------- ### Validate Links with Mintlify Source: https://github.com/id-robots/clawbox/blob/main/docs-site/README.md Command to check for broken links within the documentation site before publishing. ```bash mint broken-links ``` -------------------------------- ### Clawbox Architecture Overview Source: https://github.com/id-robots/clawbox/blob/main/README.md Visual representation of the Clawbox system architecture, showing browser interaction with Next.js, OpenClaw gateway, and Chromium CDP. ```text Browser (http://clawbox.local) │ ├── Port 80: Next.js (production-server.js) │ ├── /setup → Setup wizard (React SPA) │ ├── /login → Authentication │ ├── / → Desktop environment (post-setup) │ ├── /setup-api/* → 50+ API routes (system, files, code, browser, etc.) │ ├── /api/* → Proxy to OpenClaw gateway │ └── WebSocket → Proxy to gateway + terminal PTY │ ├── Port 3006: Terminal WebSocket PTY server │ ├── Port 18789: OpenClaw Gateway (localhost only) │ ├── AI Agent (MCP tools → controls the entire OS) │ ├── Control UI │ ├── WebSocket (real-time chat) │ └── REST API │ └── Port 18800: Chromium CDP (browser automation) ``` -------------------------------- ### Run Local Checks Before Pushing Source: https://github.com/id-robots/clawbox/blob/main/CONTRIBUTING.md Execute linting, testing, and build checks locally to ensure code quality and correctness before submitting a pull request. ```bash bun run lint bun run test bun run build ``` -------------------------------- ### Code Assistant Tools Source: https://github.com/id-robots/clawbox/blob/main/README.md Tools for the AI to assist in building, testing, and deploying new desktop web applications, including project scaffolding and file management. ```text code_project_init — scaffold a new multi-file webapp project code_project_list — list all projects code_project_build — bundle CSS/JS into HTML, deploy to desktop, open the app code_project_delete — remove a project code_file_write — create or overwrite a project file code_file_read — read a project file code_file_edit — surgical string-replacement edits code_file_delete — remove a file code_file_list — recursive project tree code_search — grep across project files ``` -------------------------------- ### Run Debug Backup Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Command to manually trigger a backup for debugging purposes. Use the --verbose flag for detailed output. ```bash clawkeepd --verbose ``` -------------------------------- ### ClawBox MCP Architecture Diagram Source: https://github.com/id-robots/clawbox/blob/main/mcp/README.md Illustrates the communication flow between the agent, ClawBox MCP, and the device, highlighting the use of stdio and HTTP transports. ```text agent ──stdio (MCP)──▶ clawbox-mcp.ts ──HTTP(Bearer)──▶ Next.js /setup-api/* ──▶ device clawbox-cli.ts (same backend, shell-callable) ``` -------------------------------- ### UI: Backup Retention Settings Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-backup-mgmt-spec.md Illustrates the UI elements for configuring backup retention, including a number input for 'Keep last N backups' and helper text explaining that locked backups are always retained. ```typescript // src/components/ClawKeepApp.tsx (conceptual) function RetentionSettings() { const [keepLast, setKeepLast] = useState(10) return (
setKeepLast(parseInt(e.target.value, 10))} />

Locked backups are always kept.

Set to 0 to disable automatic pruning.

) } ``` -------------------------------- ### Read File from Project Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Reads the content of a specific file from a project's directory. Useful for inspecting file contents. ```shell read_file("data/code-projects//app.js") ``` -------------------------------- ### List Directory Contents Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Lists the contents of a specified directory within a project. Useful for understanding project structure. ```shell list_directory("data/code-projects//") ``` -------------------------------- ### ClawBox CLI Wrapper - Notifications and System Stats Source: https://github.com/id-robots/clawbox/blob/main/README.md Command-line interface commands for sending notifications and retrieving system statistics. ```bash clawbox notify clawbox system stats ``` -------------------------------- ### Run ClawBox One-Line Updater Source: https://github.com/id-robots/clawbox/blob/main/docs-site/support/updating.mdx Execute the script to update your ClawBox to the latest version. This command downloads, builds, and restarts services, taking a few minutes to complete. ```bash bash <(curl -fsSL https://raw.githubusercontent.com/id-robots/clawbox/main/scripts/force-update.sh) ``` -------------------------------- ### Write File in Project Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Writes content to a specific file within a project's directory. Used for adding or updating files. ```shell write_file("data/code-projects//index.html", "...") ``` -------------------------------- ### Track Multi-Step Work with Tasks Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Tools for tracking user-visible multi-step work, including creation, updates, retrieval, and listing. Supports defining dependencies. ```typescript task_create task_update task_get task_list ``` -------------------------------- ### SSH Tunnel for Headless Pairing Source: https://github.com/id-robots/clawbox/blob/main/clawkeep/README.md Demonstrates how to set up an SSH tunnel to forward the local listener port (8765) from the device to your laptop. This is useful for performing the OAuth2 pairing flow when a browser is not directly available on the device. ```bash ssh -L 8765:127.0.0.1:8765 clawbox@your-device ``` -------------------------------- ### Run Full Smoke Test for Clawbox MCP Tools Source: https://github.com/id-robots/clawbox/blob/main/mcp/README.md Executes a comprehensive smoke test for all tools within the Clawbox MCP via JSON-RPC stdio. This script ensures the overall functionality of the MCP's tools. ```bash # 2. Full smoke test of every tool over JSON-RPC stdio bash mcp/test-tools.sh ``` -------------------------------- ### UI: Snapshot List Row Actions Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-backup-mgmt-spec.md Demonstrates how snapshot list rows in the UI would display labels, lock indicators, and provide actions like Rename, Lock/Unlock, and Delete. ```typescript // src/components/ClawKeepApp.tsx (conceptual) function SnapshotRow({ snapshot }) { const label = snapshot.label || formatTimestamp(snapshot.timestamp) const isLocked = snapshot.locked return (
{label} {isLocked && 🔒}
) } ``` -------------------------------- ### ClawKeep Restic Module Sketch Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-restic-migration.md Defines constants and helper functions for interacting with restic. It shells out to the restic binary and handles cloud credentials. ```typescript const RESTIC = "/usr/local/bin/restic"; const SOURCE_DIR = path.join(process.env.HOME || "/home/clawbox", ".openclaw"); const LOCAL_REPO_DEFAULT = path.join(process.env.HOME || "/home/clawbox", "Backups/clawkeep"); const PORTAL_BASE = process.env.CLAWKEEP_PORTAL_BASE || "https://openclawhardware.dev"; async function fetchCloudCredentials(token: string) { const res = await fetch(`${PORTAL_BASE}/api/clawkeep/credentials`, { method: "POST", headers: { Authorization: `Bearer ${token}` }, }); if (!res.ok) throw new Error(`credentials ${res.status}`); return await res.json() as { accessKeyId: string; secretAccessKey: string; sessionToken: string | null; endpoint: string; bucket: string; prefix: string; expiresAt: number; }; } function resticEnv(creds: AwaitedCreds, password: string) { return { ...process.env, AWS_ACCESS_KEY_ID: creds.accessKeyId, AWS_SECRET_ACCESS_KEY: creds.secretAccessKey, ...(creds.sessionToken ? { AWS_SESSION_TOKEN: creds.sessionToken } : {}), RESTIC_REPOSITORY: `s3:${creds.endpoint}/${creds.bucket}/${creds.prefix.replace(///$/, "")}`, RESTIC_PASSWORD: password, }; } ``` -------------------------------- ### Clone Fork and Create Feature Branch Source: https://github.com/id-robots/clawbox/blob/main/CONTRIBUTING.md Clone your fork of the ClawBox repository and create a new branch for your feature development. ```bash git clone git@github.com:/clawbox.git cd clawbox git checkout -b my-change ``` -------------------------------- ### Browser Automation Tools Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md A suite of tools for controlling a Chromium browser instance via CDP. Includes opening, navigating, interacting, and closing the browser. ```typescript browser_open browser_launch browser_navigate browser_click browser_type browser_scroll browser_screenshot browser_keypress browser_close ``` -------------------------------- ### API Route for Snapshot Labeling Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-backup-mgmt-spec.md Implements a POST route for setting a label on a specific snapshot. Requires the snapshot name and the desired label text. ```typescript // src/app/setup-api/clawkeep/snapshots/label/route.ts import { setSnapshotLabel } from '@/lib/clawkeep' export async function POST(request: Request) { const { name, label } = await request.json() await setSnapshotLabel(name, label) return new Response(null, { status: 204 }) } ``` -------------------------------- ### Clawbox Project Structure Source: https://github.com/id-robots/clawbox/blob/main/README.md Directory structure of the Clawbox project, detailing the organization of configuration, backend services, frontend components, and scripts. ```text ├── config/ Systemd services, captive-portal DNS ├── mcp/ MCP server + CLI (AI agent interface to the OS) ├── scripts/ WiFi AP, terminal server, voice/TTS, Jetson tuning ├── src/ │ ├── app/ Next.js App Router (pages + 50+ API routes) │ │ └── setup-api/ WiFi, AI models, Ollama, apps, files, browser, code, system │ ├── components/ Setup wizard, desktop environment, built-in apps │ ├── hooks/ Window manager, Ollama model management │ ├── lib/ Config, network, auth, OAuth, i18n, updater, code-projects │ ├── tests/ Unit + API route tests │ └── middleware.ts Captive portal detection + session auth ├── production-server.js Node.js HTTP + WebSocket proxy wrapper └── install.sh Full system installer (idempotent) ``` -------------------------------- ### Device Control Tools Source: https://github.com/id-robots/clawbox/blob/main/README.md These tools are used by the AI agent to monitor and manage the device, perform file operations, and manage network settings. ```text system_stats / system_info / system_power — monitor and manage the device bash — execute shell commands read_file / write_file / edit_file — file operations list_directory / glob / grep — search files and content wifi_scan / wifi_status — network management ui_open_app / ui_notify — control the desktop UI ``` -------------------------------- ### Inspect Clawbox Systemd Services Source: https://github.com/id-robots/clawbox/blob/main/e2e-install/README.md Checks the status of critical systemd services, clawbox-setup and clawbox-gateway, within the Clawbox container. ```bash docker compose -f e2e-install/docker-compose.test.yml exec clawbox \ systemctl status clawbox-setup.service clawbox-gateway.service ``` -------------------------------- ### Check OpenClaw Service Status Source: https://github.com/id-robots/clawbox/blob/main/docs-site/setup/openclaw-setup.mdx Use this command to verify if all OpenClaw services are running correctly. If issues arise after configuration changes, this is a good first step for diagnosis. ```bash openclaw status ``` -------------------------------- ### Execute Shell Commands with bash Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Provides full shell access. Use for short-lived foreground jobs. For long-running tasks, use the `agent` tool. The `bash` tool flags dangerous commands and requires confirmation before bypassing. ```typescript bash("ls -la") bash("git status") ``` -------------------------------- ### Write or Overwrite a File Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Creates a new file or overwrites an existing one. Parent directories are automatically created if they do not exist. ```typescript write_file(path, content) ``` -------------------------------- ### UI: Manual Backup Label Input Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-backup-mgmt-spec.md Shows an optional input field in the UI for users to provide a name or label when manually triggering a backup. This label is then passed to the backup route. ```typescript // src/components/ClawKeepApp.tsx (conceptual) function ManualBackupTrigger() { const [backupLabel, setBackupLabel] = useState('') const handleTriggerBackup = async () => { await triggerBackup({ label: backupLabel }) setBackupLabel('') } return (
setBackupLabel(e.target.value)} />
) } ``` -------------------------------- ### Monitor OpenClaw Logs in Real-Time Source: https://github.com/id-robots/clawbox/blob/main/docs-site/setup/openclaw-setup.mdx This command streams OpenClaw logs in real-time, which is useful for debugging and monitoring the service's activity. Press Ctrl+C to stop streaming. ```bash journalctl -u openclaw -f ``` -------------------------------- ### List Telegram Pairing Requests Function Source: https://github.com/id-robots/clawbox/blob/main/docs/superpowers/specs/2026-06-16-telegram-pairing-design.md Runs the CLI command to list pending Telegram pairing requests and returns the list of requests. ```typescript listTelegramPairingRequests() ``` -------------------------------- ### ClawKeep Backup Manifest Structure Source: https://github.com/id-robots/clawbox/blob/main/docs/clawkeep-backup-mgmt-spec.md This JSON structure defines the metadata for ClawKeep backups, including labels, lock status, and creation timestamps. It is stored in a sidecar manifest file within the same R2 prefix as the backups. ```json { "version": 1, "snapshots": { "": { "label": "Before v3 upgrade", "locked": true, "createdAt": 1733650000000 } } } ``` -------------------------------- ### List Directory Contents Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Retrieves a listing of files and subdirectories within a specified path. ```typescript list_directory(path) ``` -------------------------------- ### Network Tools Source: https://github.com/id-robots/clawbox/blob/main/Clawbox.md Provides tools for scanning Wi-Fi networks and checking network status. ```typescript wifi_scan wifi_status vnc_status ```