PolyClaw Trading was designed Windows-first. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/deniszidbaev-cmyk/polyclaw-trading/llms.txt
Use this file to discover all available pages before exploring further.
scripts/bootstrap_polyclaw_kilo.bat script automates the full startup sequence — dependency validation, secret configuration, OpenClaw config patching, Polygon RPC validation, and multi-window service launch — in a single command. Companion PowerShell and CMD launchers let you start individual services independently, and the secret configuration helpers write .env.local without ever echoing a value to the screen.
Prerequisites
Before running the bootstrap, ensure the following are available on your system. Install any missing tools via WinGet or Scoop:- Python 3.12+ —
winget install Python.Python.3.12 - Node.js and npm — required for the Kilo CLI
uv— installed automatically by the bootstrap if missinggit—winget install Git.Git
The Full Bootstrap Flow
scripts/bootstrap_polyclaw_kilo.bat performs ten numbered steps. It validates each step before proceeding and exits with a non-zero code at the first failure, so you always know exactly where a setup issue occurred.
Validate project files
The script checks that all required project files are present in the repository root before doing anything else. Missing files produce an explicit error message naming the missing file.
Ensure runtime directories
Creates
runtime/, runtime/logs/, and runtime/executions/ if they do not already exist.Check Node.js, npm, Python, git, and uv
Each tool is checked with
where. If uv is not found, the script installs it automatically via pip:Install OpenClaw if missing
If
openclaw is not found on PATH, the script installs it via the official PowerShell installer. If ~/.openclaw/openclaw.json does not exist, the script checks for a bundled config and explains what to do if neither is present.Locate or clone PolyClaw
The script searches for Then runs
polyclaw.py in %OPENCLAW_HOME%\skills\polyclaw, %USERPROFILE%\polyclaw, and a bundled polyclaw/ directory inside the repository. If none is found it clones the repository:uv sync inside the cloned directory.Configure .env.local
If
.env.local does not exist, the script prompts for secrets using PowerShell’s Read-Host -AsSecureString so that private keys are never visible. The following values are collected interactively:POLYMARKET_WALLET_ADDRESSCHAINSTACK_NODEHTTPS_PROXY(optional)BANK_USD,MAX_TRADE_RISK_PCT,MAX_DAILY_RISK_PCT,MAX_TRADES_PER_DAYSIGNAL_INTERVAL_SEC,MARKET_QUERYPOLYCLAW_PRIVATE_KEY(masked)OPENROUTER_API_KEY(masked)
normalize_env_local.py is run to clean whitespace and validate the format.Patch OpenClaw config and validate RPC
openclaw_patch.py writes a timestamped backup of ~/.openclaw/openclaw.json before applying any change. Then rpc_probe.py validates the Polygon RPC endpoint — if this fails, the script exits with a warning rather than starting services that would silently fail.Prompt for wallet approval if LIVE_TRADING=1
If
LIVE_TRADING=1 is set in .env.local, the script prompts you to type APPROVE to run polyclaw wallet approve. Pressing Enter skips this step. No approval prompt appears in dry-run mode.Launch all services
Four windows open in sequence:
- OpenClaw Gateway —
launch_openclaw_gateway.cmd(12-second startup delay before next window) - OpenClaw TUI —
launch_openclaw_tui.cmd - Kilo Worker —
launch_kilo_worker.cmdwith modelopenai/gpt-5.1-codex-mini - Kilo Interface —
launch_kilo_interface.cmdwith the same model
candles_adapter.py, signal_engine.py, trade_gate.py, and market_reports.py on a SIGNAL_INTERVAL_SEC (default 300) cycle.Individual Launcher Scripts
Each service can be started independently. Scripts are available in both CMD and shell (.sh) variants:
| Script | Purpose |
|---|---|
launch_openclaw_gateway.cmd / .sh | Starts the OpenClaw gateway (required before TUI) |
launch_openclaw_tui.cmd / .sh | Starts the OpenClaw TUI; reads token only from .env.local |
launch_kilo_worker.cmd / .sh | Starts the Kilo worker with an isolated runtime profile |
launch_kilo_interface.cmd / .sh | Starts the Kilo interactive shell |
setup_local_qwen.cmd / .ps1 | Installs Ollama (via WinGet if available) and pulls qwen2.5:14b-instruct for local MemoryChewer roles |
launch_openclaw_tui.* reads the OpenClaw token exclusively from .env.local. It does not scrape ~/.openclaw/openclaw.json or any other JSON config. This ensures the token is never written to a shell history file.launch_kilo_worker.sh stores the isolated Kilo profile under runtime/kilo-worker-* by default, so it does not disturb the primary ~/.local/share/kilo profile.Running the Pipeline Directly
For scripted or CI-style runs,scripts/run_pipeline.py is the Windows-first entry point to the deterministic pipeline:
Secret Configuration Helpers
Thescripts/ directory contains interactive helpers that write .env.local without echoing secret values. Each script uses Read-Host -AsSecureString or equivalent techniques to keep keys out of terminal output and shell history:
Always use the secret configuration scripts to populate
.env.local rather than editing the file directly in a terminal. The scripts zero out in-memory secrets immediately after writing. Never commit .env.local to git — it is listed in .gitignore, and tests/test_secret_scanner.py fails the build if secret-like patterns appear in any tracked file.| Script | Purpose |
|---|---|
configure_all_secrets_env.py | Configures all secrets in one interactive session |
configure_openclaw_gateway_env.py | Configures OpenClaw gateway credentials |
configure_telegram_env.py | Configures Telegram bot token and chat ID |
configure_llm_endpoints_env.py | Configures LLM API keys and endpoint URLs |
Portable Bundle
scripts/create_portable_bundle.ps1 packages a self-contained ZIP of the workspace for VPS deployment: