{"id":51129968,"url":"https://github.com/osisdie/openclaw-wsl2","last_synced_at":"2026-06-25T11:01:32.958Z","repository":{"id":343378787,"uuid":"1145986270","full_name":"osisdie/openclaw-wsl2","owner":"osisdie","description":"Personal OpenClaw (MoltBot) AI agent gateway config for WSL2 — Telegram channel, OpenRouter LLM, foreground execution with lifecycle notifications","archived":false,"fork":false,"pushed_at":"2026-03-27T06:38:36.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T18:42:07.660Z","etag":null,"topics":["ai-agent","backblaze-b2","bash","gemini","huggingface","openclaw","python","telegram-bot","wsl2","youtube-to-pdf"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osisdie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-30T13:26:05.000Z","updated_at":"2026-03-27T06:38:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/osisdie/openclaw-wsl2","commit_stats":null,"previous_names":["osisdie/openclaw-wsl2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/osisdie/openclaw-wsl2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osisdie%2Fopenclaw-wsl2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osisdie%2Fopenclaw-wsl2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osisdie%2Fopenclaw-wsl2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osisdie%2Fopenclaw-wsl2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osisdie","download_url":"https://codeload.github.com/osisdie/openclaw-wsl2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osisdie%2Fopenclaw-wsl2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34771664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","backblaze-b2","bash","gemini","huggingface","openclaw","python","telegram-bot","wsl2","youtube-to-pdf"],"created_at":"2026-06-25T11:01:30.819Z","updated_at":"2026-06-25T11:01:32.944Z","avatar_url":"https://github.com/osisdie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MoltBot (OpenClaw) — Personal AI Agent Setup\n\n\u003e WSL2 (Ubuntu) + Telegram + Gemini/OpenRouter, foreground execution mode\n\n## Quick Start\n\n```bash\n# 1. Install\nnpm install -g pnpm\npnpm add -g openclaw@latest\nopenclaw --version\n\n# 2. Onboarding (choose Manual, skip model setup)\nopenclaw onboard\n\n# 3. Set model (choose one)\n# Option A: Gemini API key (recommended — vision + tools + free tier)\n#   Get a key at https://aistudio.google.com/apikey\n#   Add GEMINI_API_KEY=AIza... to .env\nopenclaw models set \"google/gemini-2.5-flash\"\nopenclaw models set-image \"google/gemini-2.5-flash\"\n\n# Option B: OpenRouter free models (no API cost)\nopenclaw models set \"openrouter/openai/gpt-oss-120b:free\"\n\n# 4. Start (foreground mode)\nbash scripts/start.sh\n```\n\n## Token Security\n\n### All secrets in `.env`, never in config\n\n```bash\n# .env (gitignored, never committed)\nTELEGRAM_BOT_TOKEN=\"your-telegram-bot-token\"\nOPENROUTER_API_KEY=\"sk-or-v1-your-openrouter-key\"\nSLACK_WEBHOOK_URL=\"https://hooks.slack.com/services/...\"\n\nGEMINI_API_KEY=\"AIza...\"          # Primary model auth (google provider)\nHF_TOKEN=\"hf_...\"                 # HuggingFace Inference API (Whisper transcription)\nB2_KEY_ID=\"...\"                   # Backblaze B2 (youtube-to-pdf uploads)\nB2_APP_KEY=\"...\"\n```\n\nopenclaw automatically reads `TELEGRAM_BOT_TOKEN` and `OPENROUTER_API_KEY` from environment variables — **no need to put them in `openclaw.json`**.\n\n### Add Telegram Channel\n\n```bash\n# Interactive setup (will prompt for token)\nopenclaw channels add\n\n# Verify token source is env var\nopenclaw channels list\n# Should show: Telegram default: configured, token=env, enabled\n```\n\n### Pairing (Authorize Users)\n\nDM policy should be set to `pairing` to ensure only you can operate the bot:\n\n1. Find your bot on Telegram (e.g. `@iNewsyBot`), send `hello`\n2. Bot replies with a pairing code\n3. Approve in terminal:\n   ```bash\n   openclaw pairing approve telegram \u003cpairing-code\u003e\n   ```\n4. Success when you see `Approved telegram sender \u003cyour-id\u003e`\n\n### Restart Gateway to Apply Changes\n\n```bash\n# If gateway is running in foreground: Ctrl+C to stop, then restart\nbash scripts/start.sh\n\n# If running as systemd daemon:\nopenclaw gateway stop\nbash scripts/start.sh\n```\n\n## Model Tiers\n\nMoltBot uses a tiered model strategy:\n\n| Role | Model | Capabilities | Cost |\n|------|-------|-------------|------|\n| Primary | `google/gemini-2.5-flash` | text + vision + tools, 1024k context | Free tier / very low |\n| Fallback 1 | `openrouter/google/gemma-3-27b-it:free` | text + vision, 128k context | Free |\n| Fallback 2 | `openrouter/meta-llama/llama-3.3-70b-instruct:free` | text + tools, 128k context | Free |\n\n### Switching Models\n\n```bash\n# Change primary model\nopenclaw models set \"google/gemini-2.5-flash\"\n\n# Change image model\nopenclaw models set-image \"google/gemini-2.5-flash\"\n\n# Manage fallbacks\nopenclaw models fallbacks add \"openrouter/model-name\"\nopenclaw models fallbacks clear\n\n# Scan for new free models with tool support\nopenclaw models scan\n```\n\n## Vision (Image Understanding)\n\nSend a photo to the Telegram bot with a question and it will analyze the image. Supports:\n- Image description and analysis\n- OCR (text extraction from screenshots/photos)\n- Visual reasoning (charts, diagrams, UI screenshots)\n\nRequires a vision-capable primary model (e.g. `gemini-2.5-flash`).\n\n## Thinking Level\n\nPer-command thinking level for agent reasoning. Options: `off`, `minimal`, `low`, `medium`, `high`.\n\n```bash\n# Via CLI\nopenclaw agent --thinking medium --message \"Analyze this data\"\n\n# Default is 'low' when using Gemini 2.5 Flash via Telegram\n```\n\n## OpenRouter Privacy Settings\n\n\u003e **Important**: Free models require all of the following OpenRouter privacy settings to be enabled\n\nGo to https://openrouter.ai/settings/privacy and verify:\n\n| # | Setting | Free models | Paid models |\n|---|---------|-------------|-------------|\n| 1 | Enable paid endpoints that may train on inputs | ✅ Enabled | ❌ Disabled |\n| 2 | Enable free endpoints that may train on inputs | ✅ Enabled | ❌ Disabled |\n| 3 | Enable free endpoints that may publish prompts | ✅ Enabled | ❌ Disabled |\n\n⚠️ **When using paid models (or Gemini direct), disable #1–#3 to protect privacy.**\n\n## Gateway Lifecycle\n\nUses **foreground execution** (not daemon) to ensure the operator is always aware of bot activity:\n\n```bash\n# Start (auto-sends Slack webhook notification + runs gateway in foreground)\nbash scripts/start_gateway.sh          # default port 18889\nbash scripts/start_gateway.sh 19000    # custom port\n\n# Stop\nbash scripts/stop_gateway.sh           # graceful stop (finds process automatically)\n\n# Status\nbash scripts/status_gateway.sh         # process, channels, models, auth overview\n\n# Legacy (still works)\nbash scripts/start.sh\n```\n\n## Common Commands\n\n```bash\nopenclaw doctor              # Health check\nopenclaw status              # Channel and session status\nopenclaw channels list       # List configured channels\nopenclaw channels status     # Channel connection status (requires running gateway)\nopenclaw models status       # Model and auth status\nbash scripts/test-gemini-api.sh    # Verify Gemini API key\nopenclaw cron list           # Scheduled background tasks\n```\n\n## Gemini API Test\n\nVerify Gemini API key connectivity (minimal token usage):\n\n```bash\nbash scripts/test-gemini-api.sh                    # Default: gemini-2.5-flash\nbash scripts/test-gemini-api.sh gemini-2.0-flash   # Test specific model\n```\n\n## Custom Skills\n\n### YouTube to PDF (`/youtube_to_pdf`)\n\nConverts a YouTube video into a bilingual summary PDF and uploads to Backblaze B2.\n\n```\n/youtube_to_pdf https://www.youtube.com/watch?v=... --lang zh-tw\n/youtube_to_pdf https://youtu.be/abc123 --lang en\n```\n\nPipeline: subtitles (yt-dlp + Whisper fallback) → summaries (HuggingFace) → HTML → PDF (headless Chrome) → B2 upload. Skill files live in `skills/youtube-to-pdf/`, symlinked from `~/.openclaw/skills/`.\n\n### Claude Code (`/claude_code`)\n\nTelegram command that invokes Claude Code CLI with a **5 calls/hour** rate limit.\n\n```\n/claude_code Explain what this function does: ...\n/claude_code Review this code for security issues\n```\n\nSkill files live in `~/.openclaw/skills/claude-code/`. See [docs/skills/claude_code.md](docs/skills/claude_code.md) for details.\n\n## File Structure\n\n```\nai-moltbot/\n├── .env                     # Secrets: tokens, API keys (gitignored)\n├── .env.example             # Secret template (committed)\n├── scripts/\n│   ├── start_gateway.sh     # Start gateway (foreground, API key preflight)\n│   ├── stop_gateway.sh      # Stop gateway (handles WSL2/no-systemd)\n│   ├── status_gateway.sh    # Gateway status overview\n│   ├── clear_session.sh     # Clear agent session history (telegram/discord/all)\n│   ├── start.sh             # Legacy wrapper → start_gateway.sh\n│   └── test-gemini-api.sh   # Gemini API connectivity test\n├── skills/\n│   └── youtube-to-pdf/      # YouTube → PDF pipeline (symlinked to ~/.openclaw/skills/)\n│       ├── SKILL.md         # Skill definition\n│       ├── youtube-to-pdf.sh\n│       ├── youtube_utils.py\n│       ├── process_video.py\n│       ├── summaries_to_html.py\n│       ├── html_to_pdf.py\n│       └── requirements.txt\n├── openclaw/\n│   ├── openclaw.example.json         # Config template (OpenRouter free models)\n│   └── openclaw.gemini.example.json  # Config template (Gemini direct + free fallbacks)\n├── docs/\n│   ├── SDD.md               # Software design document\n│   ├── SKILL.md             # Skills reference and management guide\n│   ├── SOD_zh-tw.md         # Enhancement plan (zh-TW)\n│   ├── channels/\n│   │   ├── telegram.md      # Telegram setup and pairing guide\n│   │   └── discord.md       # Discord setup and pairing guide\n│   └── skills/\n│       ├── claude_code.md   # Claude Code skill overview\n│       └── claude_code/     # Skill source files (SKILL.md, wrapper, state)\n├── CLAUDE.md                # AI assistant guidelines\n└── README.md                # This file\n```\n\n## Channel Setup\n\n- **Telegram**: See [docs/channels/telegram.md](docs/channels/telegram.md) — bot creation, token setup, pairing\n- **Discord**: See [docs/channels/discord.md](docs/channels/discord.md) — bot creation, intents, pairing\n\n## Security Notes\n\n- Bot can access local system resources — **every new permission grant is a risk escalation**\n- DM policy must be `pairing`, never use `open`\n- Regularly review granted tool permissions\n- `.env` is in `.gitignore`, never commit secrets\n- Gemini uses API key auth (`GEMINI_API_KEY`) — no OAuth, no token expiry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosisdie%2Fopenclaw-wsl2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosisdie%2Fopenclaw-wsl2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosisdie%2Fopenclaw-wsl2/lists"}