### Run MetaClaw Setup and Start Source: https://github.com/aiming-lab/metaclaw/blob/main/extensions/README.md Commands to run after installing the MetaClaw plugin to set it up and start the service. ```bash metaclaw setup metaclaw start ``` -------------------------------- ### MetaClaw Setup and Start Commands Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md These commands are used for initial configuration and launching the MetaClaw agent. The 'start' command can be customized with different modes. ```bash metaclaw setup # one-time config wizard metaclaw start # default: auto mode — skills + scheduled RL training metaclaw start --mode rl # RL without scheduler (trains immediately on full batch) metaclaw start --mode skills_only # skills only, no RL (no Tinker needed) ``` -------------------------------- ### GET /users Response Example (200 OK) Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example JSON response for a successful GET /users request, including user data and pagination details. ```json { "data": [ { "id": "usr_abc123", "email": "user@example.com", "name": "John Doe", "role": "developer", "created_at": "2026-03-15T10:30:00Z" } ], "pagination": { "page": 1, "limit": 20, "total": 45 } } ``` -------------------------------- ### GET /users Request Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example of a GET request to retrieve a list of users, with pagination parameters. ```http GET /users?page=1&limit=20 ``` -------------------------------- ### GET /tasks Response Example (200 OK) Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example JSON response for a successful GET /tasks request, including task data and pagination details. ```json { "data": [ { "id": "tsk_001", "title": "Implement authentication", "description": "Add JWT-based authentication to the API", "status": "active", "assignee": "usr_abc123", "created_at": "2026-04-01T14:20:00Z", "due_date": "2026-04-10T17:00:00Z" } ], "pagination": { "page": 1, "limit": 20, "total": 8 } } ``` -------------------------------- ### Setup MetaClaw Environment Variables Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/docs/scripts.md Copy the example environment file and source it before running scripts. Ensure you edit the copied file with your specific values. ```bash cp benchmark/scripts/_env_arg_example.sh ~/.metaclaw_bench_env.sh # Edit ~/.metaclaw_bench_env.sh with your values source ~/.metaclaw_bench_env.sh ``` -------------------------------- ### Run MetaClaw setup Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Initiates the interactive setup wizard for MetaClaw configuration. ```bash metaclaw setup ``` -------------------------------- ### Structured Logging Example Source: https://github.com/aiming-lab/metaclaw/blob/main/memory_data/skills/structured-logging-and-observability/SKILL.md Demonstrates how to use structlog to emit structured JSON logs with contextual information. Ensure structlog is installed and configured. ```python import structlog log = structlog.get_logger() log.info("request_complete", method="POST", path="/api/data", status=200, latency_ms=42) ``` -------------------------------- ### GET /tasks Response Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day27/api_reference.md Example JSON response when retrieving a list of tasks. Includes task details and total count. ```json { "tasks": [ { "id": "task_001", "title": "Implement user authentication", "status": "in_progress", "assignee": "user_42", "created": "2026-03-15", "due": "2026-04-10" } ], "total": 1 } ``` -------------------------------- ### GET /tasks Request Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example of a GET request to retrieve a list of tasks, with filtering parameters for status and assignee. ```http GET /tasks?status=active&assignee=usr_abc123 ``` -------------------------------- ### Start Development Server Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day11/existing_readme.md Start the local development server. The application will be accessible at http://localhost:3000. ```bash npm run dev ``` -------------------------------- ### Memory Mode Experiment Setup and Run Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/README.md Configures LLM credentials and project root, then executes the memory mode script. This script automatically starts a proxy for memory-only mode. ```bash export BENCHMARK_BASE_URL=https://api.openai.com/v1 export BENCHMARK_API_KEY=sk-... export BENCHMARK_MODEL=gpt-5.2 export METACLAW_ROOT=/absolute/path/to/MetaClaw # memory_run.py starts a proxy — no extra vars needed for memory-only mode python /absolute/path/to/MetaClaw/benchmark/scripts/memory_run.py ``` -------------------------------- ### Copy Environment Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day11/existing_readme.md Copy the example environment file and edit it with your specific configuration settings. ```bash cp .env.example .env # Edit .env with your configuration ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day11/existing_readme.md Install all necessary project dependencies using npm. ```bash npm install ``` -------------------------------- ### Install OpenClaw with curl Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Installs the OpenClaw plugin using curl, unzips it, enables the plugin, and restarts the gateway. This is a one-click installation method. ```bash curl -LO https://github.com/aiming-lab/MetaClaw/releases/download/v0.4.0/metaclaw-plugin.zip unzip metaclaw-plugin.zip -d ~/.openclaw/extensions openclaw plugins enable metaclaw-openclaw && openclaw gateway restart ``` -------------------------------- ### POST /users Request Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example of a POST request to create a new user, including the request body with user details. ```http POST /users Content-Type: application/json { "email": "newuser@example.com", "name": "Jane Smith", "role": "developer" } ``` -------------------------------- ### Install Metaclaw Memory Plugin Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/README.md Install the Metaclaw Memory plugin using the OpenClaw CLI. This also includes setting up the Python sidecar and verifying the installation. ```bash openclaw plugins install @metaclaw/memory openclaw metaclaw setup openclaw metaclaw status ``` -------------------------------- ### Install MetaClaw Memory Plugin Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/docs/QUICK_START.md Install the plugin from npm or a local development directory. ```bash # From npm (after publish) openclaw plugins install @metaclaw/memory # Or from local directory (dev) openclaw plugins install -l /path/to/openclaw-metaclaw-memory ``` -------------------------------- ### POST /users Response Example (201 Created) Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example JSON response for a successful POST /users request, showing the newly created user's data. ```json { "data": { "id": "usr_xyz789", "email": "newuser@example.com", "name": "Jane Smith", "role": "developer", "created_at": "2026-04-06T09:15:00Z" } } ``` -------------------------------- ### Registering CLI Commands with OpenClaw Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/PLAN.md Example of registering CLI commands using `api.registerCli`, which allows for custom commands like `openclaw metaclaw setup`. ```typescript import { program } from "commander"; import setupCommand from "./commands/setup"; import statusCommand from "./commands/status"; import searchCommand from "./commands/search"; import wipeCommand from "./commands/wipe"; import upgradeCommand from "./commands/upgrade"; export const register = (api) => { const metaclaw = program.command("metaclaw"); setupCommand(metaclaw); statusCommand(metaclaw); searchCommand(metaclaw); wipeCommand(metaclaw); upgradeCommand(metaclaw); api.registerCli({ program }); }; ``` -------------------------------- ### Install OpenClaw Plugin Locally Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/OPENCLAW_PLUGIN_SPEC.md Install the plugin from a local directory for development or testing purposes. Ensure you have run npm install and built the project first. ```bash cd /path/to/openclaw-metaclaw-memory npm install && npm run build openclaw plugins install -l . ``` -------------------------------- ### Install MetaClaw with pip (skills_only) Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Installs MetaClaw in skills_only mode using pip, which is a lightweight installation. ```bash pip install -e . ``` -------------------------------- ### Install WeChat plugin manually Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Manually installs the WeChat plugin using npx. This is an alternative to automatic installation. ```bash npx -y @tencent-weixin/openclaw-weixin-cli@latest install ``` -------------------------------- ### Install OpenClaw Plugin from Tarball Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/OPENCLAW_PLUGIN_SPEC.md Install the plugin by first creating a tarball using npm pack, then installing the generated .tgz file. ```bash npm pack openclaw plugins install ./metaclaw-memory-0.1.0.tgz ``` -------------------------------- ### Install and Run MetaClaw Benchmark Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/README.md Installs the MetaClaw benchmark, sets up required environment variables, validates the dataset, and runs the full pipeline. Ensure Python version is 3.10 or higher. ```bash # Install (requires Python ≥ 3.10) cd benchmark pip install -e . # Set required environment variables (see docs/scripts.md for the full list) export BENCHMARK_BASE_URL=http://127.0.0.1:30000/v1 # OpenAI-compatible API base URL export BENCHMARK_API_KEY= # API key for the above endpoint export BENCHMARK_MODEL= # Model ID expected by the API server # Validate the dataset (run from the project root: MetaClaw/) metaclaw-bench check -p benchmark/data/metaclaw-bench/all_tests.json # Run the full pipeline (infer → scoring → report) metaclaw-bench run \ -i benchmark/data/metaclaw-bench/all_tests.json \ -o benchmark/results ``` -------------------------------- ### Install OpenClaw Plugin from npm Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/OPENCLAW_PLUGIN_SPEC.md Use this command to install the plugin from the npm registry after it has been published. ```bash openclaw plugins install @metaclaw/memory ``` -------------------------------- ### POST /tasks Response Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day27/api_reference.md Example JSON response after successfully creating a new task. Includes the new task's ID and status. ```json { "id": "task_002", "title": "Task title", "status": "open", "created": "2026-04-10" } ``` -------------------------------- ### List Installed OpenClaw Plugins Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/OPENCLAW_PLUGIN_SPEC.md Verify that the metaclaw-memory plugin has been successfully installed and is discoverable by OpenClaw. ```bash openclaw plugins list # metaclaw-memory should appear ``` -------------------------------- ### Install MetaClaw with pip (full RL + scheduler) Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Installs MetaClaw with recommended full support for RL training and scheduler integration. ```bash pip install -e ".[rl,evolve,scheduler]" ``` -------------------------------- ### Install MetaClaw with pip (skill evolution) Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Installs MetaClaw with support for skill evolution using an OpenAI-compatible LLM. ```bash pip install -e ".[evolve]" ``` -------------------------------- ### Initialize MetaClaw Memory Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/docs/QUICK_START.md Set up the Python virtual environment and install the sidecar for MetaClaw. ```bash openclaw metaclaw setup # creates Python venv + installs sidecar openclaw metaclaw status # verify: should show "Status: ok" ``` -------------------------------- ### Install MetaClaw with pip (RL training support) Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Installs MetaClaw with support for RL training, including torch, transformers, and tinker. ```bash pip install -e ".[rl]" ``` -------------------------------- ### Start MetaClaw service Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Starts the MetaClaw service, which includes the proxy, agent configuration, and gateway restart. ```bash metaclaw start ``` -------------------------------- ### Install MetaClaw with pip (scheduler integration) Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Installs MetaClaw with Google Calendar integration for the scheduler. ```bash pip install -e ".[scheduler]" ``` -------------------------------- ### MetaClaw CLI Commands Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Commonly used MetaClaw CLI commands for setup, operation, and configuration management. Use `metaclaw setup` for initial configuration. ```bash metaclaw setup # Interactive first-time configuration wizard ``` ```bash metaclaw start # Start MetaClaw (default: auto mode) ``` ```bash metaclaw start --mode rl # Force RL mode (no scheduler) for this session ``` ```bash metaclaw start --mode skills_only # Force skills-only mode for this session ``` ```bash metaclaw stop # Stop a running MetaClaw instance ``` ```bash metaclaw status # Check proxy health, running mode, and scheduler state ``` ```bash metaclaw config show # View current configuration ``` ```bash metaclaw config KEY VALUE # Set a config value ``` ```bash metaclaw config llm.oauth_token TOKEN # Store OAuth token for current CLI provider ``` ```bash metaclaw auth paste-token --provider anthropic # Store OAuth token (anthropic | openai-codex | gemini) ``` ```bash metaclaw auth status # Show all stored auth profiles ``` ```bash metaclaw uninstall # Remove all MetaClaw data, OpenClaw extension, and pip package ``` -------------------------------- ### POST /tasks Request Body Example Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day27/api_reference.md Example JSON request body for creating a new task. Specify title, description, assignee, and due date. ```json { "title": "Task title", "description": "Task description", "assignee": "user_42", "due": "2026-04-15" } ``` -------------------------------- ### PUT /tasks/{task_id} Response Example (200 OK) Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day16/api_docs.md Example JSON response for a successful PUT /tasks/{task_id} request, showing the updated task data. ```json { "data": { "id": "tsk_001", "title": "Implement authentication", "status": "completed", "notes": "Authentication implementation completed and tested", "updated_at": "2026-04-06T11:30:00Z" } } ``` -------------------------------- ### Programmatic Rollout Task Example Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md An example JSON object representing a task for programmatic rollout in MetaClaw. This format is used when setting the 'openclaw_env_data_dir' environment variable. ```json {"task_id": "task_1", "instruction": "Register the webhook at https://example.com/hook"} ``` -------------------------------- ### Updating openclaw.plugin.json Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/PLAN.md Example of a standard openclaw.plugin.json manifest file, including id, kind, and configSchema. ```json { "id": "metaclaw-memory", "name": "MetaClaw Memory", "kind": "memory", "configSchema": { ... }, "uiHints": { ... } } ``` -------------------------------- ### Full Auto OpenCLAW Config Source: https://github.com/aiming-lab/metaclaw/blob/main/extensions/metaclaw-openclaw/README.md Enables the metaclaw-openclaw plugin with one-click MetaClaw setup. This option handles venv creation, pip installation, and starting MetaClaw automatically. ```json { "plugins": { "entries": { "metaclaw-openclaw": { "enabled": true, "config": { "oneClickMetaclaw": true } } } } } ``` -------------------------------- ### Initialize Database Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/data/metaclaw-bench/workspaces/shared/day11/existing_readme.md Run database migrations and seeding to set up the initial database state. ```bash npm run db:migrate npm run db:seed ``` -------------------------------- ### Baseline Experiment Setup and Run Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/README.md Sets up LLM credentials and project root, then runs the baseline experiment script without a proxy. This is for basic model evaluation. ```bash # 1. Required LLM credentials export BENCHMARK_BASE_URL=https://api.openai.com/v1 export BENCHMARK_API_KEY=sk-... export BENCHMARK_MODEL=gpt-5.2 # model ID expected by your API server # 2. Strongly recommended: pin the project root to an absolute path export METACLAW_ROOT=/absolute/path/to/MetaClaw # 3. Run python /absolute/path/to/MetaClaw/benchmark/scripts/baseline_run.py ``` -------------------------------- ### Skills Mode Experiment Setup and Run Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/README.md Sets up LLM credentials, project root, and skills directory, then runs the skills-only experiment script. Ensure METACLAW_SKILLS_DIR is correctly set. ```bash export BENCHMARK_BASE_URL=https://api.openai.com/v1 export BENCHMARK_API_KEY=sk-... export BENCHMARK_MODEL=gpt-5.2 export METACLAW_ROOT=/absolute/path/to/MetaClaw export METACLAW_SKILLS_DIR=/absolute/path/to/your/skills # required for skills scripts python /absolute/path/to/MetaClaw/benchmark/scripts/skills_only_run.py ``` -------------------------------- ### Minimal OpenCLAW Config Source: https://github.com/aiming-lab/metaclaw/blob/main/extensions/metaclaw-openclaw/README.md Enables the metaclaw-openclaw plugin. Requires manual setup and start commands. ```json { "plugins": { "entries": { "metaclaw-openclaw": { "enabled": true } } } } ``` -------------------------------- ### Enable WeChat integration Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Enables WeChat integration by configuring MetaClaw and starting the service. The plugin is installed automatically. ```bash metaclaw config wechat.enabled true metaclaw start ``` -------------------------------- ### RL Mode Experiment Setup and Run Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/README.md Configures environment variables for LLM, project root, and RL training, including Tinker and reward model IDs. Then, it runs the RL-only experiment script. ```bash # Skill evolver uses BENCHMARK_* vars # export BENCHMARK_BASE_URL=https://api.openai.com/v1 # export BENCHMARK_API_KEY=sk-... # export BENCHMARK_MODEL=gpt-5.2 # export METACLAW_ROOT=/absolute/path/to/MetaClaw # Additional vars for RL training export TINKER_KEY= export TINKER_MODEL= export PRM_MODEL= python /absolute/path/to/MetaClaw/benchmark/scripts/rl_only_run.py ``` -------------------------------- ### Configure MinT backend for RL Source: https://github.com/aiming-lab/metaclaw/blob/main/README.md Sets the RL backend to 'mint', configures the API key, base URL, and model for MinT. ```bash metaclaw config rl.backend mint metaclaw config rl.api_key sk-mint-... metaclaw config rl.base_url https://mint.macaron.xin/ metaclaw config rl.model Qwen/Qwen3-4B-Instruct-2507 ``` -------------------------------- ### Run Benchmark with RL and Skills Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/docs/scripts.md Executes the benchmark through the proxy with both RL training and pre-built skills active. Requires METACLAW_SKILLS_DIR and RL variables. ```bash python benchmark/scripts/rl_run.py ``` -------------------------------- ### Run Benchmark with RL and Memory (No Skills) Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/docs/scripts.md Combines RL training and memory features for the benchmark run, excluding skills. Requires RL variables. ```bash python benchmark/scripts/rl_only_memory_run.py ``` -------------------------------- ### Run Benchmark with All Features (MadMax) Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/docs/scripts.md Enables all features simultaneously: RL training, skills, and memory. Requires METACLAW_SKILLS_DIR and RL variables. ```bash python benchmark/scripts/madmax_memory_run.py ``` -------------------------------- ### Create Swap File on Low RAM Systems Source: https://github.com/aiming-lab/metaclaw/blob/main/extensions/README.md Command to create a 4GB swap file and enable it for systems with 2GB RAM or less, recommended before installing MetaClaw. ```bash sudo fallocate -l 4G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile ``` -------------------------------- ### Install MetaClaw Plugin on macOS/Linux Source: https://github.com/aiming-lab/metaclaw/blob/main/extensions/README.md Use this command to download and install the MetaClaw plugin on macOS and Linux systems. ```bash curl -LO https://github.com/aiming-lab/MetaClaw/releases/download/v0.4.0/metaclaw-plugin.zip unzip metaclaw-plugin.zip -d ~/.openclaw/extensions openclaw plugins enable metaclaw-openclaw openclaw gateway restart ``` -------------------------------- ### Install MetaClaw Plugin on Windows (PowerShell) Source: https://github.com/aiming-lab/metaclaw/blob/main/extensions/README.md Use this PowerShell command to download and install the MetaClaw plugin on Windows systems. ```powershell Invoke-WebRequest -Uri https://github.com/aiming-lab/MetaClaw/releases/download/v0.4.0/metaclaw-plugin.zip -OutFile metaclaw-plugin.zip Expand-Archive metaclaw-plugin.zip -DestinationPath $env:USERPROFILE\.openclaw\extensions openclaw plugins enable metaclaw-openclaw openclaw gateway restart ``` -------------------------------- ### Injecting Context via before_agent_start Hook Source: https://github.com/aiming-lab/metaclaw/blob/main/openclaw-metaclaw-memory/PLAN.md How to return context to be prepended to the agent's prompt before the agent starts execution. ```javascript return { prependContext: "..." } ``` -------------------------------- ### Install Development Dependencies and Run Tests Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/README.md Installs Metaclaw in editable mode with development dependencies and runs all tests using pytest. ```bash pip install -e ".[dev]" pytest -v tests/ ``` -------------------------------- ### Run Benchmark with Skills Only Source: https://github.com/aiming-lab/metaclaw/blob/main/benchmark/docs/scripts.md Runs the benchmark through the proxy with pre-built skills injected into the agent context, excluding memory and RL. Requires METACLAW_SKILLS_DIR. ```bash python benchmark/scripts/skills_only_run.py ```