openclaw (also called trpc_claw) is an agent runtime built on top of trpc_agent_sdk and nanobot, supporting:
- Third-party channel integrations (for example: Telegram / WeCom and other channels supported by nanobot). OpenClaw supports all of these channels. See nanobot/channels.
- Local CLI fallback mode
- Tool invocation (file, shell, web, messaging, scheduled tasks, MCP, skills)
- Session/memory management and summarization
- Heartbeat/Cron scheduled execution
Default workspace: ~/.trpc_claw/workspace
- Unified processing pipeline: whether messages come from Telegram / WeCom or local CLI, they all flow through the same
MessageBus -> Runner -> Agentpipeline - Two run modes
run: use gateway when channels are available; automatically fall back to CLI when none are enabledchat: force local CLI mode
- Extensible tool system: built-in file tools, command execution, web tools, messaging, cron, MCP, and skills
- Long-running operation support: heartbeat and cron can trigger tasks even without active user interactions
flowchart TD
A[trpc_agent_cmd openclaw] --> B[Typer Commands: run/chat/ui/conf_temp/deps]
B --> C[ClawApplication]
C --> D[load_config]
C --> E[MessageBus]
C --> F[ChannelManager]
C --> G[Runner + LlmAgent]
G --> H[Tools / Skills / MCP]
C --> I[CronService]
C --> J[HeartbeatService]
F -->|enabled channels| K[Telegram / WeCom / other channels]
B -->|chat or no channel| L[CLI fallback loop]
E --> G
I --> G
J --> G
- Python
>=3.10(recommended3.12) - Use a virtual environment (
uvorvenv)
uv venv
source .venv/bin/activate
python -VCurrent recommended command entry point (aligned with the repository state):
trpc_agent_cmd openclaw --helpmkdir -p ~/.trpc_claw
# Minimal template
trpc_agent_cmd openclaw conf_temp > ~/.trpc_claw/config.yaml
# Full template (recommended)
trpc_agent_cmd openclaw conf_temp --full > ~/.trpc_claw/config_full.yaml# Auto mode: use gateway if channels are available; otherwise fall back to CLI
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config_full.yaml
# Force local CLI interaction
trpc_agent_cmd openclaw chat -c ~/.trpc_claw/config_full.yaml
# Start UI
trpc_agent_cmd openclaw ui -c ~/.trpc_claw/config_full.yamltrpc_agent_cmd openclaw conf_temp [--full]- Print built-in config templates (
config.temp.yaml/config_full.temp.yaml)
- Print built-in config templates (
trpc_agent_cmd openclaw run [-w WORKSPACE] [-c CONFIG]- Start gateway mode; automatically fall back to CLI if no third-party channel is available
trpc_agent_cmd openclaw chat [-w WORKSPACE] [-c CONFIG]- Always use local CLI mode and ignore third-party channels
trpc_agent_cmd openclaw ui [-w WORKSPACE] [-c CONFIG]- Start UI (macOS desktop app, browser on other systems)
trpc_agent_cmd openclaw deps [OPTIONS]- Inspect skill dependencies and output an installation plan; supports
--applyto execute install commands
- Inspect skill dependencies and output an installation plan; supports
# Inspect by profile (recommended)
trpc_agent_cmd openclaw deps \
-c ~/.trpc_claw/config_full.yaml \
--profile common-file-tools
# Inspect by skill
trpc_agent_cmd openclaw deps \
-c ~/.trpc_claw/config_full.yaml \
--skills {skill-finder} # Placeholder skill name for downloading skills; replace with your real skill name
# Output JSON
trpc_agent_cmd openclaw deps \
-c ~/.trpc_claw/config_full.yaml \
--profile common-file-tools \
--json
# Execute the installation plan directly
trpc_agent_cmd openclaw deps \
-c ~/.trpc_claw/config_full.yaml \
--profile common-file-tools \
--applyCommon options:
--profile: dependency profile(s) (comma-separated)--skills/-s: inspect dependencies by skill name (comma-separated)--state-dir: toolchain state directory (alignment parameter)--skills-root: override skills root--skills-extra-dirs: extra skills roots (comma-separated)--skills-allow-bundled: override bundled skill allowlist--continue-on-error/--fail-fast: installation execution strategy
Configuration supports YAML/JSON, default lookup path:
~/.trpc_claw/config.json
You can override via:
- CLI argument:
-c/--config - Environment variable:
TRPC_CLAW_CONFIG
Example:
export TRPC_CLAW_CONFIG=/path/to/config.yaml
trpc_agent_cmd openclaw chatapp_name: runtime app nameuser_id: default user IDlegacy_sessions_dir: compatibility path for legacy session storage
workspace: workspace directory (falls back to default when empty)model: model name (recommended viaTRPC_AGENT_MODEL_NAME)api_key: model API key (recommended viaTRPC_AGENT_API_KEY)api_base: model base URL (recommended viaTRPC_AGENT_BASE_URL)provider/max_tokens/context_window_tokens/...: model behavior and cost-related settings
send_progress: whether to push streaming progresssend_tool_hints: whether to push tool hintstelegram.*: Telegram channel configwecom.*: WeCom channel configstream_reply: whether to send stream chunksrestart_command: command for worker process restart + config reload (default/restart)
Fields currently used by openclaw:
sandbox_type: currently supportslocal/containerskill_roots: user skill roots (supports local dirs,file://,http(s)://)builtin_skill_roots: built-in skill rootsconfig_keys: used to satisfyrequires.configin skill metadataallow_bundled: allowlist when only selected built-in skills should be exposed (byskill_keyorname)skill_configs: runtime config byskill_keyornameenabledenv(now unified as env-only;api_key/primary_envmapping is removed)
local_config/container_config: sandbox-specific configrun_tool_kwargs: passthrough runtime args forskill_run
Example:
skills:
sandbox_type: container
skill_roots: []
builtin_skill_roots: []
config_keys:
- skillhub.enabled
- skillhub
allow_bundled:
- skillhub.skill.finder
- skillhub-finder
skill_configs:
skillhub-skill-finder:
enabled: true
env:
SKILLHUB_USERNAME: ${SKILLHUB_USERNAME}
SKILLHUB_TOKEN: ${SKILLHUB_TOKEN}Note: skillhub-skill-finder is only an example. Replace it with your actual skill name in real usage.
restrict_to_workspace: restrict tools to operate inside workspace onlyexec.timeout/exec.path_append: command execution configweb.search: search provider config (brave/tavily/duckduckgo/searxng/jina)mcp_servers: MCP server list (stdio/http)
memory.memory_service_config.ttl: memory TTL policystorage:file/redis/sqllogger: logging configpersonal: override paths forSOUL.md/USER.md/TOOLS.md/AGENTS.md
TRPC_AGENT_API_KEYTRPC_AGENT_BASE_URLTRPC_AGENT_MODEL_NAMEWECOM_BOT_IDWECOM_BOT_SECRETTELEGRAM_BOT_TOKEN
- Config directory:
~/.trpc_claw/ - Workspace:
~/.trpc_claw/workspace
After creating a WeCom bot, get BotID/BotSecret and configure:
channels:
wecom:
enabled: true
bot_id: ${WECOM_BOT_ID}
secret: ${WECOM_BOT_SECRET}
stream_reply: true
restart_command: /restartStart:
export TRPC_AGENT_API_KEY=xxx
export TRPC_AGENT_BASE_URL=xxx
export TRPC_AGENT_MODEL_NAME=xxx
export WECOM_BOT_ID=xxx
export WECOM_BOT_SECRET=xxx
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config_full.yamlReference: https://cloud.tencent.com/developer/article/2626214
channels:
telegram:
enabled: true
token: ${TELEGRAM_BOT_TOKEN}Start:
export TELEGRAM_BOT_TOKEN=xxx
trpc_agent_cmd openclaw run -c ~/.trpc_claw/config_full.yamlstorage:
type: redis # file | redis | sql
redis:
url: redis://127.0.0.1:6379
is_async: false
password: ""
db: 0
kwargs: {}storage:
type: sql
sql:
url: sqlite:///./session_memory.db
is_async: false
kwargs: {}Notes:
type=file: short-term sessions are persisted by default toworkspace/sessions/*.jsonltype=redis/sql: short-term sessions and memory can use shared backends
memory:
memory_service_config:
enabled: true
ttl:
enable: true
ttl_seconds: 86400
cleanup_interval_seconds: 3600
update_time: 0.0agent:
provider: auto
max_tokens: 8192
context_window_tokens: 65536
temperature: 0.1
max_tool_iterations: 40
reasoning_effort: null # low | medium | high
extra_headers: {}tools:
mcp_servers:
fs:
type: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
env: {}
tool_timeout: 30
enabled_tools: ["*"]tools:
web:
search:
provider: brave # brave | tavily | duckduckgo | searxng | jina
api_key: ""
base_url: ""
max_results: 5logger:
name: trpc_claw
log_file: trpc_claw.log
log_level: INFO
log_format: "[%(asctime)s][%(levelname)s][%(name)s][%(pathname)s:%(lineno)d][%(process)d] %(message)s"personal:
soul_file: /path/to/SOUL.md
user_file: /path/to/USER.md
tool_file: /path/to/TOOLS.md
agent_file: /path/to/AGENTS.mdtrpc_agent_sdk/server/openclaw/_cli.py: OpenClaw CLI commandstrpc_agent_sdk/server/openclaw/claw.py: runtime orchestration coretrpc_agent_sdk/server/openclaw/config/: config models and loading logictrpc_agent_sdk/server/openclaw/channels/: channel adapters (Telegram / WeCom)trpc_agent_sdk/server/openclaw/tools/: tool implementationstrpc_agent_sdk/server/openclaw/skill/: skill system (loading, parsing, dependency inspection)trpc_agent_sdk/server/openclaw/service/: Cron / Heartbeat services

