openclaw-admin
OpenClaw gateway management: start/stop/restart/update, config patches, compaction tuning, agent management
What this skill does
# openclaw-admin
## Purpose
This skill handles administration of the OpenClaw gateway, enabling tasks like starting, stopping, restarting, updating the gateway, applying configuration patches, tuning compaction settings, and managing agents within the core-openclaw cluster.
## When to Use
Use this skill for gateway maintenance, such as during deployments (e.g., applying updates), troubleshooting (e.g., restarting after errors), or configuration adjustments (e.g., tuning compaction for performance). Apply it in production environments where the core-openclaw cluster is active, or for agent lifecycle management in distributed setups.
## Key Capabilities
- Gateway lifecycle: Start, stop, restart, or update using CLI commands like `openclaw gateway start --cluster core-openclaw --force`.
- Configuration patches: Apply JSON Patch documents, e.g., {"op": "replace", "path": "/settings/compaction", "value": {"interval": 60}}.
- Compaction tuning: Adjust settings via flags, such as `openclaw compaction tune --threshold 80 --interval 300` to set memory thresholds and intervals.
- Agent management: Add, remove, or list agents with commands like `openclaw agent add --name agent1 --cluster core-openclaw`.
- Authentication: Requires `$OPENCLAW_API_KEY` environment variable for all operations.
## Usage Patterns
Always set `$OPENCLAW_API_KEY` before running commands, e.g., `export OPENCLAW_API_KEY=your_api_key`. For CLI, prefix with `openclaw` and specify the `--cluster core-openclaw` flag. Use API endpoints with HTTP requests, including the `Authorization: Bearer $OPENCLAW_API_KEY` header. In scripts, wrap calls in error checks, e.g., verify the cluster exists before patching configs. For automation, integrate with tools like cron jobs or CI/CD pipelines by calling CLI from bash scripts.
## Common Commands/API
- Start gateway: CLI: `openclaw gateway start --cluster core-openclaw --env prod`. API: POST /api/gateway/start with body {"cluster": "core-openclaw", "env": "prod"}.
- Stop gateway: CLI: `openclaw gateway stop --cluster core-openclaw --force`. API: POST /api/gateway/stop with body {"cluster": "core-openclaw"}.
- Restart gateway: CLI: `openclaw gateway restart --cluster core-openclaw`. API: POST /api/gateway/restart with body {"cluster": "core-openclaw"}.
- Update gateway: CLI: `openclaw gateway update --cluster core-openclaw --version 2.1.0`. API: POST /api/gateway/update with body {"cluster": "core-openclaw", "version": "2.1.0"}.
- Apply config patch: CLI: `openclaw config patch --file config.patch.json --cluster core-openclaw`. API: PATCH /api/config with body from a JSON file, e.g., {"op": "add", "path": "/agents", "value": ["agent1"]}.
- Tune compaction: CLI: `openclaw compaction tune --cluster core-openclaw --threshold 75 --interval 600`. API: PUT /api/compaction with body {"threshold": 75, "interval": 600}.
- Manage agents: CLI: `openclaw agent add --name agent2 --cluster core-openclaw`. API: POST /api/agents with body {"name": "agent2", "cluster": "core-openclaw"}.
- Code snippet for API call (restart gateway):
```bash
export OPENCLAW_API_KEY=your_key
curl -X POST https://api.openclaw.com/api/gateway/restart \
-H "Authorization: Bearer $OPENCLAW_API_KEY" \
-d '{"cluster": "core-openclaw"}'
```
- Code snippet for config patch:
```json
{"op": "replace", "path": "/settings/logLevel", "value": "debug"}
```
## Integration Notes
Integrate this skill by importing it into AI workflows via the "openclaw-admin" ID. Use the embedding hint "openclaw gateway restart update config compaction agent" for vector-based searches in knowledge graphs. For external systems, ensure compatibility with core-openclaw cluster endpoints (e.g., via HTTPS). When combining with other skills, pass outputs as inputs, like using agent IDs from this skill in monitoring tools. Set `$OPENCLAW_API_KEY` in environment files for secure access, and handle cluster-specific configs by appending `--cluster core-openclaw` to all commands.
## Error Handling
Check for authentication errors (e.g., HTTP 401) by verifying `$OPENCLAW_API_KEY` is set and valid; use `echo $OPENCLAW_API_KEY` in scripts. For gateway not found (HTTP 404), confirm cluster status with `openclaw gateway status --cluster core-openclaw`. Parse CLI errors from stderr, e.g., "Error: Cluster core-openclaw not reachable" indicates network issues—retry with exponential backoff. For config patches, handle invalid JSON with try-catch in scripts, e.g., in bash: `openclaw config patch --file invalid.json || echo "Invalid JSON format"`. Common API errors: 400 for bad requests (check body format), 500 for server issues (log and alert).
## Concrete Usage Examples
1. Restart the gateway after a configuration change: First, export the key: `export OPENCLAW_API_KEY=your_api_key`. Then, apply a patch: `openclaw config patch --file patch.json --cluster core-openclaw`, where patch.json contains {"op": "replace", "path": "/settings/restartTrigger", "value": true}. Finally, restart: `openclaw gateway restart --cluster core-openclaw`.
2. Tune compaction and add an agent for performance optimization: Start by tuning: `openclaw compaction tune --cluster core-openclaw --threshold 85 --interval 900`. Then, add an agent: `openclaw agent add --name monitoring-agent --cluster core-openclaw`. Verify with: `openclaw agent list --cluster core-openclaw` to ensure the agent is active.
## Graph Relationships
- Depends on: core-openclaw (cluster for all operations)
- Related to: openclaw (main ecosystem), admin (role-based access), gateway (primary resource), config (configuration management)
- Tagged with: openclaw, admin, gateway, config (for search and linking)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.