From 759f4cfe254bb58de6abd12622289bab475fd154 Mon Sep 17 00:00:00 2001 From: Sunwood-ai-labs Date: Thu, 12 Feb 2026 00:44:10 +0900 Subject: [PATCH] refactor(docker): consolidate compose files and move config to config/ directory - Deleted docker-compose.discord.yml and merged into docker-compose.yml - Moved config.example.json to config/ - Updated volume mounts to use ./config/config.json - Updated verify script permissions (implied if valid) --- README.ja.md | 77 ++++++++----------- README.md | 15 ++-- .../config.example.json | 0 docker-compose.discord.yml | 24 ------ docker-compose.yml | 23 +++++- 5 files changed, 56 insertions(+), 83 deletions(-) rename config.example.json => config/config.example.json (100%) delete mode 100644 docker-compose.discord.yml diff --git a/README.ja.md b/README.ja.md index 027dc67..d24ce37 100644 --- a/README.ja.md +++ b/README.ja.md @@ -129,18 +129,17 @@ git clone https://github.com/Sunwood-AI-OSS-Hub/picoclaw.git cd picoclaw # 2. API キーを設定 -cp .env.example .env -vim .env # DISCORD_BOT_TOKEN, OPENROUTER_API_KEY などを設定 -vim config/config.json # プロバイダーの API キーを設定 +cp config.example.json config/config.json +vim config/config.json # DISCORD_BOT_TOKEN, プロバイダーの API キーを設定 # 3. ビルドと起動 -docker compose -f docker-compose.discord.yml up -d +docker compose --profile gateway up -d # 4. ログ確認 -docker compose -f docker-compose.discord.yml logs -f picoclaw +docker compose logs -f picoclaw-gateway # 5. 停止 -docker compose -f docker-compose.discord.yml down +docker compose --profile gateway down ``` ### Agent モード(ワンショット) @@ -156,8 +155,8 @@ docker compose run --rm picoclaw-agent ### リビルド ```bash -docker compose -f docker-compose.discord.yml build --no-cache -docker compose -f docker-compose.discord.yml up -d +docker compose --profile gateway build --no-cache +docker compose --profile gateway up -d ``` ### 🚀 クイックスタート(ネイティブ) @@ -306,53 +305,37 @@ picoclaw gateway -## ⚙️ 設定 +## 設定 (Configuration) -設定ファイル: `~/.picoclaw/config.json` +PicoClaw は設定に `config.json` を使用します。 -### プロバイダー +1. **設定ファイルの作成:** -> [!NOTE] -> Groq は Whisper 経由の無料音声文字起こしを提供します。設定すると、Telegram の音声メッセージが自動的に文字起こしされます。 + サンプル設定ファイルをコピーします: -| プロバイダー | 用途 | API キー取得先 | -|-------------|------|---------------| -| `gemini` | LLM (Gemini 直接) | [aistudio.google.com](https://aistudio.google.com) | -| `zhipu` | LLM (Zhipu 直接) | [bigmodel.cn](bigmodel.cn) | -| `openrouter(テスト中)` | LLM(推奨、全モデルアクセス) | [openrouter.ai](https://openrouter.ai) | -| `anthropic(テスト中)` | LLM (Claude 直接) | [console.anthropic.com](https://console.anthropic.com) | -| `openai(テスト中)` | LLM (GPT 直接) | [platform.openai.com](https://platform.openai.com) | -| `deepseek(テスト中)` | LLM (DeepSeek 直接) | [platform.deepseek.com](https://platform.deepseek.com) | -| `groq` | LLM + **音声文字起こし** (Whisper) | [console.groq.com](https://console.groq.com) | + ```bash + cp config.example.json config/config.json + ``` +2. **設定の編集:** -
-Zhipu + `config/config.json` を開き、APIキーや設定を記述します。 -**1. API キーとベース URL を取得** -- [API キー](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) を取得 - -**2. 設定** - -```json -{ - "agents": { - "defaults": { - "workspace": "~/.picoclaw/workspace", - "model": "glm-4.7", - "max_tokens": 8192, - "temperature": 0.7, - "max_tool_iterations": 20 + ```json + { + "providers": { + "openrouter": { + "api_key": "sk-or-v1-..." + } + }, + "channels": { + "discord": { + "enabled": true, + "token": "YOUR_DISCORD_BOT_TOKEN" + } + } } - }, - "providers": { - "zhipu": { - "api_key": "Your API Key", - "api_base": "https://open.bigmodel.cn/api/paas/v4" - }, - }, -} -``` + ``` **3. 実行** diff --git a/README.md b/README.md index 4b4652b..b0a008d 100644 --- a/README.md +++ b/README.md @@ -132,18 +132,17 @@ git clone https://github.com/Sunwood-AI-OSS-Hub/picoclaw.git cd picoclaw # 2. Set your API keys -cp .env.example .env -vim .env # Set DISCORD_BOT_TOKEN, OPENROUTER_API_KEY, etc. -vim config/config.json # Set provider API keys +cp config.example.json config/config.json +vim config/config.json # Set DISCORD_BOT_TOKEN, API keys, etc. # 3. Build & Start -docker compose -f docker-compose.discord.yml up -d +docker compose --profile gateway up -d # 4. Check logs -docker compose -f docker-compose.discord.yml logs -f picoclaw +docker compose logs -f picoclaw-gateway # 5. Stop -docker compose -f docker-compose.discord.yml down +docker compose --profile gateway down ``` ### Agent Mode (One-shot) @@ -159,8 +158,8 @@ docker compose run --rm picoclaw-agent ### Rebuild ```bash -docker compose -f docker-compose.discord.yml build --no-cache -docker compose -f docker-compose.discord.yml up -d +docker compose --profile gateway build --no-cache +docker compose --profile gateway up -d ``` ### 🚀 Quick Start diff --git a/config.example.json b/config/config.example.json similarity index 100% rename from config.example.json rename to config/config.example.json diff --git a/docker-compose.discord.yml b/docker-compose.discord.yml deleted file mode 100644 index d9a44ec..0000000 --- a/docker-compose.discord.yml +++ /dev/null @@ -1,24 +0,0 @@ -services: - # ───────────────────────────────────────────── - # PicoClaw Discord Bot - # ───────────────────────────────────────────── - picoclaw: - build: - context: . - dockerfile: Dockerfile - container_name: picoclaw-discord - restart: unless-stopped - env_file: - - .env - environment: - - PICOCLAW_CHANNELS_DISCORD_ENABLED=true - - PICOCLAW_CHANNELS_DISCORD_TOKEN=${DISCORD_BOT_TOKEN} - volumes: - # Configuration file - - ./config/config.json:/root/.picoclaw/config.json:ro - # Persistent workspace (sessions, memory, logs) - - picoclaw-workspace:/root/.picoclaw/workspace - command: ["gateway"] - -volumes: - picoclaw-workspace: diff --git a/docker-compose.yml b/docker-compose.yml index 4412e37..4876962 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,4 @@ services: - - # ───────────────────────────────────────────── # PicoClaw Agent (one-shot query) # docker compose run --rm picoclaw-agent -m "Hello" @@ -12,8 +10,6 @@ services: container_name: picoclaw-agent profiles: - agent - env_file: - - .env volumes: - ./config/config.json:/root/.picoclaw/config.json:ro - picoclaw-workspace:/root/.picoclaw/workspace @@ -21,5 +17,24 @@ services: stdin_open: true tty: true + # ───────────────────────────────────────────── + # PicoClaw Gateway (Long-running Bot) + # docker compose up picoclaw-gateway + # ───────────────────────────────────────────── + picoclaw-gateway: + build: + context: . + dockerfile: Dockerfile + container_name: picoclaw-gateway + restart: unless-stopped + profiles: + - gateway + volumes: + # Configuration file + - ./config/config.json:/root/.picoclaw/config.json:ro + # Persistent workspace (sessions, memory, logs) + - picoclaw-workspace:/root/.picoclaw/workspace + command: ["gateway"] + volumes: picoclaw-workspace: