Compare commits

..
11 Commits
Author SHA1 Message Date
loveuer b8b11d452f feat: store PicoClaw memory in SQLite
Store session history, preferences, and dated records in one database per home.
Commit complete turns, checkpoint tool batches, and compact history by prefix.
Add memory search and writes, with previews for ambiguous corrections.
Review conversations in the background and support SQLite backup and restore.
2026-11-25 11:36:10 +08:00
loveuer cd4a95934a feat: bundle office skills with a Docker runtime
Add DOCX, XLSX and PPTX skills with upstream scripts and licenses.
Provide a version-locked Docker environment, diagnostics and smoke tests.
Install embedded skills by name while preserving existing workspace content.
Validate all Go tests and office workflows on home-dev; document setup.
2026-11-17 16:00:25 +08:00
loveuer 31624a2a50 docs: align guides with the slimmed fork
Refresh setup, Docker, release, and contribution guidance.
Fix channel settings examples and credential documentation.
Remove Antigravity tutorials and redirect outdated translations.
Align platform, model routing, and troubleshooting instructions.
2026-11-17 16:00:25 +08:00
loveuer 30acf96b0b fix: align status and project docs with the fork
Show only OpenAI and Anthropic provider and login status.
Remove nine obsolete upstream README translations.
Redirect documentation links to the maintained root README.
Update status regression coverage and documentation guidance.
2026-11-16 11:29:53 +08:00
loveuer b11c2c31ad refactor: remove built-in serial hardware support
Remove serial tools and platform implementations.
Drop tool registration, defaults, and example settings.
Ignore legacy tools.serial settings and remove them on save.
Update documentation and config compatibility tests.
2026-11-13 10:17:09 +08:00
loveuer a8804df0ed refactor: keep only OpenAI and Anthropic model protocols
Retain OpenAI Responses and Chat Completions with streaming and fallback.
Use native Anthropic Messages with tools, thinking and streaming support.
Remove other model providers and SDKs while preserving speech services.
Update configuration and docs; verify all Go tests, vet, lint and Linux build.
2026-11-12 19:32:56 +08:00
loveuer 3029f22e01 refactor: remove unused hardware tools and device monitoring
Remove I2C/SPI tools, USB monitoring and the bundled hardware skill.
Keep serial support and ignore obsolete hardware config fields on load.
Update examples, migration coverage and builtin skill enumeration.
Validate related tests, documentation, Linux amd64 build and changed-code lint.
2026-11-12 17:27:44 +08:00
loveuer cd09fdf071 ci: simplify fork builds and release publishing
Consolidate checks into CI and publish Linux amd64 releases manually.
Remove scheduled nightlies, registry/TOS uploads and GoReleaser packaging.
Keep stable/nightly archives and SHA256 manifests compatible with self-update.
Document publishing; validate workflows, tests and archive compatibility.
2026-11-12 16:44:43 +08:00
loveuer 9fe249f639 fix: keep self-updates on the fork release source
Default stable and nightly updates to loveuer/picoclaw without fallback.
Add explicit repository selection and a read-only release check.
Validate targets and checksums while preserving installed binary names.
Cover source routing and replacement failures with isolated tests.
2026-11-12 16:44:43 +08:00
loveuer c1ce9fda5f fix: use typing reaction for Feishu messages
Replace the default Pin reaction with Typing (敲键盘).
Keep configured random reaction emojis taking precedence.
Update Feishu channel documentation across translations.
Validated with channel tests, docs lint and a live home-dev check.
2026-11-12 10:22:32 +08:00
loveuer 97506cd4f8 docs: rewrite README for the trimmed fork
Replace upstream marketing and release history with a Chinese usage guide.
Document retained channels, source builds, model setup and fresh sessions.
Explain removed-channel configuration cleanup during upgrades.
Point the former Chinese README to the root guide to avoid duplication.
2026-11-12 10:07:53 +08:00
557 changed files with 83161 additions and 43836 deletions

No files matched your search

-31
View File
@@ -1,31 +0,0 @@
name: build
on:
push:
branches: [ "main" ]
jobs:
integration:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Run Docker-backed integration suites
run: bash ./scripts/run-integration-tests.sh
build:
needs: integration
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build core binaries
run: make build-all
+76
View File
@@ -0,0 +1,76 @@
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
name: Test and build Linux amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Generate embedded resources
run: go generate ./...
- name: Check documentation
run: make lint-docs
- name: Vet
run: go vet -tags stdjson ./...
- name: Test
run: go test -tags stdjson ./...
- name: Build Linux amd64
run: make build GOOS=linux GOARCH=amd64
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: go generate ./...
- uses: golangci/golangci-lint-action@v9
with:
version: v2.10.1
args: --build-tags=stdjson
vulnerability:
name: Vulnerability check
runs-on: ubuntu-latest
env:
GOFLAGS: -tags=stdjson
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
- run: govulncheck -C . -format text ./...
integration:
name: Docker integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- run: bash ./scripts/run-integration-tests.sh
-60
View File
@@ -1,60 +0,0 @@
name: Create Tag
on:
workflow_dispatch:
inputs:
tag:
description: "Tag name (required, e.g. v0.2.0)"
required: true
type: string
commit:
description: "Target commit SHA (leave empty for latest main)"
required: false
type: string
default: ""
jobs:
create-tag:
name: Create Git Tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: main
- name: Validate commit exists
if: ${{ inputs.commit != '' }}
shell: bash
run: |
if ! git cat-file -t "${{ inputs.commit }}" &>/dev/null; then
echo "::error::Commit '${{ inputs.commit }}' does not exist."
exit 1
fi
- name: Check tag does not already exist
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh api "repos/${{ github.repository }}/git/ref/tags/${{ inputs.tag }}" --silent 2>/dev/null; then
echo "::error::Tag '${{ inputs.tag }}' already exists."
exit 1
fi
- name: Create and push tag
shell: bash
run: |
TARGET="${{ inputs.commit || 'HEAD' }}"
COMMIT_SHA=$(git rev-parse "$TARGET")
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ inputs.tag }}" "$COMMIT_SHA" -m "Release ${{ inputs.tag }}"
git push origin "${{ inputs.tag }}"
echo "### Tag Created" >> "$GITHUB_STEP_SUMMARY"
echo "- **Tag:** \`${{ inputs.tag }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- **Commit:** \`${COMMIT_SHA}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- **Branch:** \`$(git branch -r --contains "$COMMIT_SHA" | head -1 | xargs)\`" >> "$GITHUB_STEP_SUMMARY"
-76
View File
@@ -1,76 +0,0 @@
name: 🐳 Build & Push Docker Image
on:
workflow_call:
inputs:
tag:
description: "Release tag"
required: true
type: string
env:
GHCR_REGISTRY: ghcr.io
GHCR_IMAGE_NAME: ${{ github.repository_owner }}/picoclaw
DOCKERHUB_REGISTRY: docker.io
DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_REPOSITORY }}
jobs:
build:
name: 🏗️ Build Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# ── Checkout ──────────────────────────────
- name: 📥 Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ inputs.tag }}
# ── Docker Buildx ─────────────────────────
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v4
# ── Login to GHCR ─────────────────────────
- name: 🔑 Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# ── Login to Docker Hub ────────────────────
- name: 🔑 Login to Docker Hub
uses: docker/login-action@v4
with:
registry: ${{ env.DOCKERHUB_REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# ── Metadata (tags & labels) ──────────────
- name: 🏷️ Prepare image tags
id: tags
shell: bash
run: |
tag="${{ inputs.tag }}"
echo "ghcr_tag=${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}:${tag}" >> "$GITHUB_OUTPUT"
echo "ghcr_latest=${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}:latest" >> "$GITHUB_OUTPUT"
echo "dockerhub_tag=${{ env.DOCKERHUB_REGISTRY }}/${{ env.DOCKERHUB_IMAGE_NAME }}:${tag}" >> "$GITHUB_OUTPUT"
echo "dockerhub_latest=${{ env.DOCKERHUB_REGISTRY }}/${{ env.DOCKERHUB_IMAGE_NAME }}:latest" >> "$GITHUB_OUTPUT"
# ── Build & Push ──────────────────────────
- name: 🚀 Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
${{ steps.tags.outputs.ghcr_tag }}
${{ steps.tags.outputs.ghcr_latest }}
${{ steps.tags.outputs.dockerhub_tag }}
${{ steps.tags.outputs.dockerhub_latest }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64,linux/riscv64
-129
View File
@@ -1,129 +0,0 @@
name: Nightly Build
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
nightly:
name: Nightly Build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Compute version
id: version
run: |
DATE=$(date -u +%Y%m%d)
SHA=$(git rev-parse --short=8 HEAD)
BASE_VERSION=$(git describe --tags --match "v*" --exclude "*nightly*" --abbrev=0 2>/dev/null || true)
if [ -z "$BASE_VERSION" ] || [ "$BASE_VERSION" = "v0.0.0" ]; then
VERSION="v0.0.0-nightly.${DATE}.${SHA}"
else
VERSION="${BASE_VERSION}-nightly.${DATE}.${SHA}"
fi
COMPARE_URL="https://github.com/${{ github.repository }}/commits/main"
if [ -n "$BASE_VERSION" ] && [ "$BASE_VERSION" != "v0.0.0" ]; then
COMPARE_URL="https://github.com/${{ github.repository }}/compare/${BASE_VERSION}...main"
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "changelog=**Full Changelog**: $COMPARE_URL" >> "$GITHUB_OUTPUT"
- name: Setup Go from go.mod
id: setup-go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create local tag for GoReleaser
run: git tag "${{ steps.version.outputs.version }}"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: ~> v2
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_REPOSITORY }}
GOVERSION: ${{ steps.setup-go.outputs.go-version }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.version }}
NIGHTLY_BUILD: "true"
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
- name: Update nightly release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: |
CHANGELOG='${{ steps.version.outputs.changelog }}'
NOTES=$(cat <<EOF
Nightly build for **${VERSION}**
This is an automated build and may be unstable. Use with caution.
${CHANGELOG}
EOF
)
# Delete existing nightly release and tag
gh release delete nightly --cleanup-tag -y 2>/dev/null || true
# Force-update nightly tag to current HEAD
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -fa nightly -m "Nightly build ${VERSION}"
git push origin nightly
# Collect release artifacts from goreleaser dist/
ASSETS=()
for f in dist/*.tar.gz dist/*.zip dist/*.deb dist/*.rpm dist/checksums.txt; do
[ -f "$f" ] && ASSETS+=("$f")
done
# Create nightly release (prerelease, NOT latest)
gh release create nightly \
--title "Nightly Build" \
--notes "$NOTES" \
--target "${{ github.sha }}" \
--prerelease \
--latest=false \
"${ASSETS[@]}"
-76
View File
@@ -1,76 +0,0 @@
name: PR
on:
pull_request: { }
jobs:
lint:
name: Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run go generate
run: go generate ./...
- name: Golangci Lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.10.1
args: --build-tags=stdjson
vuln_check:
name: Security Check
runs-on: ubuntu-latest
env:
GOFLAGS: -tags=stdjson
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
- name: Run Govulncheck
run: govulncheck -C . -format text ./...
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run go generate
run: go generate ./...
- name: Run go test
run: go test -tags stdjson ./...
integration:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Run Docker-backed integration suites
run: bash ./scripts/run-integration-tests.sh
+84 -87
View File
@@ -3,107 +3,104 @@ name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Existing tag to release (e.g. v0.2.0)"
channel:
description: Release channel (manual publication only)
required: true
type: choice
options:
- stable
- nightly
default: stable
tag:
description: Existing tag for a stable release (leave empty for nightly)
required: false
type: string
prerelease:
description: "Mark as pre-release"
required: false
type: boolean
default: false
draft:
description: "Create as draft"
required: false
type: boolean
default: false
upload_tos:
description: "Upload to Volcengine TOS"
required: false
type: boolean
default: true
permissions:
contents: read
concurrency:
group: release-${{ inputs.channel }}
cancel-in-progress: false
jobs:
release:
name: GoReleaser Release
name: Publish Linux amd64 release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Verify tag exists
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! gh api "repos/${{ github.repository }}/git/ref/tags/${{ inputs.tag }}" --silent 2>/dev/null; then
echo "::error::Tag '${{ inputs.tag }}' does not exist. Create it first using the 'Create Tag' workflow."
exit 1
fi
- name: Checkout tag
uses: actions/checkout@v7
- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Setup Go from go.mod
id: setup-go
uses: actions/setup-go@v6
persist-credentials: false
- name: Select source and version
id: source
env:
RELEASE_CHANNEL: ${{ inputs.channel }}
RELEASE_TAG: ${{ inputs.tag }}
run: |
set -euo pipefail
case "$RELEASE_CHANNEL" in
stable)
if [[ -z "$RELEASE_TAG" || "$RELEASE_TAG" == nightly ]]; then
echo '::error::Stable publication requires an existing tag other than nightly.'
exit 1
fi
git check-ref-format "refs/tags/$RELEASE_TAG"
target=$(git rev-parse --verify "refs/tags/$RELEASE_TAG^{commit}")
git checkout --detach "$target"
version="$RELEASE_TAG"
;;
nightly)
if [[ -n "$RELEASE_TAG" ]]; then
echo '::error::Nightly publishes the selected workflow ref; leave tag empty.'
exit 1
fi
target=$(git rev-parse HEAD)
version="nightly-$(date -u +%Y%m%d)-$(git rev-parse --short=8 HEAD)"
;;
*) echo '::error::Unknown release channel.'; exit 1 ;;
esac
# Versions enter linker flags and step outputs; accept only plain version characters.
if [[ ! "$version" =~ ^[a-zA-Z0-9][a-zA-Z0-9._+-]*$ ]]; then
echo '::error::Unsupported version format.'
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "target=$target" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: ~> v2
args: release --clean
- name: Test source
run: |
go generate ./...
make lint-docs
go test -tags stdjson ./...
- name: Package binary and SHA256 manifest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_REPOSITORY }}
GOVERSION: ${{ steps.setup-go.outputs.go-version }}
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
- name: Apply release flags
shell: bash
RELEASE_VERSION: ${{ steps.source.outputs.version }}
run: bash scripts/package-release.sh "$RELEASE_VERSION"
- name: Publish GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
RELEASE_CHANNEL: ${{ inputs.channel }}
RELEASE_TAG: ${{ inputs.tag }}
RELEASE_VERSION: ${{ steps.source.outputs.version }}
RELEASE_TARGET: ${{ steps.source.outputs.target }}
run: |
gh release edit "${{ inputs.tag }}" \
--draft=${{ inputs.draft }} \
--prerelease=${{ inputs.prerelease }}
upload-tos:
name: Upload to TOS
needs: release
if: ${{ inputs.upload_tos }}
uses: ./.github/workflows/upload-tos.yml
with:
tag: ${{ inputs.tag }}
secrets: inherit
set -euo pipefail
assets=(dist/picoclaw_Linux_x86_64.tar.gz dist/checksums.txt)
if [[ "$RELEASE_CHANNEL" == stable ]]; then
gh release create "$RELEASE_TAG" --verify-tag --title "$RELEASE_TAG" \
--generate-notes --latest=true "${assets[@]}"
else
# Replace nightly only after the new source has passed tests and packaging.
if gh release view nightly --json tagName >/dev/null 2>&1; then
gh release delete nightly --cleanup-tag --yes
fi
gh release create nightly --target "$RELEASE_TARGET" \
--title "Nightly $RELEASE_VERSION" --notes "Build $RELEASE_VERSION ($RELEASE_TARGET)." \
--prerelease --latest=false "${assets[@]}"
fi
-49
View File
@@ -1,49 +0,0 @@
name: Upload to Volcengine TOS
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag to download and upload (e.g. v0.2.0)"
required: true
type: string
workflow_call:
inputs:
tag:
description: "Release tag to download and upload"
required: true
type: string
jobs:
upload-tos:
name: Upload to Volcengine TOS
runs-on: ubuntu-latest
steps:
- name: Download release assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p artifacts
gh release download "${{ inputs.tag }}" \
--repo "${{ github.repository }}" \
--dir artifacts \
--pattern "*.tar.gz" \
--pattern "*.zip" \
--pattern "*.rpm" \
--pattern "*.deb"
- name: Upload to Volcengine TOS
env:
AWS_ACCESS_KEY_ID: ${{ secrets.VOLC_TOS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.VOLC_TOS_SECRET_KEY }}
AWS_DEFAULT_REGION: cn-beijing
run: |
aws configure set default.s3.addressing_style virtual
TOS_ENDPOINT="https://tos-s3-cn-beijing.volces.com"
# Upload to versioned directory
aws s3 sync artifacts/ "s3://picoclaw-downloads/${{ inputs.tag }}/" \
--endpoint-url "$TOS_ENDPOINT"
# Upload to latest (overwrite)
aws s3 sync artifacts/ "s3://picoclaw-downloads/latest/" \
--endpoint-url "$TOS_ENDPOINT" \
--delete
+1 -1
View File
@@ -49,7 +49,7 @@ docs/superpowers/
.vscode/
.idea/
# Added by goreleaser init:
# Release archives
dist/
# Windows Application Icon/Resource
-143
View File
@@ -1,143 +0,0 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
git:
ignore_tags:
- nightly
- ".*-nightly.*"
before:
hooks:
- go generate ./...
builds:
- id: picoclaw
env:
- CGO_ENABLED=0
tags:
- stdjson
ldflags:
- -s -w
- -X github.com/sipeed/picoclaw/pkg/config.Version={{ .Version }}
- -X github.com/sipeed/picoclaw/pkg/config.GitCommit={{ .ShortCommit }}
- -X github.com/sipeed/picoclaw/pkg/config.BuildTime={{ .Date }}
- -X github.com/sipeed/picoclaw/pkg/config.GoVersion={{ with index .Env "GOVERSION" }}{{ . }}{{ else }}unknown{{ end }}
goos:
- linux
- windows
- darwin
- freebsd
- netbsd
goarch:
- amd64
- arm64
- riscv64
- loong64
- arm
- s390x
- mipsle
goarm:
- "6"
- "7"
gomips:
- softfloat
main: ./cmd/picoclaw
ignore:
- goos: windows
goarch: arm
- goos: netbsd
goarch: s390x
- goos: netbsd
goarch: mips64
- goos: netbsd
goarch: arm
dockers_v2:
- id: picoclaw
dockerfile: docker/Dockerfile.goreleaser
extra_files:
- docker/entrypoint.sh
ids:
- picoclaw
images:
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/picoclaw"
- 'docker.io/{{ .Env.DOCKERHUB_IMAGE_NAME }}'
tags:
- '{{ if isEnvSet "NIGHTLY_BUILD" }}nightly{{ else }}{{ .Tag }}{{ end }}'
- '{{ if isEnvSet "NIGHTLY_BUILD" }}nightly{{ else }}latest{{ end }}'
platforms:
- linux/amd64
- linux/arm64
- linux/riscv64
notarize:
macos:
- enabled: '{{ isEnvSet "MACOS_SIGN_P12" }}'
ids:
- picoclaw
sign:
certificate: "{{.Env.MACOS_SIGN_P12}}"
password: "{{.Env.MACOS_SIGN_PASSWORD}}"
notarize:
issuer_id: "{{.Env.MACOS_NOTARY_ISSUER_ID}}"
key_id: "{{.Env.MACOS_NOTARY_KEY_ID}}"
key: "{{.Env.MACOS_NOTARY_KEY}}"
wait: true
timeout: 20m
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
nfpms:
- id: picoclaw
ids:
- picoclaw
package_name: picoclaw
file_name_template: >-
{{ .PackageName }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "arm64" }}aarch64
{{- else if eq .Arch "arm" }}armv{{ .Arm }}
{{- else }}{{ .Arch }}{{ end }}
vendor: picoclaw
homepage: https://github.com/{{ .Env.GITHUB_REPOSITORY_OWNER }}/picoclaw
maintainer: picoclaw contributors
description: picoclaw - a tool for managing and running tasks
license: MIT
formats:
- rpm
- deb
bindir: /usr/bin
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
# upx:
# - enabled: true
# compress: best
# lzma: true
release:
disable: '{{ isEnvSet "NIGHTLY_BUILD" }}'
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
+27 -287
View File
@@ -1,308 +1,48 @@
# Contributing to PicoClaw
# Contributing to this fork
Thank you for your interest in contributing to PicoClaw! This project is a community-driven effort to build the lightweight and versatile personal AI assistant. We welcome contributions of all kinds: bug fixes, features, documentation, translations, and testing.
This repository is [loveuer/picoclaw](https://github.com/loveuer/picoclaw), a smaller fork of [sipeed/picoclaw](https://github.com/sipeed/picoclaw). Its supported features and release process differ from upstream. Start with the [README](README.md) and [configuration example](config/config.example.json).
PicoClaw itself was substantially developed with AI assistance — we embrace this approach and have built our contribution process around it.
## Scope
## Table of Contents
Keep the CLI, Gateway, supported message channels, OpenAI and Anthropic protocols, tools, MCP, and Skills maintainable. Prefer optional Skills or external tools for specialized integrations such as office files and hardware. Discuss substantial changes before adding dependencies or reintroducing removed features.
- [Code of Conduct](#code-of-conduct)
- [Ways to Contribute](#ways-to-contribute)
- [Getting Started](#getting-started)
- [Development Setup](#development-setup)
- [Making Changes](#making-changes)
- [AI-Assisted Contributions](#ai-assisted-contributions)
- [Pull Request Process](#pull-request-process)
- [Branch Strategy](#branch-strategy)
- [Code Review](#code-review)
- [Communication](#communication)
The current channels are Weixin, WeCom, Feishu, DingTalk, QQ, OneBot, Telegram, and MQTT. Native Gemini, Azure, Bedrock, vendor presets, CLI model proxies, WebUI, and built-in hardware tools have been removed. Compatible model endpoints use an explicit `openai` or `anthropic` provider and `api_base`.
---
## Development
## Code of Conduct
We are committed to maintaining a welcoming and respectful community. Be kind, constructive, and assume good faith. Harassment or discrimination of any kind will not be tolerated.
---
## Ways to Contribute
- **Bug reports** — Open an issue using the bug report template.
- **Feature requests** — Open an issue using the feature request template; discuss before implementing.
- **Code** — Fix bugs or implement features. See the workflow below.
- **Documentation** — Improve READMEs, docs, inline comments, or translations.
- **Testing** — Run PicoClaw on new hardware, channels, or LLM providers and report your results.
For substantial new features, please open an issue first to discuss the design before writing code. This prevents wasted effort and ensures alignment with the project's direction.
For documentation contributions, prefer the layout and naming conventions in [`docs/README.md`](docs/README.md). Run `make lint-docs` after adding or moving Markdown files to catch common consistency issues early.
---
## Getting Started
1. **Fork** the repository on GitHub.
2. **Clone** your fork locally:
```bash
git clone https://github.com/<your-username>/picoclaw.git
cd picoclaw
```
3. Add the upstream remote:
```bash
git remote add upstream https://github.com/sipeed/picoclaw.git
```
---
## Development Setup
### Prerequisites
- Go 1.25 or later
- `make`
### Build
Install Git, Make, and a Go toolchain satisfying [go.mod](go.mod), currently Go 1.25.13 or later. Clone this fork, or your fork of it:
```bash
make build # Build binary (runs go generate first)
make generate # Run go generate only
make check # Full pre-commit check: deps + fmt + vet + test + docs consistency checks
git clone https://github.com/loveuer/picoclaw.git
cd picoclaw
make build
./build/picoclaw version
```
### Running Tests
`make build` generates embedded resources, uses `stdjson`, and disables CGO by default. Keep the Go module path `github.com/sipeed/picoclaw`; it remains the internal import path.
Before submitting changes, run the checks relevant to the change:
```bash
make test # Run all tests
make integration-test # Run Docker-backed integration suites
go test -run TestName -v ./pkg/session/ # Run a single test
go test -bench=. -benchmem -run='^$' ./... # Run benchmarks
go generate ./...
go test -tags stdjson ./...
go vet -tags stdjson ./...
make lint-docs
make lint
```
Docker-backed integration suites are auto-discovered from [`integration/suites/`](integration/suites/). See [`integration/README.md`](integration/README.md) for the suite layout and the conventions used by CI.
CI also runs vulnerability checks and Docker integration suites. For integration setup and suite selection, see [integration/README.md](integration/README.md).
### Code Style
Keep changes focused. Describe the problem, resulting behavior, and validation in the PR. Never include credentials, personal configuration, or user workspace data. Preserve third-party license and attribution files, including those bundled with the Office Skills.
```bash
make fmt # Format code
make vet # Static analysis
make lint # Full linter run
make lint-docs # Check common documentation layout and naming conventions
```
## Configuration and documentation
All CI checks must pass before a PR can be merged. Run `make check` locally before pushing to catch issues early, including the common docs consistency checks from `make lint-docs`.
When removing a feature, clean up its registration, configuration, tests, dependencies, examples, and documentation. Consider existing user configurations so upgrades do not unexpectedly fail. Channels use `channel_list` with channel-specific values under `settings`; `.security.yml` may override values from the main JSON file.
---
Maintain the root README as the project overview. Do not restore duplicate upstream README translations. Keep specialized guides beside their translations and update links when moving or deleting documents. See [docs/README.md](docs/README.md).
## Making Changes
## Releases
### Branching
CI builds Linux amd64. Releases are published manually through the `Release` workflow, using an existing stable tag or replacing the `nightly` prerelease. Assets are a Linux amd64 archive and `checksums.txt`; there are no scheduled nightly builds, Docker registry uploads, or deb/rpm packages. See the [README release instructions](README.md#检查与发布).
Always branch off `main` and target `main` in your PR. Never push directly to `main` or any `release/*` branch:
```bash
git checkout main
git pull upstream main
git checkout -b your-feature-branch
```
Use descriptive branch names, e.g. `fix/telegram-timeout`, `feat/ollama-provider`, `docs/contributing-guide`.
### Commits
- Write clear, concise commit messages in English.
- Use the imperative mood: "Add retry logic" not "Added retry logic".
- Reference the related issue when relevant: `Fix session leak (#123)`.
- Keep commits focused. One logical change per commit is preferred.
- For minor cleanups or typo fixes, squash them into a single commit before opening a PR.
- Refer to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
### Keeping Up to Date
Rebase your branch onto upstream `main` before opening a PR:
```bash
git fetch upstream
git rebase upstream/main
```
---
## AI-Assisted Contributions
PicoClaw was built with substantial AI assistance, and we fully embrace AI-assisted development. However, contributors must understand their responsibilities when using AI tools.
### Disclosure Is Required
Every PR must disclose AI involvement using the PR template's **🤖 AI Code Generation** section. There are three levels:
| Level | Description |
|---|---|
| 🤖 Fully AI-generated | AI wrote the code; contributor reviewed and validated it |
| 🛠️ Mostly AI-generated | AI produced the draft; contributor made significant modifications |
| 👨‍💻 Mostly Human-written | Contributor led; AI provided suggestions or none at all |
Honest disclosure is expected. There is no stigma attached to any level — what matters is the quality of the contribution.
### You Are Responsible for What You Submit
Using AI to generate code does not reduce your responsibility as the contributor. Before opening a PR with AI-generated code, you must:
- **Read and understand** every line of the generated code.
- **Test it** in a real environment (see the Test Environment section of the PR template).
- **Check for security issues** — AI models can generate subtly insecure code (e.g., path traversal, injection, credential exposure). Review carefully.
- **Verify correctness** — AI-generated logic can be plausible-sounding but wrong. Validate the behavior, not just the syntax.
PRs where it is clear the contributor has not read or tested the AI-generated code will be closed without review.
### AI-Generated Code Quality Standards
AI-generated contributions are held to the **same quality bar** as human-written code:
- It must pass all CI checks (`make check`).
- It must be idiomatic Go and consistent with the existing codebase style.
- It must not introduce unnecessary abstractions, dead code, or over-engineering.
- It must include or update tests where appropriate.
### Security Review
AI-generated code requires extra security scrutiny. Pay special attention to:
- File path handling and sandbox escapes (see commit `244eb0b` for a real example)
- External input validation in channel handlers and tool implementations
- Credential or secret handling
- Command execution (`exec.Command`, shell invocations)
If you are unsure whether a piece of AI-generated code is safe, say so in the PR — reviewers will help.
---
## Pull Request Process
### Before Opening a PR
- [ ] Run `make check` and ensure it passes locally.
- [ ] Fill in the PR template completely, including the AI disclosure section.
- [ ] Link any related issue(s) in the PR description.
- [ ] Keep the PR focused. Avoid bundling unrelated changes together.
### PR Template Sections
The PR template asks for:
- **Description** — What does this change do and why?
- **Type of Change** — Bug fix, feature, docs, or refactor.
- **AI Code Generation** — Disclosure of AI involvement (required).
- **Related Issue** — Link to the issue this addresses.
- **Technical Context** — Reference URLs and reasoning (skip for pure docs PRs).
- **Test Environment** — Hardware, OS, model/provider, and channels used for testing.
- **Evidence** — Optional logs or screenshots demonstrating the change works.
- **Checklist** — Self-review confirmation.
### PR Size
Prefer small, reviewable PRs. A PR that changes 200 lines across 5 files is much easier to review than one that changes 2000 lines across 30 files. If your feature is large, consider splitting it into a series of smaller, logically complete PRs.
---
## Branch Strategy
### Long-Lived Branches
- **`main`** — the active development branch. All feature PRs target `main`. The branch is protected: direct pushes are not permitted, and at least one maintainer approval is required before merging.
- **`release/x.y`** — stable release branches, cut from `main` when a version is ready to ship. These branches are more strictly protected than `main`.
### Requirements to Merge into `main`
A PR can only be merged when all of the following are satisfied:
1. **CI passes** — All GitHub Actions workflows (lint, test, build) must be green.
2. **Reviewer approval** — At least one maintainer has approved the PR.
3. **No unresolved review comments** — All review threads must be resolved.
4. **PR template is complete** — Including AI disclosure and test environment.
### Who Can Merge
Only maintainers can merge PRs. Contributors cannot merge their own PRs, even if they have write access.
### Merge Strategy
We use **squash merge** for most PRs to keep the `main` history clean and readable. Each merged PR becomes a single commit referencing the PR number, e.g.:
```
feat: Add Ollama provider support (#491)
```
If a PR consists of multiple independent, well-separated commits that tell a clear story, a regular merge may be used at the maintainer's discretion.
### Release Branches
When a version is ready, maintainers cut a `release/x.y` branch from `main`. After that point:
- **New features are not backported.** The release branch receives no new functionality after it is cut.
- **Security fixes and critical bug fixes are cherry-picked.** If a fix in `main` qualifies (security vulnerability, data loss, crash), maintainers will cherry-pick the relevant commit(s) onto the affected `release/x.y` branch and issue a patch release.
If you believe a fix in `main` should be backported to a release branch, note it in the PR description or open a separate issue. The decision rests with the maintainers.
Release branches have stricter protections than `main` and are never directly pushed to under any circumstances.
---
## Code Review
### For Contributors
- Respond to review comments within a reasonable time. If you need more time, say so.
- When you update a PR in response to feedback, briefly note what changed (e.g., "Updated to use `sync.RWMutex` as suggested").
- If you disagree with feedback, engage respectfully. Explain your reasoning; reviewers can be wrong too.
- Do not force-push after a review has started — it makes it harder for reviewers to see what changed. Use additional commits instead; the maintainer will squash on merge.
### For Reviewers
Review for:
1. **Correctness** — Does the code do what it claims? Are there edge cases?
2. **Security** — Especially for AI-generated code, tool implementations, and channel handlers.
3. **Architecture** — Is the approach consistent with the existing design?
4. **Simplicity** — Is there a simpler solution? Does this add unnecessary complexity?
5. **Tests** — Are the changes covered by tests? Are existing tests still meaningful?
Be constructive and specific. "This could have a race condition if two goroutines call this concurrently — consider using a mutex here" is better than "this looks wrong".
### Reviewer List
Once your PR is submitted, you can reach out to the assigned reviewers listed in the following table.
|Function| Reviewer|
|--- |--- |
|Provider|@yinwm |
|Channel |@yinwm/@alexhoshina |
|Agent |@lxowalle/@Zhaoyikaiii|
|Tools |@lxowalle|
|SKill ||
|MCP ||
|Optimization|@lxowalle|
|Security||
|AI CI |@imguoguo|
|UX ||
|Document||
---
## Communication
- **GitHub Issues** — Bug reports, feature requests, design discussions.
- **GitHub Discussions** — General questions, ideas, community conversation.
- **Pull Request comments** — Code-specific feedback.
- **Wechat&Discord** — We will invite you when you have at least one merged PR
When in doubt, open an issue before writing code. It costs little and prevents wasted effort.
---
## A Note on the Project's AI-Driven Origin
PicoClaw's architecture was substantially designed and implemented with AI assistance, guided by human oversight. If you find something that looks odd or over-engineered, it may be an artifact of that process — opening an issue to discuss it is always welcome.
We believe AI-assisted development done responsibly produces great results. We also believe humans must remain accountable for what they ship. These two beliefs are not in conflict.
Thank you for contributing!
The updater defaults to this fork's GitHub Releases. Changing the default source or publication format requires reviewing updater compatibility.
+191 -477
View File
@@ -1,568 +1,282 @@
<div align="center">
<img src="assets/logo.webp" alt="PicoClaw" width="512">
# PicoClaw · 精简 fork
<h1>PicoClaw: Ultra-Efficient AI Assistant in Go</h1>
这是 [sipeed/picoclaw](https://github.com/sipeed/picoclaw) 的个人 fork,使用 Go 构建,通过命令行或 IM 运行 AI 助手。当前版本以 CLI、Gateway 和常用消息渠道为主,已移除网页管理界面与一批渠道及其依赖。
<h3>$10 Hardware · 10MB RAM · ms Boot · Let's Go, PicoClaw!</h3>
<p>
<img src="https://img.shields.io/badge/Go-1.25+-00ADD8?style=flat&logo=go&logoColor=white" alt="Go">
<img src="https://img.shields.io/badge/Arch-x86__64%2C%20ARM64%2C%20MIPS%2C%20RISC--V%2C%20LoongArch-blue" alt="Hardware">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
<br>
<a href="https://picoclaw.io"><img src="https://img.shields.io/badge/Website-picoclaw.io-blue?style=flat&logo=google-chrome&logoColor=white" alt="Website"></a>
<a href="https://docs.picoclaw.io/"><img src="https://img.shields.io/badge/Docs-Official-007acc?style=flat&logo=read-the-docs&logoColor=white" alt="Docs"></a>
<a href="https://deepwiki.com/sipeed/picoclaw"><img src="https://img.shields.io/badge/Wiki-DeepWiki-FFA500?style=flat&logo=wikipedia&logoColor=white" alt="Wiki"></a>
<br>
<a href="https://x.com/SipeedIO"><img src="https://img.shields.io/badge/X_(Twitter)-SipeedIO-black?style=flat&logo=x&logoColor=white" alt="Twitter"></a>
<a href="./assets/wechat.png"><img src="https://img.shields.io/badge/WeChat-Group-41d56b?style=flat&logo=wechat&logoColor=white"></a>
<a href="https://discord.gg/V4sAZ9XWpN"><img src="https://img.shields.io/badge/Discord-Community-4c60eb?style=flat&logo=discord&logoColor=white" alt="Discord"></a>
</p>
本仓库的功能、配置和构建产物与上游不同,使用时请以本仓库代码和说明为准。
[中文](docs/project/README.zh.md) | [日本語](docs/project/README.ja.md) | [한국어](docs/project/README.ko.md) | [Português](docs/project/README.pt-br.md) | [Tiếng Việt](docs/project/README.vi.md) | [Français](docs/project/README.fr.md) | [Italiano](docs/project/README.it.md) | [Bahasa Indonesia](docs/project/README.id.md) | [Malay](docs/project/README.ms.md) | **English**
## 当前功能
</div>
- **CLI 与 Gateway**:本地交互、单次提问,或通过消息渠道持续运行。
- **模型接入**:仅保留 OpenAI(Responses / Chat Completions)和 Anthropic Messages,支持兼容端点、多模型配置与切换。
- **SQLite 三层记忆**:按会话加载近期上下文,一个 `PICOCLAW_HOME` 共享偏好和永久记录;终端和通过渠道规则的飞书、微信私聊直接使用。
- **工具与扩展**:文件操作、命令执行、网页搜索与抓取、MCP、Skills 和定时任务。
- **办公文件**:内置 `docx`、`xlsx`、`pptx` Skills,通过独立 Docker 环境处理 Word、Excel 和 PowerPoint。
- **语音能力**:保留语音识别与合成,实际可用能力取决于模型、服务及渠道配置。
---
已移除 WebUI、launcher、桌面托盘及相关前端构建;网页搜索和网页抓取工具仍然保留。
> **PicoClaw** is an independent open-source project initiated by [Sipeed](https://sipeed.com), written entirely in **Go** from scratch — not a fork of OpenClaw, NanoBot, or any other project.
已移除内置 I²C、SPI、串口工具、USB 设备监控及 hardware Skill。硬件需求通过按需安装的 Skill 和外部工具接入。
**PicoClaw** is an ultra-lightweight personal AI assistant inspired by [NanoBot](https://github.com/HKUDS/nanobot). It was rebuilt from the ground up in **Go** through a "self-bootstrapping" process — the AI Agent itself drove the architecture migration and code optimization.
## 消息渠道
**Runs on $10 hardware with <10MB RAM** — that's 99% less memory than OpenClaw and 98% cheaper than a Mac mini!
目前支持 7 种 IM 渠道和 MQTT:
<table align="center">
<tr align="center">
<td align="center" valign="top">
<p align="center">
<img src="assets/picoclaw_mem.gif" width="360" height="240">
</p>
</td>
<td align="center" valign="top">
<p align="center">
<img src="assets/licheervnano.png" width="400" height="240">
</p>
</td>
</tr>
</table>
| 配置类型 | 渠道 | 接入方式与文档 |
| --- | --- | --- |
| `weixin` | 个人微信 | [iLink 接口、扫码登录](docs/channels/weixin/README.zh.md) |
| `wecom` | 企业微信 | [AI Bot WebSocket](docs/channels/wecom/README.zh.md) |
| `feishu` | 飞书 / Lark | [WebSocket 长连接](docs/channels/feishu/README.zh.md) |
| `dingtalk` | 钉钉 | [Stream 模式](docs/channels/dingtalk/README.zh.md) |
| `qq` | QQ 官方机器人 | [官方机器人接口](docs/channels/qq/README.zh.md) |
| `onebot` | OneBot v11 | [WebSocket,需外部 OneBot 实现](docs/channels/onebot/README.zh.md) |
| `telegram` | Telegram | [Bot 长轮询](docs/channels/telegram/README.zh.md) |
| `mqtt` | MQTT | [Broker 发布 / 订阅](docs/channels/mqtt/README.zh.md) |
> [!CAUTION]
> **Security Notice**
>
> * **NO CRYPTO:** PicoClaw has **not** issued any official tokens or cryptocurrency. All claims on `pump.fun` or other trading platforms are **scams**.
> * **OFFICIAL DOMAIN:** The **ONLY** official website is **[picoclaw.io](https://picoclaw.io)**, and company website is **[sipeed.com](https://sipeed.com)**
> * **BEWARE:** Many `.ai/.org/.com/.net/...` domains have been registered by third parties. Do not trust them.
> * **NOTE:** PicoClaw is in early rapid development. There may be unresolved security issues. Do not deploy to production before v1.0.
> * **NOTE:** PicoClaw has recently merged many PRs. Recent builds may use 10-20MB RAM. Resource optimization is planned after feature stabilization.
各渠道支持的消息类型、群聊触发方式和权限配置不同,请按对应文档配置。
## 📢 News
## 从源码构建
2026-05-11 🛒 **LicheeRV-Claw on AliExpress!** You can now purchase LicheeRV-Claw from [AliExpress](https://www.aliexpress.com/item/1005006519668532.html), making it easier to try PicoClaw on compact RISC-V hardware.
<p align="center">
<a href="https://www.aliexpress.com/item/1005006519668532.html">
<img src="assets/licheerv-claw.jpg" alt="LicheeRV-Claw on AliExpress" width="520">
</a>
</p>
2026-05-14 🚀 **v0.2.8 Released!** MCP CLI commands (`show`, `add`, `list`, `remove`, `test`, `edit`), empty object instead of null for MCP tool parameters, and build fixes.
2026-05-07 🚀 **v0.2.7 Released!** Configurable Sogou-backed web search, channel tool feedback animation, linter fixes.
2026-04-23 🚀 **v0.2.6 Released!** Hooks with respond action and comprehensive documentation, isolation support, help banner fix.
2026-04-11 🚀 **v0.2.5 Released!** Zoneinfo from TZ/ZONEINFO env, Matrix CommonMark rendering alignment, `read_file` by lines.
2026-03-25 🚀 **v0.2.4 Released!** Agent architecture overhaul (SubTurn, Hooks, Steering, EventBus), WeChat/WeCom integration, security hardening (.security.yml, sensitive data filtering), new providers (AWS Bedrock, Azure, Xiaomi MiMo), and 35 bug fixes. PicoClaw has reached **26K Stars**!
2026-03-17 🚀 **v0.2.3 Released!** System tray UI (Windows & Linux), sub-agent status query (`spawn_status`), experimental Gateway hot-reload, Cron security gating, and 2 security fixes. PicoClaw has reached **25K Stars**!
2026-03-09 🎉 **v0.2.1 — Biggest update yet!** MCP protocol support, 4 new channels (Matrix/IRC/WeCom/Discord Proxy), 3 new providers (Kimi/Minimax/Avian), vision pipeline, JSONL memory store, model routing.
<details>
<summary>Earlier news...</summary>
2026-02-26 🎉 PicoClaw hits **20K Stars** in just 17 days! Channel auto-orchestration and capability interfaces are live.
2026-02-16 🎉 PicoClaw breaks 12K Stars in one week! Community maintainer roles and [Roadmap](ROADMAP.md) officially launched.
2026-02-13 🎉 PicoClaw breaks 5000 Stars in 4 days! Project roadmap and developer groups in progress.
2026-02-09 🎉 **PicoClaw Released!** Built in 1 day to bring AI Agents to $10 hardware with <10MB RAM. Let's Go, PicoClaw!
</details>
## ✨ Features
🪶 **Ultra-lightweight**: Core memory footprint <10MB — 99% smaller than OpenClaw.*
💰 **Minimal cost**: Efficient enough to run on $10 hardware — 98% cheaper than a Mac mini.
⚡️ **Lightning-fast boot**: 400x faster startup. Boots in <1s even on a 0.6GHz single-core processor.
🌍 **Truly portable**: Single binary across RISC-V, ARM, MIPS, and x86 architectures. One binary, runs everywhere!
🤖 **AI-bootstrapped**: Pure Go native implementation — 95% of core code was generated by an Agent and fine-tuned through human-in-the-loop review.
🔌 **MCP support**: Native [Model Context Protocol](https://modelcontextprotocol.io/) integration — connect any MCP server to extend Agent capabilities.
👁️ **Vision pipeline**: Send images and files directly to the Agent — automatic base64 encoding for multimodal LLMs.
🧠 **Smart routing**: Rule-based model routing — simple queries go to lightweight models, saving API costs.
_*Recent builds may use 10-20MB due to rapid PR merges. Resource optimization is planned. Boot speed comparison based on 0.8GHz single-core benchmarks (see table below)._
<div align="center">
| | OpenClaw | NanoBot | **PicoClaw** |
| ------------------------------ | ------------- | ------------------------ | -------------------------------------- |
| **Language** | TypeScript | Python | **Go** |
| **RAM** | >1GB | >100MB | **< 10MB*** |
| **Boot time**</br>(0.8GHz core) | >500s | >30s | **<1s** |
| **Cost** | Mac Mini $599 | Most Linux boards ~$50 | **Any Linux board**</br>**from $10** |
<img src="assets/compare.jpg" alt="PicoClaw" width="512">
</div>
> **[Hardware Compatibility List](docs/guides/hardware-compatibility.md)** — See all tested boards, from $5 RISC-V to Raspberry Pi to Android phones. Your board not listed? Submit a PR!
<p align="center">
<img src="assets/hardware-banner.jpg" alt="PicoClaw Hardware Compatibility" width="100%">
</p>
## 🦾 Demonstration
### 🛠️ Standard Assistant Workflows
<table align="center">
<tr align="center">
<th><p align="center">Full-Stack Engineer Mode</p></th>
<th><p align="center">Logging & Planning</p></th>
<th><p align="center">Web Search & Learning</p></th>
</tr>
<tr>
<td align="center"><p align="center"><img src="assets/picoclaw_code.gif" width="240" height="180"></p></td>
<td align="center"><p align="center"><img src="assets/picoclaw_memory.gif" width="240" height="180"></p></td>
<td align="center"><p align="center"><img src="assets/picoclaw_search.gif" width="240" height="180"></p></td>
</tr>
<tr>
<td align="center">Develop · Deploy · Scale</td>
<td align="center">Schedule · Automate · Remember</td>
<td align="center">Discover · Insights · Trends</td>
</tr>
</table>
### 🐜 Innovative Low-Footprint Deployment
PicoClaw can be deployed on virtually any Linux device!
- $9.9 [LicheeRV-Nano](https://www.aliexpress.com/item/1005006519668532.html) E(Ethernet) or W(WiFi6) edition, for a minimal home assistant
- $30~50 [NanoKVM](https://www.aliexpress.com/item/1005007369816019.html), or $100 [NanoKVM-Pro](https://www.aliexpress.com/item/1005010048471263.html), for automated server operations
<https://private-user-images.githubusercontent.com/83055338/547056448-e7b031ff-d6f5-4468-bcca-5726b6fecb5c.mp4>
🌟 More Deployment Cases Await!
## 📦 Install
### Download from picoclaw.io (Recommended)
Visit **[picoclaw.io](https://picoclaw.io)** — the official website auto-detects your platform and provides one-click download. No need to manually pick an architecture.
### Download precompiled binary
Alternatively, download the binary for your platform from the [GitHub Releases](https://github.com/sipeed/picoclaw/releases) page.
### Build from source (for development)
Prerequisites:
- Go 1.25.13+
需要 Git、Make,以及满足 [go.mod](go.mod) 要求的 Go 工具链(当前为 Go 1.25.13)。
```bash
git clone https://github.com/sipeed/picoclaw.git
git clone https://github.com/loveuer/picoclaw.git
cd picoclaw
make deps
# Build the core binary for the current platform
make build
# Build core binaries for all Makefile-managed platforms
make build-all
# Build for Raspberry Pi Zero 2 W
# 32-bit: make build-linux-arm
# 64-bit: make build-linux-arm64
make build-pi-zero
# Build and install
make install
./build/picoclaw version
```
**Raspberry Pi Zero 2 W:** Use the binary that matches your OS: 32-bit Raspberry Pi OS -> `make build-linux-arm`; 64-bit -> `make build-linux-arm64`. Or run `make build-pi-zero` to build both.
`make build` 会生成内嵌资源,默认使用 `stdjson` 构建标签并关闭 CGO。当前平台的可执行文件入口为 `build/picoclaw`。
## 🚀 Quick Start Guide
### CLI
**1. Initialize**
交叉编译 Linux amd64:
```bash
picoclaw onboard
make build GOOS=linux GOARCH=amd64
# 产物:build/picoclaw-linux-amd64
```
This creates `~/.picoclaw/config.json` and the workspace directory.
如需使用 `picoclaw-beta` 名称,同时指定命令源码目录:
**2. Configure** (`~/.picoclaw/config.json`)
```bash
make build GOOS=linux GOARCH=amd64 \
BINARY_NAME=picoclaw-beta CMD_DIR=cmd/picoclaw
# 产物:build/picoclaw-beta-linux-amd64
```
## 检查与发布
GitHub 的 `CI` 工作流在推送 `main`、提交 PR 或手动触发时运行,保留测试、文档检查、vet、lint、漏洞检查、Docker 集成测试和 Linux amd64 构建。
`Release` 仅手动触发,发布到当前仓库的 GitHub Releases,使用内置 `GITHUB_TOKEN`。自动发布目标收敛为 Linux amd64,不再运行定时 nightly、多平台发布、Docker Hub / TOS 上传或 deb/rpm 打包;本地 Docker 环境和交叉编译命令仍可使用。
发布稳定版时,先提交包含发布脚本的代码,创建并推送版本标签,例如:
```bash
git tag v1.0.0
git push origin v1.0.0
```
然后在 GitHub Actions 中手动运行 `Release`,选择 `channel=stable`、`tag=v1.0.0`。工作流会检出该标签,测试并构建后创建稳定版 Release,设为 latest。标签必须指向包含新发布脚本的提交;已发布版本不覆盖。
发布测试版时,选择需要构建的分支或标签,设置 `channel=nightly`,将 `tag` 留空。测试和打包成功后会替换 `nightly` Release 及标签,标记为预发布,不影响 latest 稳定版。
两种发布均上传 `picoclaw_Linux_x86_64.tar.gz` 和 `checksums.txt`。压缩包内含 `picoclaw` 与 `LICENSE`,可供下面的自更新命令使用。也可在本地生成同样的发布包:
```bash
bash scripts/package-release.sh v1.0.0
# 产物位于 dist/,可通过第二个参数指定输出目录
```
## 自更新
`update` 默认从本 fork 的 `loveuer/picoclaw` GitHub Releases 获取更新,不会自动回退到上游。
```bash
# 检查稳定版发布产物和校验信息,不下载二进制、不替换文件
picoclaw update --check
# 应用稳定版;也可将命令名换成实际安装的 picoclaw-beta
picoclaw update
# 检查 / 应用本 fork 的 nightly Release
picoclaw update --nightly --check
picoclaw update --nightly
# 显式选择其他 fork 或固定版本
picoclaw update --repo owner/repo --check
picoclaw update --url https://github.com/loveuer/picoclaw/releases/tag/v1.0.0 --check
```
`--url` 支持 GitHub 仓库、Release 页面或 Releases API 地址,与 `--repo`、`--nightly` 互斥。不会把无效地址当成默认源。`--check` 检查产物可用性,不比较版本新旧;可配合 `--platform`、`--arch` 查询其他平台,实际自更新仅允许当前系统与架构。
发布更新时需要先在本 fork 创建稳定版 Release 或名为 `nightly` 的 Release,并上传对应平台的 `.tar.gz`、`.tgz`、`.tar` 或 `.zip` 包。例如 `picoclaw_Linux_x86_64.tar.gz`,内部包含 `picoclaw` 或 `picoclaw-beta`(Windows 对应 `.exe`)。需要 GitHub 提供的 SHA256 digest,或包含产物文件名与 SHA256 的 checksums 文件。单独的二进制下载链接目前不支持。
更新会校验下载文件并替换当前可执行文件,保留实际安装名称,需要对安装目录有写权限。沿用现有回滚机制保留旧 binary 为 `.old`;不会修改用户配置、自动重启服务或覆盖工作区 Skill。更新后按部署方式重启;需要刷新内置 Skill 时,再使用 `skills install-builtin`。
## 配置与运行
### 1. 初始化
```bash
./build/picoclaw onboard
```
默认使用以下路径,可通过 `PICOCLAW_HOME` 更改数据目录:
| 路径 | 用途 |
| --- | --- |
| `~/.picoclaw/config.json` | 模型、渠道、工具等配置 |
| `~/.picoclaw/.security.yml` | 密钥等敏感配置,加载时与主配置合并 |
| `~/.picoclaw/workspace/` | 工作区与助手上下文文件 |
### 2. 配置模型
编辑 `~/.picoclaw/config.json`。下面是仅使用 CLI 的最小配置示例,请替换模型 ID 和 API Key:
```json
{
"version": 3,
"agents": {
"defaults": {
"model_name": "gpt-5.4"
"model_name": "main"
}
},
"model_list": [
{
"model_name": "gpt-5.4",
"model_name": "main",
"provider": "openai",
"model": "gpt-5.4",
"api_keys": [
"sk-your-api-key"
]
"model": "your-model-id",
"api_keys": ["YOUR_API_KEY"]
}
]
}
```
> See `config/config.example.json` in the repo for a complete configuration template with all available options.
`model_name` 是本地别名,`agents.defaults.model_name` 用它选择默认模型;`provider` 指定提供商,`model` 是远端模型 ID。使用兼容接口时,仍选择 `provider: "openai"` 或 `"anthropic"`,并显式填写 `api_base` 和远端 `model`。其他厂商专用名称、原生 Gemini / Azure / Bedrock、Copilot、Antigravity 和 CLI 代理已移除;原有配置需要按协议调整。
**3. Chat**
已有 `.security.yml` 中的值可能覆盖主配置中的同名设置。修改密钥时请同时检查该文件。完整字段示例见 [config/config.example.json](config/config.example.json),提供商说明见[模型配置文档](docs/guides/providers.zh.md)。
### 3. 使用 CLI
```bash
# One-shot question
picoclaw agent -m "What is 2+2?"
# 单次提问
./build/picoclaw agent -m "帮我整理今天的待办"
# Interactive mode
picoclaw agent
# Start gateway for chat app integration
picoclaw gateway
# 交互模式
./build/picoclaw agent
```
<details>
<summary><b>Docker (alternative)</b></summary>
### 4. 启动 Gateway
按上面的渠道文档,在配置中启用并填写至少一个渠道。微信和企业微信也可通过 CLI 扫码配置:
```bash
# 1. Clone this repo
git clone https://github.com/sipeed/picoclaw.git
cd picoclaw
# 2. First run — auto-generates docker/data/config.json then exits
# (only triggers when both config.json and workspace/ are missing)
docker compose -f docker/docker-compose.yml --profile gateway up
# The container prints "First-run setup complete." and stops.
# 3. Set your API keys
vim docker/data/config.json
# 4. Start
docker compose -f docker/docker-compose.yml --profile gateway up -d
./build/picoclaw auth weixin
# 或
./build/picoclaw auth wecom
```
> **Docker / VM users:** The Gateway listens on `127.0.0.1` by default. For host access, set `PICOCLAW_GATEWAY_HOST=0.0.0.0` and publish the required ports in Compose.
配置完成后启动:
```bash
# Check logs
docker compose -f docker/docker-compose.yml logs -f
# Stop
docker compose -f docker/docker-compose.yml --profile gateway down
# Update
docker compose -f docker/docker-compose.yml pull
docker compose -f docker/docker-compose.yml --profile gateway up -d
./build/picoclaw gateway
```
</details>
Gateway 会连接已启用的渠道。可用 `./build/picoclaw status` 查看版本、配置路径、默认模型和 OpenAI / Anthropic 的密钥及登录状态;该命令不检查模型连通性或服务运行状态。其他命令见 `./build/picoclaw --help`。
<a id="-run-on-old-android-phones"></a>
### 📱 Android (Termux)
当前配置使用 `channel_list`:`enabled`、`type`、`allow_from` 等公共字段放在渠道条目中,Token、App ID、代理地址等渠道专有字段放在 `settings` 中。请以 [配置示例](config/config.example.json) 的结构为准。
1. Install [Termux](https://github.com/termux/termux-app) (download from [GitHub Releases](https://github.com/termux/termux-app/releases), or search in F-Droid / Google Play)
2. Run the following commands:
## 办公文件 Skills
默认内置 `docx`、`xlsx`、`pptx`,用于 Word、Excel 和 PowerPoint 文件的读取、创建和修改。依赖在独立 Docker 镜像中运行,宿主机只需要 Bash 和可访问的 Docker daemon,不必安装 Python、Node.js 或 LibreOffice。
新工作区通过 `onboard` 安装;已有工作区用以下命令添加,默认保留已有同名目录:
```bash
# Download the latest release
wget https://github.com/sipeed/picoclaw/releases/latest/download/picoclaw_Linux_arm64.tar.gz
tar xzf picoclaw_Linux_arm64.tar.gz
pkg install proot
termux-chroot ./picoclaw onboard # chroot provides a standard Linux filesystem layout
./build/picoclaw skills list-builtin
./build/picoclaw skills install-builtin docx xlsx pptx
```
<img src="assets/termux.jpg" alt="PicoClaw on Termux" width="512">
[Android Termux Guide](docs/guides/android-termux.md).
## 🔌 Providers (LLM)
PicoClaw supports 30+ LLM providers through the `model_list` configuration. Use the `protocol/model` format:
| Provider | Protocol | API Key | Notes |
|----------|----------|---------|-------|
| [OpenAI](https://platform.openai.com/api-keys) | `openai/` | Required | GPT-5.4, GPT-4o, o3, etc. |
| [Anthropic](https://console.anthropic.com/settings/keys) | `anthropic/` | Required | Claude Opus 4.6, Sonnet 4.6, etc. |
| [Google Gemini](https://aistudio.google.com/apikey) | `gemini/` | Required | Gemini 3 Flash, 2.5 Pro, etc. |
| [OpenRouter](https://openrouter.ai/keys) | `openrouter/` | Required | 200+ models, unified API |
| [Zhipu (GLM)](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys) | `zhipu/` | Required | GLM-4.7, GLM-5, etc. |
| [DeepSeek](https://platform.deepseek.com/api_keys) | `deepseek/` | Required | DeepSeek-V3, DeepSeek-R1 |
| [Volcengine](https://console.volcengine.com) | `volcengine/` | Required | Doubao, Ark models |
| [Qwen](https://dashscope.console.aliyun.com/apiKey) | `qwen/` | Required | Qwen3, Qwen-Max, etc. |
| [Groq](https://console.groq.com/keys) | `groq/` | Required | Fast inference (Llama, Mixtral) |
| [Moonshot (Kimi)](https://platform.moonshot.cn/console/api-keys) | `moonshot/` | Required | Kimi models |
| [Minimax](https://platform.minimaxi.com/user-center/basic-information/interface-key) | `minimax/` | Required | MiniMax models |
| [Mistral](https://console.mistral.ai/api-keys) | `mistral/` | Required | Mistral Large, Codestral |
| [NVIDIA NIM](https://build.nvidia.com/) | `nvidia/` | Required | NVIDIA hosted models |
| [Cerebras](https://cloud.cerebras.ai/) | `cerebras/` | Required | Fast inference |
| [NEAR AI Cloud](https://near.ai/) | `nearai/` | Required | TEE inference, OpenAI-compatible |
| [Novita AI](https://novita.ai/) | `novita/` | Required | Various open models |
| [Xiaomi MiMo](https://platform.xiaomimimo.com/) | `mimo/` | Required | MiMo models |
| [Ollama](https://ollama.com/) | `ollama/` | Not needed | Local models, self-hosted |
| [vLLM](https://docs.vllm.ai/) | `vllm/` | Not needed | Local deployment, OpenAI-compatible |
| [LiteLLM](https://docs.litellm.ai/) | `litellm/` | Varies | Proxy for 100+ providers |
| [Azure OpenAI](https://portal.azure.com/) | `azure/` | API key or Entra ID** | Enterprise Azure deployment |
| [GitHub Copilot](https://github.com/features/copilot) | `github-copilot/` | OAuth | Device code login |
| [Antigravity](https://console.cloud.google.com/) | `antigravity/` | OAuth | Google Cloud AI |
| [AWS Bedrock](https://console.aws.amazon.com/bedrock)* | `bedrock/` | AWS credentials | Claude, Llama, Mistral on AWS |
> \* AWS Bedrock requires build tag: `go build -tags bedrock`. Set `api_base` to a region name (e.g., `us-east-1`) for automatic endpoint resolution across all AWS partitions (aws, aws-cn, aws-us-gov). When using a full endpoint URL instead, you must also configure `AWS_REGION` via environment variable or AWS config/profile.
>
> \*\* Azure OpenAI uses `api_key` when set. If `api_key` is omitted, the provider falls back to Microsoft Entra ID via `DefaultAzureCredential` (env vars, workload identity, managed identity, Azure CLI, etc.). The Entra ID path requires build tag: `go build -tags azidentity`.
<details>
<summary><b>Local deployment (Ollama, vLLM, etc.)</b></summary>
**Ollama:**
```json
{
"model_list": [
{
"model_name": "local-llama",
"model": "ollama/llama3.1:8b",
"api_base": "http://localhost:11434/v1"
}
]
}
```
**vLLM:**
```json
{
"model_list": [
{
"model_name": "local-vllm",
"model": "vllm/your-model",
"api_base": "http://localhost:8000/v1"
}
]
}
```
For full provider configuration details, see [Providers & Models](docs/guides/providers.md).
</details>
## 💬 Channels (Chat Apps)
Talk to your PicoClaw through 19+ messaging platforms:
| Channel | Setup | Protocol | Docs |
|---------|-------|----------|------|
| **Telegram** | Easy (bot token) | Long polling | [Guide](docs/channels/telegram/README.md) |
| **Weixin** | Easy (Native QR scan) | iLink API | [Guide](docs/guides/chat-apps.md#weixin) |
| **QQ** | Easy (AppID + AppSecret) | WebSocket | [Guide](docs/channels/qq/README.md) |
| **DingTalk** | Medium (client credentials) | Stream | [Guide](docs/channels/dingtalk/README.md) |
| **Feishu / Lark** | Medium (App ID + Secret) | WebSocket/SDK | [Guide](docs/channels/feishu/README.md) |
| **WeCom** | Easy (QR login or manual) | WebSocket | [Guide](docs/channels/wecom/README.md) |
| **OneBot** | Medium (WebSocket URL) | OneBot v11 | [Guide](docs/channels/onebot/README.md) |
| **MQTT** | Easy (broker + agent_id) | MQTT pub/sub | [Guide](docs/channels/mqtt/README.md) |
> All webhook-based channels share a single Gateway HTTP server (`gateway.host`:`gateway.port`, default `127.0.0.1:18790`). Feishu uses WebSocket/SDK mode and does not use the shared HTTP server.
> Log verbosity is controlled by `gateway.log_level` (default: `warn`). Supported values: `debug`, `info`, `warn`, `error`, `fatal`. Can also be set via `PICOCLAW_LOG_LEVEL`. See [Configuration](docs/guides/configuration.md#gateway-log-level) for details.
For detailed channel setup instructions, see [Chat Apps Configuration](docs/guides/chat-apps.md).
## 🔧 Tools
### 🔍 Web Search
PicoClaw can search the web to provide up-to-date information. Configure in `tools.web`:
| Search Engine | API Key | Free Tier | Link |
|--------------|---------|-----------|------|
| DuckDuckGo | Not needed | Unlimited | Built-in fallback |
| [Gemini Google Search](https://aistudio.google.com/apikey) | Required | Varies | Gemini with Google Search grounding |
| [Baidu Search](https://cloud.baidu.com/doc/qianfan-api/s/Wmbq4z7e5) | Required | 1500/month (daily allocation) | AI-powered, China-optimized |
| [Tavily](https://tavily.com) | Required | 1000 queries/month | Optimized for AI Agents |
| [Brave Search](https://brave.com/search/api) | Required | 2000 queries/month | Fast and private |
| [Kagi Search](https://help.kagi.com/kagi/api/search.html) | Required | Paid/limited by API setup | Premium search results |
| [Perplexity](https://www.perplexity.ai) | Required | Paid | AI-powered search |
| [SearXNG](https://github.com/searxng/searxng) | Not needed | Self-hosted | Free metasearch engine |
| [GLM Search](https://open.bigmodel.cn/) | Required | Varies | Zhipu web search |
### ⚙️ Other Tools
PicoClaw includes built-in tools for file operations, code execution, scheduling, and more. See [Tools Configuration](docs/reference/tools_configuration.md) for details.
## 🎯 Skills
Skills are modular capabilities that extend your Agent. They are loaded from `SKILL.md` files in your workspace.
**Install skills from ClawHub:**
在运行 Gateway 的同一个用户下准备环境(工作区自定义时替换路径):
```bash
picoclaw skills search "web scraping"
picoclaw skills install <skill-name>
bash ~/.picoclaw/workspace/tools/office/office.sh setup
bash ~/.picoclaw/workspace/tools/office/office.sh check
```
**Configure skill registries**:
首次构建需要网络和磁盘空间;重复执行会复用 Docker 构建缓存。镜像包含中文字体及公式重算、文档转换工具。普通文档任务不会自动安装或升级环境。
Add to your `config.json`:
```json
{
"tools": {
"skills": {
"registries": {
"clawhub": {
"auth_token": "your-clawhub-token"
},
"github": {
"base_url": "https://github.com",
"auth_token": "your-github-token",
"proxy": ""
}
}
}
}
}
```
之后可在 IM 中提出“根据这些数据生成 Excel,并计算合计”“把这份 Word 修改为正式报告”“根据提纲制作 PowerPoint”等请求。输入文件需要位于工作区;只挂载当前工作区,产物也保存在工作区中。这里操作的是办公文件,飞书在线文档和在线表格需要另外接入 API。
`tools.skills.github.*` is deprecated. Use `tools.skills.registries.github.*` instead.
For more details, see [Tools Configuration - Skills](docs/reference/tools_configuration.md#skills-tool).
## 🔗 MCP (Model Context Protocol)
PicoClaw natively supports [MCP](https://modelcontextprotocol.io/) — connect any MCP server to extend your Agent's capabilities with external tools and data sources.
```json
{
"tools": {
"mcp": {
"enabled": true,
"servers": {
"filesystem": {
"enabled": true,
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
}
}
}
}
```
You can manage common MCP setups directly from the CLI instead of editing JSON by hand:
也可直接调用工具,例如读取 Word:
```bash
picoclaw mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /tmp
picoclaw mcp list
picoclaw mcp test filesystem
bash ~/.picoclaw/workspace/tools/office/office.sh run -- \
pandoc -t markdown /home/your-user/.picoclaw/workspace/report.docx
```
`picoclaw mcp` is a configuration manager: it updates `config.json` under `tools.mcp.servers`, but it does not keep the server process running itself.
容器以当前用户身份运行,无网络访问,不挂载用户配置或 Docker socket。更新内置资源时可用 `skills install-builtin docx xlsx pptx --force`,这会替换所选 Skill 和共享办公环境资源;本地修改过这些目录时请先自行保留需要的内容,然后重新执行 `setup`、`check`。
Use `picoclaw mcp edit` when you need advanced fields that are not covered by `picoclaw mcp add`.
For example, `picoclaw mcp add` supports `--deferred` and `--env-file`, while `picoclaw mcp edit` is still useful for direct JSON editing and uncommon MCP settings.
详细用法、验证命令和限制见[办公环境说明](docs/guides/office-skills.zh.md)。
For full MCP configuration (stdio, SSE, HTTP transports, Tool Discovery), see [Tools Configuration - MCP](docs/reference/tools_configuration.md#mcp-tool). For CLI usage and examples, see [MCP Server CLI](docs/reference/mcp-cli.md).
## 记忆与新对话
## <img src="assets/clawdchat-icon.png" width="24" height="24" alt="ClawdChat"> Join the Agent Social Network
SQLite 是唯一的运行时记忆来源,默认位于 `~/.picoclaw/state/memory/memory.sqlite3`。本地终端和通过渠道访问规则的飞书、微信私聊可以说「以后用中文,回答简短一点」设置偏好,或说「帮我记一下,原神玩到第三章」保存记录。要更正或删除也可以直接说,Agent 会先查找目标。永久记录按需用 `memory_search` 查询;群聊不访问私人记忆。访问规则、配置和备份见 [SQLite 三层记忆](docs/guides/memory.zh.md)。
Connect PicoClaw to the Agent Social Network simply by sending a single message via the CLI or any integrated Chat App.
发送以下命令可以丢弃当前会话的历史消息和摘要:
**Read `https://clawdchat.ai/skill.md` and follow the instructions to join [ClawdChat.ai](https://clawdchat.ai)**
```text
/new
```
## 🖥️ CLI Reference
它等同于 `/clear`,只清理上下文,不调用模型。也可以在同一条消息里直接带上新问题:
| Command | Description |
| ------------------------- | -------------------------------- |
| `picoclaw onboard` | Initialize config & workspace |
| `picoclaw auth weixin` | Connect WeChat account via QR |
| `picoclaw agent -m "..."` | Chat with the agent |
| `picoclaw agent` | Interactive chat mode |
| `picoclaw gateway` | Start the gateway |
| `picoclaw status` | Show status |
| `picoclaw version` | Show version info |
| `picoclaw model` | View or switch the default model |
| `picoclaw mcp list` | List configured MCP servers |
| `picoclaw mcp add ...` | Add or update an MCP server entry |
| `picoclaw mcp test` | Probe a configured MCP server |
| `picoclaw mcp edit` | Open config for advanced MCP editing |
| `picoclaw mcp remove` | Remove an MCP server entry |
| `picoclaw cron list` | List all scheduled jobs |
| `picoclaw cron add ...` | Add a scheduled job |
| `picoclaw cron disable` | Disable a scheduled job |
| `picoclaw cron remove` | Remove a scheduled job |
| `picoclaw skills list` | List installed skills |
| `picoclaw skills install` | Install a skill |
| `picoclaw migrate` | Migrate data from older versions |
| `picoclaw auth login` | Authenticate with providers |
```text
/new 帮我查查今天成都的天气
/new 看看今天有啥新咖啡
```
### ⏰ Scheduled Tasks / Reminders
此时先清理上下文,再执行新问题;后续消息继续这段新对话。这是重置当前会话的模型上下文,不会创建一个可单独切回的历史会话,也不会删除工作区文件或长期记忆。
PicoClaw supports scheduled reminders and recurring tasks through the `cron` tool:
如果当前会话还有运行中或待处理的任务,`/new` 会提示稍后重试,不会中断任务或重置上下文。
* **One-time reminders**: "Remind me in 10 minutes" -> triggers once after 10min
* **Recurring tasks**: "Remind me every 2 hours" -> triggers every 2 hours
* **Cron expressions**: "Remind me at 9am daily" -> uses cron expression
## 从旧版或上游配置升级
See [docs/reference/cron.md](docs/reference/cron.md) for current schedule types, execution modes, command-job gates, and persistence details.
首次启动会直接创建 SQLite 记忆库。永久记录可带独立的分类路径,例如「日常/游戏」;只有明确限定范围时才按分类过滤,普通检索会合并关键词、近义词和别名的命中。
## 📚 Documentation
已移除的渠道类型如下:
For detailed guides beyond this README:
- `pico`、`pico_client`、`maixcam`
- `slack`、`slack_webhook`、`teams_webhook`、`matrix`、`deltachat`、`irc`、`vk`
- `line`、`whatsapp`、`whatsapp_native`、`discord`
| Topic | Description |
|-------|-------------|
| [Docker & Quick Start](docs/guides/docker.md) | Docker Compose setup, Gateway/Agent modes |
| [Chat Apps](docs/guides/chat-apps.md) | All 18+ channel setup guides |
| [Configuration](docs/guides/configuration.md) | Environment variables, workspace layout, security sandbox |
| [MCP Server CLI](docs/reference/mcp-cli.md) | Add, list, test, edit, and remove MCP server entries from the CLI |
| [Scheduled Tasks and Cron Jobs](docs/reference/cron.md) | Cron schedule types, deliver modes, command gates, job storage |
| [Providers & Models](docs/guides/providers.md) | 30+ LLM providers, model routing, model_list configuration |
| [Spawn & Async Tasks](docs/guides/spawn-tasks.md) | Quick tasks, long tasks with spawn, async sub-agent orchestration |
| [Hooks](docs/architecture/hooks/README.md) | Event-driven hook system: observers, interceptors, approval hooks |
| [Steering](docs/architecture/steering.md) | Inject messages into a running agent loop between tool calls |
| [SubTurn](docs/architecture/subturn.md) | Subagent coordination, concurrency control, lifecycle |
| [Troubleshooting](docs/operations/troubleshooting.md) | Common issues and solutions |
| [Tools Configuration](docs/reference/tools_configuration.md) | Per-tool enable/disable, exec policies, MCP, Skills |
| [Hardware Compatibility](docs/guides/hardware-compatibility.md) | Tested boards, minimum requirements |
升级时,需要从 `config.json` **和** `.security.yml` 的 `channel_list`(旧版名为 `channels`)中删除这些渠道条目。仅设置 `enabled: false` 仍可能因未知渠道类型而导致启动失败,例如:
## 🤝 Contribute & Roadmap
```text
channel "maixcam" has unknown type "maixcam"
```
PRs welcome! The codebase is intentionally small and readable.
旧配置中的 `devices`、`tools.i2c`、`tools.spi` 和 `tools.serial` 字段会被忽略,保存配置时不再输出。已有工作区的 `skills/hardware` 不会自动删除,如曾安装过,请手动移除该目录。
See our [Community Roadmap](https://github.com/sipeed/picoclaw/issues/988) and [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
不再使用上游的 WebUI、launcher 或相关构建命令。部署时请使用本 fork 构建的二进制,避免混用上游发行产物。
Developer group building, join after your first merged PR!
## 更多说明
User Groups:
- [Docker 本地构建与运行](docs/guides/docker.zh.md)
- [配置指南](docs/guides/configuration.zh.md)
- [会话管理](docs/guides/session-guide.zh.md)
- [工具配置](docs/reference/tools_configuration.zh.md)
- [MCP 命令](docs/reference/mcp-cli.md)
- [定时任务](docs/reference/cron.md)
Discord: <https://discord.gg/V4sAZ9XWpN>
Evolution 自学习和 Seahorse 上下文引擎仍保留,默认分别为关闭和使用 legacy 引擎;不属于本轮已移除的功能。专题文档的入口见 [文档目录](docs/README.md)。
WeChat:
<img src="assets/wechat.png" alt="WeChat group QR code" width="512">
开发检查:
```bash
go test -tags stdjson ./...
make lint-docs
```
## 来源与许可
本项目基于 [sipeed/picoclaw](https://github.com/sipeed/picoclaw) 修改,感谢上游及其贡献者。继续使用 [MIT License](LICENSE),版权声明见许可文件。Go module 路径保留为 `github.com/sipeed/picoclaw`。
+8 -3
View File
@@ -28,6 +28,11 @@ func agentCmd(message, sessionKey, model string, debug bool) error {
return fmt.Errorf("error loading config: %w", err)
}
releaseMemory, err := agent.PrepareMemory(cfg)
if err != nil {
return err
}
defer releaseMemory()
logger.ConfigureFromEnv()
if debug {
@@ -76,7 +81,7 @@ func agentCmd(message, sessionKey, model string, debug bool) error {
if message != "" {
ctx := context.Background()
response, err := agentLoop.ProcessDirect(ctx, message, sessionKey)
response, err := agentLoop.ProcessLocalCLI(ctx, message, sessionKey)
if err != nil {
return fmt.Errorf("error processing message: %w", err)
}
@@ -130,7 +135,7 @@ func interactiveMode(agentLoop *agent.AgentLoop, sessionKey string) {
}
ctx := context.Background()
response, err := agentLoop.ProcessDirect(ctx, input, sessionKey)
response, err := agentLoop.ProcessLocalCLI(ctx, input, sessionKey)
if err != nil {
fmt.Printf("Error: %v\n", err)
continue
@@ -165,7 +170,7 @@ func simpleInteractiveMode(agentLoop *agent.AgentLoop, sessionKey string) {
}
ctx := context.Background()
response, err := agentLoop.ProcessDirect(ctx, input, sessionKey)
response, err := agentLoop.ProcessLocalCLI(ctx, input, sessionKey)
if err != nil {
fmt.Printf("Error: %v\n", err)
continue
-1
View File
@@ -15,7 +15,6 @@ func NewAuthCommand() *cobra.Command {
newLoginCommand(),
newLogoutCommand(),
newStatusCommand(),
newModelsCommand(),
newWeixinCommand(),
newWeComCommand(),
)
@@ -31,7 +31,6 @@ func TestNewAuthCommand(t *testing.T) {
"login",
"logout",
"status",
"models",
"weixin",
"wecom",
}
+1 -169
View File
@@ -2,13 +2,9 @@ package auth
import (
"bufio"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"strings"
"time"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal"
"github.com/sipeed/picoclaw/pkg/auth"
@@ -17,7 +13,7 @@ import (
)
const (
supportedProvidersMsg = "supported providers: openai, anthropic, google-antigravity, antigravity"
supportedProvidersMsg = "supported providers: openai, anthropic"
defaultAnthropicModel = "claude-sonnet-4.6"
)
@@ -27,8 +23,6 @@ func authLoginCmd(provider string, useDeviceCode bool, useOauth bool, noBrowser
return authLoginOpenAI(useDeviceCode, noBrowser)
case "anthropic":
return authLoginAnthropic(useOauth)
case "google-antigravity", "antigravity":
return authLoginGoogleAntigravity(noBrowser)
default:
return fmt.Errorf("unsupported provider: %s (%s)", provider, supportedProvidersMsg)
}
@@ -92,75 +86,6 @@ func authLoginOpenAI(useDeviceCode bool, noBrowser bool) error {
return nil
}
func authLoginGoogleAntigravity(noBrowser bool) error {
cfg := auth.GoogleAntigravityOAuthConfig()
cred, err := auth.LoginBrowserWithOptions(cfg, auth.LoginBrowserOptions{NoBrowser: noBrowser})
if err != nil {
return fmt.Errorf("login failed: %w", err)
}
cred.Provider = "google-antigravity"
// Fetch user email from Google userinfo
email, err := fetchGoogleUserEmail(cred.AccessToken)
if err != nil {
fmt.Printf("Warning: could not fetch email: %v\n", err)
} else {
cred.Email = email
fmt.Printf("Email: %s\n", email)
}
// Fetch Cloud Code Assist project ID
projectID, err := providers.FetchAntigravityProjectID(cred.AccessToken)
if err != nil {
fmt.Printf("Warning: could not fetch project ID: %v\n", err)
fmt.Println("You may need Google Cloud Code Assist enabled on your account.")
} else {
cred.ProjectID = projectID
fmt.Printf("Project: %s\n", projectID)
}
if err = auth.SetCredential("google-antigravity", cred); err != nil {
return fmt.Errorf("failed to save credentials: %w", err)
}
appCfg, err := internal.LoadConfig()
if err == nil {
// Update or add antigravity in ModelList
foundAntigravity := false
for i := range appCfg.ModelList {
if isAntigravityModel(appCfg.ModelList[i]) {
appCfg.ModelList[i].AuthMethod = "oauth"
foundAntigravity = true
break
}
}
// If no antigravity in ModelList, add it
if !foundAntigravity {
appCfg.ModelList = append(appCfg.ModelList, &config.ModelConfig{
ModelName: "gemini-flash",
Model: "antigravity/gemini-3-flash",
AuthMethod: "oauth",
})
}
// Update default model
appCfg.Agents.Defaults.ModelName = "gemini-flash"
if err := config.SaveConfig(internal.GetConfigPath(), appCfg); err != nil {
fmt.Printf("Warning: could not update config: %v\n", err)
}
}
fmt.Println("\n✓ Google Antigravity login successful!")
fmt.Println("Default model set to: gemini-flash")
fmt.Println("Try it: picoclaw agent -m \"Hello world\"")
return nil
}
func authLoginAnthropic(useOauth bool) error {
if useOauth {
return authLoginAnthropicSetupToken()
@@ -234,37 +159,6 @@ func authLoginAnthropicSetupToken() error {
return nil
}
func fetchGoogleUserEmail(accessToken string) (string, error) {
req, err := http.NewRequest("GET", "https://www.googleapis.com/oauth2/v2/userinfo", nil)
if err != nil {
return "", err
}
req.Header.Set("Authorization", "Bearer "+accessToken)
client := &http.Client{Timeout: 10 * time.Second}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("reading userinfo response: %w", err)
}
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("userinfo request failed: %s", string(body))
}
var userInfo struct {
Email string `json:"email"`
}
if err := json.Unmarshal(body, &userInfo); err != nil {
return "", err
}
return userInfo.Email, nil
}
func authLoginPasteToken(provider string) error {
cred, err := auth.LoginPasteToken(provider, os.Stdin)
if err != nil {
@@ -349,10 +243,6 @@ func authLogoutCmd(provider string) error {
if isAnthropicModel(appCfg.ModelList[i]) {
appCfg.ModelList[i].AuthMethod = ""
}
case "google-antigravity", "antigravity":
if isAntigravityModel(appCfg.ModelList[i]) {
appCfg.ModelList[i].AuthMethod = ""
}
}
}
config.SaveConfig(internal.GetConfigPath(), appCfg)
@@ -433,64 +323,6 @@ func authStatusCmd() error {
return nil
}
func authModelsCmd() error {
cred, err := auth.GetCredential("google-antigravity")
if err != nil || cred == nil {
return fmt.Errorf(
"not logged in to Google Antigravity.\nrun: picoclaw auth login --provider google-antigravity",
)
}
// Refresh token if needed
if cred.NeedsRefresh() && cred.RefreshToken != "" {
oauthCfg := auth.GoogleAntigravityOAuthConfig()
refreshed, refreshErr := auth.RefreshAccessToken(cred, oauthCfg)
if refreshErr == nil {
cred = refreshed
_ = auth.SetCredential("google-antigravity", cred)
}
}
projectID := cred.ProjectID
if projectID == "" {
return fmt.Errorf("no project id stored. Try logging in again")
}
fmt.Printf("Fetching models for project: %s\n\n", projectID)
models, err := providers.FetchAntigravityModels(cred.AccessToken, projectID)
if err != nil {
return fmt.Errorf("error fetching models: %w", err)
}
if len(models) == 0 {
return fmt.Errorf("no models available")
}
fmt.Println("Available Antigravity Models:")
fmt.Println("-----------------------------")
for _, m := range models {
status := "✓"
if m.IsExhausted {
status = "✗ (quota exhausted)"
}
name := m.ID
if m.DisplayName != "" {
name = fmt.Sprintf("%s (%s)", m.ID, m.DisplayName)
}
fmt.Printf(" %s %s\n", status, name)
}
return nil
}
// isAntigravityModel checks if a model config belongs to an Antigravity provider.
func isAntigravityModel(modelCfg *config.ModelConfig) bool {
protocol, _ := providers.ExtractProtocol(modelCfg)
return protocol == "antigravity" || protocol == "google-antigravity"
}
// isOpenAIModel checks if a model config belongs to the OpenAI provider.
func isOpenAIModel(modelCfg *config.ModelConfig) bool {
protocol, _ := providers.ExtractProtocol(modelCfg)
return protocol == "openai"
+1 -1
View File
@@ -20,7 +20,7 @@ func newLoginCommand() *cobra.Command {
}
cmd.Flags().StringVarP(
&provider, "provider", "p", "", "Provider to login with (openai, anthropic, google-antigravity, antigravity)",
&provider, "provider", "p", "", "Provider to login with (openai, anthropic)",
)
cmd.Flags().BoolVar(&useDeviceCode, "device-code", false, "Use device code flow (for headless environments)")
cmd.Flags().BoolVar(&noBrowser, "no-browser", false, "Do not auto-open a browser during OAuth login")
-15
View File
@@ -1,15 +0,0 @@
package auth
import "github.com/spf13/cobra"
func newModelsCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "models",
Short: "Show available models",
RunE: func(_ *cobra.Command, _ []string) error {
return authModelsCmd()
},
}
return cmd
}
-19
View File
@@ -1,19 +0,0 @@
package auth
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewModelsCommand(t *testing.T) {
cmd := newModelsCommand()
require.NotNil(t, cmd)
assert.Equal(t, "models", cmd.Use)
assert.Equal(t, "Show available models", cmd.Short)
assert.False(t, cmd.HasFlags())
}
-48
View File
@@ -2,18 +2,14 @@ package auth
import (
"bytes"
"encoding/json"
"io"
"os"
"path/filepath"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
pkgauth "github.com/sipeed/picoclaw/pkg/auth"
"github.com/sipeed/picoclaw/pkg/config"
)
@@ -57,47 +53,3 @@ func TestNewStatusSubcommand(t *testing.T) {
assert.False(t, cmd.HasFlags())
}
func TestAuthStatusCmdShowsCanonicalGoogleAntigravityAfterLegacyRefresh(t *testing.T) {
tmpDir := setAuthStatusTestHome(t)
legacyExpiry := time.Date(2026, 4, 16, 10, 0, 0, 0, time.UTC)
legacyStore := map[string]any{
"credentials": map[string]any{
"antigravity": map[string]any{
"access_token": "legacy-token",
"expires_at": legacyExpiry.Format(time.RFC3339),
"provider": "antigravity",
"auth_method": "oauth",
"project_id": "legacy-project",
},
},
}
data, err := json.Marshal(legacyStore)
require.NoError(t, err)
authPath := filepath.Join(tmpDir, ".picoclaw", "auth.json")
require.NoError(t, os.MkdirAll(filepath.Dir(authPath), 0o755))
require.NoError(t, os.WriteFile(authPath, data, 0o600))
refreshedExpiry := time.Date(2026, 4, 16, 12, 30, 0, 0, time.UTC)
err = pkgauth.SetCredential("google-antigravity", &pkgauth.AuthCredential{
AccessToken: "fresh-token",
ExpiresAt: refreshedExpiry,
Provider: "google-antigravity",
AuthMethod: "oauth",
ProjectID: "fresh-project",
})
require.NoError(t, err)
output := captureAuthStdout(t, func() {
require.NoError(t, authStatusCmd())
})
assert.Contains(t, output, "\nAuthenticated Providers:")
assert.Contains(t, output, "\n google-antigravity:\n")
assert.NotContains(t, output, "\n antigravity:\n")
assert.Contains(t, output, " Project: fresh-project")
assert.Contains(t, output, " Expires: 2026-04-16 12:30")
assert.Equal(t, 1, strings.Count(output, ":\n Method: oauth"))
}
+29 -19
View File
@@ -70,9 +70,9 @@ func runWeixinOnboard(baseURL, proxy string, timeout time.Duration) error {
effectiveBaseURL = baseURL
}
if err := saveWeixinConfig(botToken, effectiveBaseURL, proxy); err != nil {
if err := saveWeixinConfig(botToken, accountID, effectiveBaseURL, proxy); err != nil {
fmt.Printf("⚠️ Could not auto-save to config: %v\n", err)
printManualWeixinConfig(botToken, effectiveBaseURL)
printManualWeixinConfig(botToken, accountID, effectiveBaseURL)
return nil
}
@@ -86,8 +86,8 @@ func runWeixinOnboard(baseURL, proxy string, timeout time.Duration) error {
return nil
}
// saveWeixinConfig patches channels.weixin in the config and saves it.
func saveWeixinConfig(token, baseURL, proxy string) error {
// saveWeixinConfig saves the verified iLink account ID alongside its token.
func saveWeixinConfig(token, accountID, baseURL, proxy string) error {
cfgPath := internal.GetConfigPath()
cfg, err := config.LoadConfig(cfgPath)
@@ -102,33 +102,43 @@ func saveWeixinConfig(token, baseURL, proxy string) error {
}
bc.Enabled = true
if decoded, err := bc.GetDecoded(); err == nil && decoded != nil {
if weixinCfg, ok := decoded.(*config.WeixinSettings); ok {
weixinCfg.Token = *config.NewSecureString(token)
const defaultBase = "https://ilinkai.weixin.qq.com/"
if baseURL != "" && baseURL != defaultBase {
weixinCfg.BaseURL = baseURL
}
if proxy != "" {
weixinCfg.Proxy = proxy
}
}
decoded, err := bc.GetDecoded()
if err != nil {
return err
}
weixinCfg, ok := decoded.(*config.WeixinSettings)
if !ok {
return fmt.Errorf("cannot load Weixin channel settings")
}
weixinCfg.SetToken(token)
weixinCfg.AccountID = accountID
const defaultBase = "https://ilinkai.weixin.qq.com/"
if baseURL != "" && baseURL != defaultBase {
weixinCfg.BaseURL = baseURL
}
if proxy != "" {
weixinCfg.Proxy = proxy
}
return config.SaveConfig(cfgPath, cfg)
}
func printManualWeixinConfig(token, baseURL string) {
func printManualWeixinConfig(token, accountID, baseURL string) {
fmt.Println()
fmt.Println("Add the following to the channels section of your picoclaw config:")
fmt.Println("Add the following to channel_list in your picoclaw config:")
fmt.Println()
fmt.Println(` "weixin": {`)
fmt.Println(` "type": "weixin",`)
fmt.Println(` "enabled": true,`)
fmt.Printf(" \"token\": %q,\n", token)
fmt.Println(` "settings": {`)
fmt.Printf(" \"token\": %q,\n", token)
fmt.Printf(" \"account_id\": %q", accountID)
const defaultBase = "https://ilinkai.weixin.qq.com/"
if baseURL != "" && baseURL != defaultBase {
fmt.Printf(" \"base_url\": %q,\n", baseURL)
fmt.Printf(",\n \"base_url\": %q", baseURL)
}
fmt.Println()
fmt.Println(` },`)
fmt.Println(` "allow_from": []`)
fmt.Println(` }`)
}
+32
View File
@@ -0,0 +1,32 @@
package auth
import (
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"github.com/sipeed/picoclaw/pkg/config"
)
func TestSaveWeixinConfigPersistsVerifiedAccountID(t *testing.T) {
home := t.TempDir()
path := filepath.Join(home, "config.json")
t.Setenv(config.EnvHome, home)
t.Setenv(config.EnvConfig, path)
data := `{"version":3,"channel_list":{"weixin":{"type":"weixin","settings":{"account_id":"previous-account"}}}}`
require.NoError(t, os.WriteFile(path, []byte(data), 0o600))
require.NoError(t, saveWeixinConfig("test-bot-token", "verified-account", "", ""))
cfg, err := config.LoadConfig(path)
require.NoError(t, err)
channel := cfg.Channels.Get(config.ChannelWeixin)
require.NotNil(t, channel)
require.True(t, channel.Enabled)
settings, err := channel.GetDecoded()
require.NoError(t, err)
w, ok := settings.(*config.WeixinSettings)
require.True(t, ok)
require.Equal(t, "verified-account", w.AccountID)
}
+63
View File
@@ -0,0 +1,63 @@
package memory
import (
"fmt"
"github.com/spf13/cobra"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal"
"github.com/sipeed/picoclaw/pkg/agent"
"github.com/sipeed/picoclaw/pkg/config"
storage "github.com/sipeed/picoclaw/pkg/memory"
"github.com/sipeed/picoclaw/pkg/pid"
)
func NewCommand() *cobra.Command {
c := &cobra.Command{Use: "memory", Short: "Manage SQLite memory"}
c.AddCommand(fileCommand("backup", false), fileCommand("restore", true))
return c
}
func fileCommand(name string, restore bool) *cobra.Command {
return &cobra.Command{
Use: name + " <file>",
Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error {
home := config.GetHome()
p := storage.Path(home)
cfg, e := internal.LoadConfig()
if e != nil {
return e
}
if e = agent.CheckMemoryArchivePath(cfg, args[0]); e != nil {
return e
}
if restore {
if pid.ReadPidFileWithCheck(home) != nil {
return fmt.Errorf("stop the Gateway before restoring memory")
}
release, lockErr := storage.Lease(p, true)
if lockErr != nil {
return lockErr
}
defer release()
before, restoreErr := storage.Restore(c.Context(), p, args[0])
if restoreErr != nil {
return restoreErr
}
fmt.Fprintln(c.OutOrStdout(), "Memory restored. Previous snapshot:", before)
return nil
}
release, e := storage.Lease(p, false)
if e != nil {
return e
}
defer release()
if e = storage.Backup(c.Context(), p, args[0]); e != nil {
return e
}
fmt.Fprintln(c.OutOrStdout(), "Memory snapshot written:", args[0])
return nil
},
}
}
+131
View File
@@ -0,0 +1,131 @@
package skills
import (
"fmt"
"io"
"io/fs"
"os"
"path/filepath"
"strings"
"gopkg.in/yaml.v3"
picoclaw "github.com/sipeed/picoclaw"
)
func builtinSkillNames() ([]string, error) {
entries, err := fs.ReadDir(picoclaw.OnboardWorkspace, "workspace/skills")
if err != nil {
return nil, err
}
var names []string
for _, entry := range entries {
if !entry.IsDir() {
continue
}
if _, err := fs.Stat(picoclaw.OnboardWorkspace, "workspace/skills/"+entry.Name()+"/SKILL.md"); err != nil {
return nil, err
}
names = append(names, entry.Name())
}
return names, nil
}
func listBuiltinSkills(out io.Writer) error {
names, err := builtinSkillNames()
if err != nil {
return err
}
for _, name := range names {
data, err := picoclaw.OnboardWorkspace.ReadFile("workspace/skills/" + name + "/SKILL.md")
if err != nil {
return err
}
var meta struct {
Description string `yaml:"description"`
}
parts := strings.SplitN(string(data), "---", 3)
if len(parts) == 3 {
if err := yaml.Unmarshal([]byte(parts[1]), &meta); err != nil {
return fmt.Errorf("%s: %w", name, err)
}
}
fmt.Fprintf(out, "%s\n %s\n", name, meta.Description)
}
return nil
}
func installBuiltinSkills(workspace string, names []string, force bool, out io.Writer) error {
available, err := builtinSkillNames()
if err != nil {
return err
}
known := make(map[string]bool, len(available))
for _, name := range available {
known[name] = true
}
if len(names) == 0 {
names = available
}
// Validate the whole request before writing anything (also rejects path traversal).
for _, name := range names {
if !known[name] {
return fmt.Errorf("unknown builtin skill %q", name)
}
}
office := false
for _, name := range names {
if name == "docx" || name == "xlsx" || name == "pptx" {
office = true
}
if err := copyBuiltinTree(
"workspace/skills/"+name,
filepath.Join(workspace, "skills", name),
force,
out,
); err != nil {
return err
}
}
if office {
return copyBuiltinTree("workspace/tools/office", filepath.Join(workspace, "tools", "office"), force, out)
}
return nil
}
func copyBuiltinTree(source, target string, force bool, out io.Writer) error {
if info, err := os.Lstat(target); err == nil {
if !force {
fmt.Fprintf(out, "Skipped existing %s\n", target)
return nil
}
if info.Mode()&os.ModeSymlink != 0 {
return fmt.Errorf("refusing to replace symlink %s", target)
}
if removeErr := os.RemoveAll(target); removeErr != nil {
return removeErr
}
} else if !os.IsNotExist(err) {
return err
}
err := fs.WalkDir(picoclaw.OnboardWorkspace, source, func(path string, entry fs.DirEntry, walkErr error) error {
if walkErr != nil {
return walkErr
}
rel := strings.TrimPrefix(strings.TrimPrefix(path, source), "/")
dest := filepath.Join(target, filepath.FromSlash(rel))
if entry.IsDir() {
return os.MkdirAll(dest, 0o755)
}
data, err := picoclaw.OnboardWorkspace.ReadFile(path)
if err != nil {
return err
}
return os.WriteFile(dest, data, 0o644)
})
if err != nil {
return err
}
fmt.Fprintf(out, "Installed %s\n", target)
return nil
}
@@ -0,0 +1,72 @@
package skills
import (
"bytes"
"io"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
picoclaw "github.com/sipeed/picoclaw"
"github.com/sipeed/picoclaw/pkg/skills"
)
func TestBuiltinOfficeInstall(t *testing.T) {
workspace := t.TempDir()
require.NoError(t, installBuiltinSkills(workspace, []string{"docx", "xlsx", "pptx"}, false, io.Discard))
loader := skills.NewSkillsLoader(workspace, "", "")
installed := loader.ListSkills()
require.Len(t, installed, 3)
for _, info := range installed {
require.NotEmpty(t, info.Description)
require.FileExists(
t,
filepath.Join(workspace, "skills", info.Name, "scripts", "office", "helpers", "__init__.py"),
)
require.FileExists(t, filepath.Join(workspace, "skills", info.Name, "LICENSE.txt"))
}
require.FileExists(t, filepath.Join(workspace, "tools", "office", "office.sh"))
require.NoDirExists(t, filepath.Join(workspace, "skills", "weather"))
// Keep local edits, including shared resources, unless explicitly forced.
path := filepath.Join(workspace, "skills", "docx", "SKILL.md")
runtime := filepath.Join(workspace, "tools", "office", "office.sh")
for _, p := range []string{path, runtime} {
require.NoError(t, os.WriteFile(p, []byte("local edit"), 0o644))
}
require.NoError(t, installBuiltinSkills(workspace, []string{"docx"}, false, io.Discard))
for _, p := range []string{path, runtime} {
data, err := os.ReadFile(p)
require.NoError(t, err)
require.Equal(t, "local edit", string(data))
}
require.NoError(t, installBuiltinSkills(workspace, []string{"docx"}, true, io.Discard))
for _, p := range []string{path, runtime} {
data, err := os.ReadFile(p)
require.NoError(t, err)
require.NotEqual(t, "local edit", string(data))
}
}
func TestBuiltinEnumerationAndValidation(t *testing.T) {
names, err := builtinSkillNames()
require.NoError(t, err)
require.Len(t, names, 10)
require.NotContains(t, names, "hardware")
var out bytes.Buffer
require.NoError(t, listBuiltinSkills(&out))
require.Contains(t, out.String(), "docx")
workspace := t.TempDir()
for _, invalid := range []string{"../docx", "news", "missing"} {
require.Error(t, installBuiltinSkills(workspace, []string{"docx", invalid}, false, io.Discard))
require.NoDirExists(t, filepath.Join(workspace, "skills"))
}
require.NoError(t, installBuiltinSkills(workspace, nil, false, io.Discard))
for _, name := range names {
require.FileExists(t, filepath.Join(workspace, "skills", name, "SKILL.md"))
}
// Embedded Python package initializers must survive Go's default underscore exclusion.
_, err = picoclaw.OnboardWorkspace.ReadFile("workspace/skills/docx/scripts/office/helpers/__init__.py")
require.NoError(t, err)
}
-125
View File
@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"strings"
@@ -179,94 +178,6 @@ func skillsRemoveFromWorkspace(workspace string, toolsConfig config.SkillsToolsC
return nil
}
func skillsInstallBuiltinCmd(workspace string) {
builtinSkillsDir := "./picoclaw/skills"
workspaceSkillsDir := filepath.Join(workspace, "skills")
fmt.Printf("Copying builtin skills to workspace...\n")
skillsToInstall := []string{
"weather",
"news",
"stock",
"calculator",
}
for _, skillName := range skillsToInstall {
builtinPath := filepath.Join(builtinSkillsDir, skillName)
workspacePath := filepath.Join(workspaceSkillsDir, skillName)
if _, err := os.Stat(builtinPath); err != nil {
fmt.Printf("⊘ Builtin skill '%s' not found: %v\n", skillName, err)
continue
}
if err := os.MkdirAll(workspacePath, 0o755); err != nil {
fmt.Printf("✗ Failed to create directory for %s: %v\n", skillName, err)
continue
}
if err := copyDirectory(builtinPath, workspacePath); err != nil {
fmt.Printf("✗ Failed to copy %s: %v\n", skillName, err)
}
}
fmt.Println("\n✓ All builtin skills installed!")
fmt.Println("Now you can use them in your workspace.")
}
func skillsListBuiltinCmd() {
cfg, err := internal.LoadConfig()
if err != nil {
fmt.Printf("Error loading config: %v\n", err)
return
}
builtinSkillsDir := filepath.Join(filepath.Dir(cfg.WorkspacePath()), "picoclaw", "skills")
fmt.Println("\nAvailable Builtin Skills:")
fmt.Println("-----------------------")
entries, err := os.ReadDir(builtinSkillsDir)
if err != nil {
fmt.Printf("Error reading builtin skills: %v\n", err)
return
}
if len(entries) == 0 {
fmt.Println("No builtin skills available.")
return
}
for _, entry := range entries {
if entry.IsDir() {
skillName := entry.Name()
skillFile := filepath.Join(builtinSkillsDir, skillName, "SKILL.md")
description := "No description"
if _, err := os.Stat(skillFile); err == nil {
data, err := os.ReadFile(skillFile)
if err == nil {
content := string(data)
if idx := strings.Index(content, "\n"); idx > 0 {
firstLine := content[:idx]
if strings.Contains(firstLine, "description:") {
descLine := strings.Index(content[idx:], "\n")
if descLine > 0 {
description = strings.TrimSpace(content[idx+descLine : idx+descLine])
}
}
}
}
}
status := "✓"
fmt.Printf(" %s %s\n", status, entry.Name())
if description != "" {
fmt.Printf(" %s\n", description)
}
}
}
}
func skillsSearchCmd(query string) {
fmt.Println("Searching for available skills...")
@@ -322,39 +233,3 @@ func skillsShowCmd(loader *skills.SkillsLoader, skillName string) {
fmt.Println("----------------------")
fmt.Println(content)
}
func copyDirectory(src, dst string) error {
return filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
relPath, err := filepath.Rel(src, path)
if err != nil {
return err
}
dstPath := filepath.Join(dst, relPath)
if info.IsDir() {
return os.MkdirAll(dstPath, info.Mode())
}
srcFile, err := os.Open(path)
if err != nil {
return err
}
defer srcFile.Close()
dstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, info.Mode())
if err != nil {
return err
}
_, copyErr := io.Copy(dstFile, srcFile)
if closeErr := dstFile.Close(); closeErr != nil && copyErr == nil {
return fmt.Errorf("close destination file %s: %w", dstPath, closeErr)
}
return copyErr
})
}
@@ -3,19 +3,20 @@ package skills
import "github.com/spf13/cobra"
func newInstallBuiltinCommand(workspaceFn func() (string, error)) *cobra.Command {
var force bool
cmd := &cobra.Command{
Use: "install-builtin",
Short: "Install all builtin skills to workspace",
Use: "install-builtin [name...]",
Short: "Install builtin skills to workspace (preserve existing by default)",
Example: `picoclaw skills install-builtin`,
RunE: func(_ *cobra.Command, _ []string) error {
RunE: func(command *cobra.Command, names []string) error {
workspace, err := workspaceFn()
if err != nil {
return err
}
skillsInstallBuiltinCmd(workspace)
return nil
return installBuiltinSkills(workspace, names, force, command.OutOrStdout())
},
}
cmd.Flags().BoolVar(&force, "force", false, "Replace existing builtin skills and shared resources")
return cmd
}
@@ -12,8 +12,8 @@ func TestNewInstallbuiltinSubcommand(t *testing.T) {
require.NotNil(t, cmd)
assert.Equal(t, "install-builtin", cmd.Use)
assert.Equal(t, "Install all builtin skills to workspace", cmd.Short)
assert.Equal(t, "install-builtin [name...]", cmd.Use)
assert.Equal(t, "Install builtin skills to workspace (preserve existing by default)", cmd.Short)
assert.Nil(t, cmd.Run)
assert.NotNil(t, cmd.RunE)
@@ -21,7 +21,7 @@ func TestNewInstallbuiltinSubcommand(t *testing.T) {
assert.True(t, cmd.HasExample())
assert.False(t, cmd.HasSubCommands())
assert.False(t, cmd.HasFlags())
assert.True(t, cmd.HasFlags())
assert.Len(t, cmd.Aliases, 0)
}
+2 -2
View File
@@ -7,8 +7,8 @@ func newListBuiltinCommand() *cobra.Command {
Use: "list-builtin",
Short: "List available builtin skills",
Example: `picoclaw skills list-builtin`,
Run: func(_ *cobra.Command, _ []string) {
skillsListBuiltinCmd()
RunE: func(cmd *cobra.Command, _ []string) error {
return listBuiltinSkills(cmd.OutOrStdout())
},
}
@@ -15,7 +15,7 @@ func TestNewListbuiltinSubcommand(t *testing.T) {
assert.Equal(t, "list-builtin", cmd.Use)
assert.Equal(t, "List available builtin skills", cmd.Short)
assert.NotNil(t, cmd.Run)
assert.NotNil(t, cmd.RunE)
assert.True(t, cmd.HasExample())
assert.False(t, cmd.HasSubCommands())
+7 -61
View File
@@ -56,79 +56,25 @@ func statusCmd() {
}
return false
}
findLocalModelBase := func(modelName string) (string, bool) {
for _, m := range cfg.ModelList {
if m == nil {
continue
}
if m.ModelName == modelName && m.APIBase != "" {
return m.APIBase, true
}
}
return "", false
}
findProtocolBase := func(protocol string) (string, bool) {
want := providers.NormalizeProvider(protocol)
for _, m := range cfg.ModelList {
if m == nil {
continue
}
got, _ := providers.ExtractProtocol(m)
if got == want && m.APIBase != "" {
return m.APIBase, true
}
}
return "", false
}
hasOpenRouter := hasProtocolKey("openrouter")
hasAnthropic := hasProtocolKey("anthropic")
hasOpenAI := hasProtocolKey("openai")
hasGemini := hasProtocolKey("gemini")
hasZhipu := hasProtocolKey("zhipu")
hasQwen := hasProtocolKey("qwen")
hasGroq := hasProtocolKey("groq")
hasMoonshot := hasProtocolKey("moonshot")
hasDeepSeek := hasProtocolKey("deepseek")
hasVolcEngine := hasProtocolKey("volcengine")
hasNvidia := hasProtocolKey("nvidia")
// Local endpoints: allow both the special reserved name and protocol-based entries.
vllmBase, hasVLLM := findLocalModelBase("local-model")
if !hasVLLM {
vllmBase, hasVLLM = findProtocolBase("vllm")
}
ollamaBase, hasOllama := findProtocolBase("ollama")
val := func(enabled bool, extra ...string) string {
val := func(enabled bool) string {
if enabled {
if len(extra) > 0 && extra[0] != "" {
return "✓ " + extra[0]
}
return "✓"
}
return "not set"
}
report.Providers = []cliui.ProviderRow{
{Name: "OpenRouter API", Val: val(hasOpenRouter)},
{Name: "Anthropic API", Val: val(hasAnthropic)},
{Name: "OpenAI API", Val: val(hasOpenAI)},
{Name: "Gemini API", Val: val(hasGemini)},
{Name: "Zhipu API", Val: val(hasZhipu)},
{Name: "Qwen API", Val: val(hasQwen)},
{Name: "Groq API", Val: val(hasGroq)},
{Name: "Moonshot API", Val: val(hasMoonshot)},
{Name: "DeepSeek API", Val: val(hasDeepSeek)},
{Name: "VolcEngine API", Val: val(hasVolcEngine)},
{Name: "Nvidia API", Val: val(hasNvidia)},
{Name: "vLLM / local", Val: val(hasVLLM, vllmBase)},
{Name: "Ollama", Val: val(hasOllama, ollamaBase)},
{Name: "OpenAI API", Val: val(hasProtocolKey("openai"))},
{Name: "Anthropic API", Val: val(hasProtocolKey("anthropic"))},
}
store, _ := auth.LoadStore()
if store != nil && len(store.Credentials) > 0 {
for provider, cred := range store.Credentials {
protocol := providers.NormalizeProvider(provider)
if protocol != "openai" && protocol != "anthropic" {
continue
}
st := "authenticated"
if cred.IsExpired() {
st = "expired"
+31 -6
View File
@@ -8,6 +8,7 @@ import (
"strings"
"testing"
"github.com/sipeed/picoclaw/pkg/auth"
"github.com/sipeed/picoclaw/pkg/config"
)
@@ -65,10 +66,10 @@ func TestStatusCmd_RecognizesProviderFieldWithoutModelPrefix(t *testing.T) {
Enabled: true,
},
{
ModelName: "qwen-plus",
Provider: "qwen",
Model: "qwen-plus",
APIBase: "https://dashscope.aliyuncs.com/compatible-mode/v1",
ModelName: "claude-sonnet-4.6",
Provider: "anthropic",
Model: "claude-sonnet-4.6",
APIBase: "https://api.anthropic.com/v1",
APIKeys: config.SimpleSecureStrings("test-key"),
Enabled: true,
},
@@ -78,12 +79,36 @@ func TestStatusCmd_RecognizesProviderFieldWithoutModelPrefix(t *testing.T) {
t.Fatalf("config.SaveConfig() error = %v", err)
}
if err := auth.SaveStore(&auth.AuthStore{Credentials: map[string]*auth.AuthCredential{
"openai": {AuthMethod: "oauth"},
"anthropic": {AuthMethod: "token"},
"gemini": {AuthMethod: "oauth"},
}}); err != nil {
t.Fatalf("auth.SaveStore() error = %v", err)
}
output := captureStdout(t, statusCmd)
if !strings.Contains(output, "OpenAI API: \u2713") {
t.Fatalf("status output missing OpenAI provider: %s", output)
}
if !strings.Contains(output, "Qwen API: \u2713") {
t.Fatalf("status output missing Qwen provider: %s", output)
if !strings.Contains(output, "Anthropic API: \u2713") {
t.Fatalf("status output missing Anthropic provider: %s", output)
}
for _, removed := range []string{
"OpenRouter API", "Gemini API", "Zhipu API", "Qwen API", "Groq API",
"Moonshot API", "DeepSeek API", "VolcEngine API", "Nvidia API", "vLLM / local", "Ollama",
} {
if strings.Contains(output, removed) {
t.Errorf("status output includes removed provider %q: %s", removed, output)
}
}
for _, expected := range []string{"openai (oauth): authenticated", "anthropic (token): authenticated"} {
if !strings.Contains(output, expected) {
t.Errorf("status output missing authentication state %q: %s", expected, output)
}
}
if strings.Contains(output, "gemini") {
t.Errorf("status output includes removed authentication provider: %s", output)
}
}
+2
View File
@@ -23,6 +23,7 @@ import (
"github.com/sipeed/picoclaw/cmd/picoclaw/internal/cron"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal/gateway"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal/mcp"
memorycmd "github.com/sipeed/picoclaw/cmd/picoclaw/internal/memory"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal/migrate"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal/model"
"github.com/sipeed/picoclaw/cmd/picoclaw/internal/onboard"
@@ -134,6 +135,7 @@ picoclaw --no-color status`,
auth.NewAuthCommand(),
gateway.NewGatewayCommand(),
status.NewStatusCommand(),
memorycmd.NewCommand(),
cron.NewCronCommand(),
mcp.NewMCPCommand(),
migrate.NewMigrateCommand(),
+1
View File
@@ -43,6 +43,7 @@ func TestNewPicoclawCommand(t *testing.T) {
"cron",
"gateway",
"mcp",
"memory",
"migrate",
"model",
"onboard",
+11 -80
View File
@@ -33,77 +33,21 @@
"model_list": [
{
"model_name": "gpt-5.4",
"model": "openai/gpt-5.4",
"api_keys": ["sk-your-openai-key"],
"api_base": "https://api.openai.com/v1"
"provider": "openai",
"model": "gpt-5.4",
"api_base": "https://api.openai.com/v1",
"api_keys": [
"YOUR_OPENAI_API_KEY"
]
},
{
"model_name": "claude-sonnet-4.6",
"model": "anthropic/claude-sonnet-4.6",
"api_keys": ["sk-ant-your-key"],
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"api_base": "https://api.anthropic.com/v1",
"thinking_level": "high"
},
{
"_comment": "Anthropic Messages API - use native format for direct Anthropic API access",
"model_name": "claude-opus-4-6",
"model": "anthropic-messages/claude-opus-4-6",
"api_keys": ["sk-ant-your-key"],
"api_base": "https://api.anthropic.com"
},
{
"model_name": "gemini",
"_comment": "Optional: set \"tool_schema_transform\": \"simple\" for providers that reject complex tool JSON Schema.",
"model": "antigravity/gemini-2.0-flash",
"auth_method": "oauth"
},
{
"model_name": "deepseek",
"model": "deepseek/deepseek-chat",
"api_keys": ["sk-your-deepseek-key"]
},
{
"model_name": "venice-uncensored",
"model": "venice/venice-uncensored",
"api_keys": ["your-venice-api-key"]
},
{
"model_name": "nearai-glm",
"model": "nearai/zai-org/GLM-5.1-FP8",
"api_keys": ["your-nearai-api-key"]
},
{
"model_name": "lmstudio-local",
"model": "lmstudio/openai/gpt-oss-20b"
},
{
"model_name": "longcat",
"model": "longcat/LongCat-Flash-Thinking",
"api_keys": ["your-longcat-api-key"]
},
{
"model_name": "modelscope-qwen",
"model": "modelscope/Qwen/Qwen3-235B-A22B-Instruct-2507",
"api_keys": ["your-modelscope-access-token"],
"api_base": "https://api-inference.modelscope.cn/v1"
},
{
"model_name": "azure-gpt5",
"model": "azure/my-gpt5-deployment",
"api_keys": ["your-azure-api-key"],
"api_base": "https://your-resource.openai.azure.com"
},
{
"model_name": "loadbalanced-gpt-5.4",
"model": "openai/gpt-5.4",
"api_keys": ["sk-key1"],
"api_base": "https://api1.example.com/v1"
},
{
"model_name": "loadbalanced-gpt-5.4",
"model": "openai/gpt-5.4",
"api_keys": ["sk-key2"],
"api_base": "https://api2.example.com/v1"
"api_keys": [
"YOUR_ANTHROPIC_API_KEY"
]
}
],
"channel_list": {
@@ -373,9 +317,6 @@
"find_skills": {
"enabled": true
},
"i2c": {
"enabled": false
},
"install_skill": {
"enabled": true
},
@@ -389,18 +330,12 @@
"enabled": true,
"mode": "bytes"
},
"serial": {
"enabled": false
},
"send_tts": {
"enabled": false
},
"spawn": {
"enabled": true
},
"spi": {
"enabled": false
},
"subagent": {
"enabled": true
},
@@ -415,10 +350,6 @@
"enabled": true,
"interval": 30
},
"devices": {
"enabled": false,
"monitor_usb": true
},
"voice": {
"model_name": "",
"echo_transcription": false
-12
View File
@@ -1,12 +0,0 @@
FROM alpine:3.21
ARG TARGETPLATFORM
RUN apk add --no-cache ca-certificates tzdata
COPY $TARGETPLATFORM/picoclaw /usr/local/bin/picoclaw
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+10 -7
View File
@@ -1,6 +1,8 @@
# PicoClaw Documentation
PicoClaw documentation is organized by document type first and language second.
The [root README](../README.md) is the maintained entry point for this fork. Older upstream project README translations have been removed.
Supporting documentation is organized by document type first and language second.
This file describes the recommended documentation layout, how translated files should be named, and what `make lint-docs` currently checks locally.
@@ -17,6 +19,8 @@ If you are browsing docs rather than reorganizing them, start with these directo
- [Architecture](architecture/README.md): implementation notes and internal design docs.
- [Migration](migration/README.md): upgrade and migration notes.
The maintained deployment and model guides are [Docker](guides/docker.md), [providers](guides/providers.md), and [troubleshooting](operations/troubleshooting.md). [Office Skills](guides/office-skills.zh.md) describe the separate document runtime. Design and migration documents may describe historical implementations; they are not installation instructions.
For channel-specific setup, start with [Chat Apps Configuration](guides/chat-apps.md) and then drill into `docs/channels/<name>/README.md` as needed.
## Principles
@@ -29,8 +33,8 @@ For channel-specific setup, start with [Chat Apps Configuration](guides/chat-app
## Recommended Directories
- `README.md`: English project entry document at the repository root.
- `docs/project/`: translated project entry documents such as `README.zh.md` and `CONTRIBUTING.zh.md`.
- `README.md`: maintained Chinese project entry document at the repository root.
- `docs/project/`: supporting project documents such as `CONTRIBUTING.zh.md`. Project overview links should point to the root `README.md`.
- `docs/guides/`: setup and usage guides.
- `docs/reference/`: reference material and detailed configuration docs.
- `docs/operations/`: debugging and troubleshooting docs.
@@ -55,8 +59,8 @@ For channel-specific setup, start with [Chat Apps Configuration](guides/chat-app
## Common Patterns To Avoid
- Root-level translated entry docs such as `README.zh.md` or `CONTRIBUTING.fr.md`
- Use `docs/project/README.zh.md` or `docs/project/CONTRIBUTING.fr.md` instead.
- Duplicate project READMEs and root-level contribution translations
- Link to the root `README.md` for the project overview; keep contribution translations under `docs/project/`, such as `CONTRIBUTING.fr.md`.
- Language directories under `docs/` such as `docs/zh/`, `docs/ZH/`, `docs/ja/`, or `docs/fr/`
- Use `docs/<type>/<name>.<locale>.md` instead.
- Nested locale buckets such as `docs/guides/zh/configuration.md` or `docs/channels/telegram/zh/README.md`
@@ -69,10 +73,9 @@ For channel-specific setup, start with [Chat Apps Configuration](guides/chat-app
## Translation Placement
- For docs under `docs/guides`, `docs/reference`, `docs/operations`, `docs/security`, `docs/architecture`, `docs/channels`, and `docs/migration`, keep translations beside the English source file.
- For project entry translations, keep translated files in `docs/project/` and keep the English source in the repository root.
- For contribution guide translations, keep translated files in `docs/project/` and the English source in the repository root.
- In most cases, each translated file should have an English source document:
- `docs/guides/configuration.zh.md` usually sits beside `docs/guides/configuration.md`
- `docs/project/README.zh.md` usually corresponds to `README.md`
- Exception: `docs/design/` may contain locale-specific working notes without an English source document. The naming rules still apply there.
## Code-Adjacent Docs
+1 -1
View File
@@ -1,6 +1,6 @@
# Routing System
> Back to [README](../README.md)
> Back to [README](../../README.md)
In PicoClaw, the runtime "routing system" is not just one decision.
It is the combined pipeline that decides:
+12 -81
View File
@@ -1,6 +1,6 @@
# Session System
> Back to [README](../README.md)
> Back to [README](../../README.md)
This document describes the runtime session system used by PicoClaw to:
@@ -17,16 +17,15 @@ The session system has four jobs:
1. Decide which messages should share the same conversation context.
2. Persist that context durably across turns and restarts.
3. Expose a small `SessionStore` interface to the agent loop.
4. Keep older session-key formats working during storage and routing migrations.
4. Resolve session aliases used by routing and tools.
## Main Components
| Layer | Files | Responsibility |
| --- | --- | --- |
| Session contract | `pkg/session/session_store.go` | Defines the `SessionStore` interface used by the agent loop. |
| Legacy backend | `pkg/session/manager.go` | Stores one JSON file per session. Still used as a fallback. |
| Session adapter | `pkg/session/jsonl_backend.go` | Adapts `pkg/memory.Store` to `SessionStore`, including alias and scope metadata support. |
| Durable storage | `pkg/memory/jsonl.go` | Append-only JSONL storage plus `.meta.json` sidecar metadata. |
| Session adapter | `pkg/session/sqlite_backend.go` | Implements `SessionStore` and handles aliases and scopes. |
| Durable storage | `pkg/memory/sqlite.go` | Stores sessions, messages and aliases in SQLite. |
| Scope and key building | `pkg/session/scope.go`, `pkg/session/key.go`, `pkg/session/allocator.go` | Builds structured scopes, opaque canonical keys, and legacy aliases from routing results. |
| Runtime integration | `pkg/agent/instance.go`, `pkg/agent/agent.go`, `pkg/agent/agent_message.go` | Initializes the store, allocates session scope, and persists metadata before turns run. |
@@ -81,8 +80,8 @@ agent:main:feishu:channel:c001
agent:main:pico:direct:pico:session-123
```
These aliases matter because older sessions, tests, and some tools still refer to the legacy shape.
The JSONL backend resolves aliases back to the canonical key before reads and writes.
Some tools and tests use these aliases.
The SQLite session store resolves aliases back to the canonical key before reads and writes.
The agent loop also preserves explicit incoming session keys when the caller already supplied one of the recognized explicit formats:
@@ -115,7 +114,7 @@ More concretely:
- `MainSessionKey`: agent-level main session key
- `MainAliases`: legacy alias for the main session
4. `runAgentLoop` persists scope metadata and aliases through `ensureSessionMetadata`.
5. During later reads or writes, `JSONLBackend.ResolveSessionKey` maps aliases back onto the canonical key.
5. During later reads or writes, `SQLiteSessionStore.ResolveSessionKey` maps aliases back onto the canonical key.
The main session key is separate from routed chat sessions.
It is mainly used for agent-level or system-style flows that need one stable per-agent conversation, for example `processSystemMessage`.
@@ -151,79 +150,11 @@ Those produce different session keys.
`session.identity_links` lets multiple sender identifiers collapse into one canonical identity.
Both dispatch matching and session allocation use that mapping so that the same person can keep one conversation even if their raw sender IDs differ across channels or accounts.
## Storage Format
## Storage and commits
The default runtime backend is `pkg/memory.JSONLStore`, wrapped by `session.JSONLBackend`.
SQLite is the runtime session store. Each `PICOCLAW_HOME` has one database. The `sessions` table stores summaries, scopes and revisions, `session_messages` stores messages, and `session_aliases` stores routing aliases.
Each session uses two files:
```text
{sanitized_key}.jsonl
{sanitized_key}.meta.json
```
The files store:
- `.jsonl`: one `providers.Message` per line, append-only
- `.meta.json`: summary, timestamps, line counts, logical truncation offset, scope, aliases
`SessionMeta` currently includes:
- `Key`
- `Summary`
- `Skip`
- `Count`
- `CreatedAt`
- `UpdatedAt`
- `Scope`
- `Aliases`
## Write And Crash Semantics
The JSONL store is designed around append-first durability and stale-over-loss recovery:
- `AddMessage` and `AddFullMessage` append one JSON line, `fsync`, then update metadata.
- `TruncateHistory` is logical first: it only advances `meta.Skip`.
- `Compact` physically rewrites the JSONL file to remove skipped lines.
- `SetHistory` and `Compact` write metadata before rewriting JSONL so a crash may temporarily expose old data, but should not lose data.
- Corrupt JSONL lines are skipped during reads instead of failing the entire session.
`JSONLBackend.Save` maps onto `store.Compact(...)`.
In other words, `Save` is no longer "flush dirty memory to disk"; it is now "reclaim dead lines after logical truncation".
## Concurrency Model
`pkg/memory.JSONLStore` uses a fixed 64-shard mutex array keyed by session hash.
That gives per-session serialization without keeping an unbounded mutex map in memory.
The legacy `SessionManager` uses a single in-memory map guarded by an RW mutex.
Both backends satisfy the same `SessionStore` interface, which is why the agent loop does not need storage-specific code.
## Compatibility And Migration
`pkg/agent/instance.go:initSessionStore` prefers the JSONL backend.
Startup sequence:
1. Create `memory.NewJSONLStore(dir)`.
2. Run `memory.MigrateFromJSON(...)` to import legacy `.json` sessions.
3. Wrap the store with `session.NewJSONLBackend(store)`.
4. If JSONL initialization or migration fails, fall back to `session.NewSessionManager(dir)`.
This fallback is intentional: a partial migration would be worse than staying on the legacy store for one run.
### Alias promotion
When canonical metadata is first created, `EnsureSessionMetadata` may promote history from a non-empty legacy alias into the canonical session.
That promotion only happens when the canonical session is still empty, so active canonical history is not overwritten.
This is how the system preserves old histories such as:
- legacy direct-message keys
- older Pico direct-session keys
while moving the runtime onto opaque canonical keys.
Ordinary turns commit at the end. Long turns can commit after a complete tool batch, and committed messages survive process exit. Summary compaction and conversation clearing use session revisions so stale writes cannot restore cleared history.
## Other SessionStore Implementations
@@ -243,11 +174,11 @@ The session system is consumed by more than the agent loop:
- `pkg/session/session_store.go`
- `pkg/session/manager.go`
- `pkg/session/jsonl_backend.go`
- `pkg/session/sqlite_backend.go`
- `pkg/session/scope.go`
- `pkg/session/key.go`
- `pkg/session/allocator.go`
- `pkg/memory/jsonl.go`
- `pkg/memory/sqlite.go`
- `pkg/agent/instance.go`
- `pkg/agent/agent.go`
- `pkg/agent/agent_message.go`
+11 -78
View File
@@ -17,16 +17,15 @@ Session 系统承担四件事:
1. 决定哪些消息应该共享同一段上下文。
2. 让这段上下文能跨 turn、跨进程重启持久存在。
3. 向 agent loop 暴露一个足够小的 `SessionStore` 抽象。
4. 在存储层和路由层迁移期间继续兼容旧 session key。
4. 解析路由和工具使用的会话别名。
## 主要组件
| 层次 | 文件 | 作用 |
| --- | --- | --- |
| Session 抽象 | `pkg/session/session_store.go` | 定义 agent loop 依赖的 `SessionStore` 接口。 |
| 旧后端 | `pkg/session/manager.go` | 每个 session 一个 JSON 文件的旧实现,仍作为回退方案保留。 |
| Session 适配层 | `pkg/session/jsonl_backend.go` | 把 `pkg/memory.Store` 适配成 `SessionStore`,并支持 alias 与 scope metadata。 |
| 持久化存储 | `pkg/memory/jsonl.go` | Append-only JSONL 存储与 `.meta.json` 元数据侧文件。 |
| Session 适配层 | `pkg/session/sqlite_backend.go` | 提供 `SessionStore` 接口,处理会话别名和作用域。 |
| 持久化存储 | `pkg/memory/sqlite.go` | 在 SQLite 中保存会话、消息和别名。 |
| Scope / Key 构建 | `pkg/session/scope.go`、`pkg/session/key.go`、`pkg/session/allocator.go` | 从路由结果生成结构化 scope、不透明 canonical key 和 legacy alias。 |
| 运行时集成 | `pkg/agent/instance.go`、`pkg/agent/loop.go`、`pkg/agent/loop_message.go` | 初始化存储、分配 session scope,并在 turn 执行前落 metadata。 |
@@ -81,8 +80,8 @@ agent:main:feishu:channel:c001
agent:main:pico:direct:pico:session-123
```
这些 alias 很重要,因为旧 session、部分测试以及某些工具仍然会引用这种格式。
JSONL backend 会在读写前先把 alias 解析回 canonical key。
部分工具和测试使用这类别名。
SQLite session store 会在读写前先把 alias 解析回 canonical key。
此外,如果调用方已经显式传入了受支持的 session key,agent loop 会保留它,不强行改成新分配的 routed key。
这条逻辑在 `pkg/agent/loop_utils.go:resolveScopeKey` 中:
@@ -116,7 +115,7 @@ InboundMessage
- `MainSessionKey`:agent 级主会话 key
- `MainAliases`:主会话对应的 legacy alias
4. `runAgentLoop` 通过 `ensureSessionMetadata` 持久化 scope metadata 和 alias。
5. 后续读写时,`JSONLBackend.ResolveSessionKey` 会先把 alias 映射回 canonical key。
5. 后续读写时,`SQLiteSessionStore.ResolveSessionKey` 会先把 alias 映射回 canonical key。
`MainSessionKey` 和普通聊天会话是分开的。
它主要服务于 agent 级、系统级的上下文场景,比如 `processSystemMessage`。
@@ -152,77 +151,11 @@ group:-1001234567890/99
`session.identity_links` 可以把多个 sender 标识折叠为一个 canonical identity。
dispatch 匹配和 session 分配都会使用这套映射,因此同一个人即使跨 channel 或 account 使用不同原始 sender ID,也可以继续落到同一段上下文里。
## 存储格式
## 存储与提交
默认运行时后端是 `pkg/memory.JSONLStore`,外面包了一层 `session.JSONLBackend`。
SQLite 是运行时会话存储。每个 `PICOCLAW_HOME` 有一份数据库,`sessions` 保存摘要、作用域和版本,`session_messages` 保存消息,`session_aliases` 保存路由别名。
每个 session 使用两类文件:
```text
{sanitized_key}.jsonl
{sanitized_key}.meta.json
```
各自保存:
- `.jsonl`:一行一个 `providers.Message`,append-only
- `.meta.json`:摘要、时间戳、行数、逻辑截断偏移、scope、aliases
`SessionMeta` 当前包含:
- `Key`
- `Summary`
- `Skip`
- `Count`
- `CreatedAt`
- `UpdatedAt`
- `Scope`
- `Aliases`
## 写入与崩溃语义
JSONL store 的设计核心是“追加优先、宁可暂时读到旧数据也不要丢数据”:
- `AddMessage` / `AddFullMessage` 先追加一行 JSON,再 `fsync`,最后更新 metadata。
- `TruncateHistory` 先做逻辑截断,本质上只是推进 `meta.Skip`。
- `Compact` 才会真正重写 JSONL 文件,把被跳过的旧行物理移除。
- `SetHistory` 和 `Compact` 都会先写 metadata 再改写 JSONL;如果中途崩溃,最多短时间暴露旧数据,不应丢数据。
- 读取 JSONL 时如果碰到损坏行,会跳过该行,而不是让整个 session 读取失败。
`JSONLBackend.Save` 对应到底层的 `store.Compact(...)`。
也就是说,`Save` 在新实现里不再是“把内存脏数据刷盘”,而是“在逻辑截断后回收无效行占用的磁盘空间”。
## 并发模型
`pkg/memory.JSONLStore` 使用固定 64 分片 mutex,按 session key 的 hash 做串行化。
这样既能做到“按 session 串行”,又不会因为 session 数量增长而把 mutex map 做成无界结构。
旧的 `SessionManager` 则是一个内存 map 加 RW mutex。
这两个实现都满足同一个 `SessionStore` 接口,所以 agent loop 不需要写任何存储后端特化逻辑。
## 兼容与迁移
`pkg/agent/instance.go:initSessionStore` 会优先初始化 JSONL 后端。
启动过程如下:
1. 创建 `memory.NewJSONLStore(dir)`。
2. 执行 `memory.MigrateFromJSON(...)`,把旧 `.json` session 迁入新格式。
3. 用 `session.NewJSONLBackend(store)` 包装。
4. 如果 JSONL 初始化或迁移失败,则回退到 `session.NewSessionManager(dir)`。
这个回退是刻意设计的:做一半的迁移,比整轮继续使用旧后端更危险。
### Alias 提升
第一次为 canonical key 建 metadata 时,`EnsureSessionMetadata` 会尝试把某个非空 legacy alias 的历史提升到 canonical session。
但这件事只会在 canonical session 仍然为空时发生,因此不会覆盖已经存在的 canonical 历史。
这保证了系统在迁移到 opaque key 的同时,仍能保留旧历史,例如:
- 旧的 direct-message key
- 旧的 Pico direct-session key
普通问答在轮末提交。长轮次可以在完整工具批次结束后提交,进程退出时已提交的消息仍可恢复。摘要压缩与清理按会话版本校验,避免过时的写入恢复已经清空的历史。
## 其他 SessionStore 实现
@@ -242,11 +175,11 @@ Session 系统不只被 agent loop 使用:
- `pkg/session/session_store.go`
- `pkg/session/manager.go`
- `pkg/session/jsonl_backend.go`
- `pkg/session/sqlite_backend.go`
- `pkg/session/scope.go`
- `pkg/session/key.go`
- `pkg/session/allocator.go`
- `pkg/memory/jsonl.go`
- `pkg/memory/sqlite.go`
- `pkg/agent/instance.go`
- `pkg/agent/loop.go`
- `pkg/agent/loop_message.go`
+1 -1
View File
@@ -1,6 +1,6 @@
# 🔄 SubTurn Mechanism
> Back to [README](../README.md)
> Back to [README](../../README.md)
## Overview
+6 -4
View File
@@ -1,4 +1,4 @@
> Retour au [README](../../project/README.fr.md)
> Retour au [README](../../../README.md)
# DingTalk
@@ -12,9 +12,11 @@ DingTalk est la plateforme de communication d'entreprise d'Alibaba, très popula
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> [README](../../project/README.ja.md) に戻る
> [README](../../../README.md) に戻る
# DingTalk
@@ -12,9 +12,11 @@ DingTalkはアリババの企業向けコミュニケーションプラットフ
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
+7 -3
View File
@@ -6,15 +6,19 @@ DingTalk is Alibaba's enterprise communication platform, widely used in Chinese
## Configuration
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Voltar ao [README](../../project/README.pt-br.md)
> Voltar ao [README](../../../README.md)
# DingTalk
@@ -12,9 +12,11 @@ DingTalk é a plataforma de comunicação empresarial da Alibaba, amplamente uti
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Quay lại [README](../../project/README.vi.md)
> Quay lại [README](../../../README.md)
# DingTalk
@@ -12,9 +12,11 @@ DingTalk là nền tảng giao tiếp doanh nghiệp của Alibaba, được s
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
+8 -4
View File
@@ -1,4 +1,4 @@
> 返回 [README](../../project/README.zh.md)
> 返回 [README](../../../README.md)
# 钉钉
@@ -6,15 +6,19 @@
## 配置
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
+9 -7
View File
@@ -1,4 +1,4 @@
> Retour au [README](../../project/README.fr.md)
> Retour au [README](../../../README.md)
# Feishu
@@ -12,11 +12,13 @@ Feishu (nom international : Lark) est une plateforme de collaboration d'entrepri
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": ""
}
}
}
}
@@ -30,7 +32,7 @@ Feishu (nom international : Lark) est une plateforme de collaboration d'entrepri
| encrypt_key | string | Non | Clé de chiffrement pour les callbacks d'événements |
| verification_token | string | Non | Token utilisé pour la vérification des événements Webhook |
| allow_from | array | Non | Liste blanche d'identifiants utilisateur ; vide signifie tous les utilisateurs |
| random_reaction_emoji | array | Non | Liste d'emojis de réaction aléatoires ; vide utilise le "Pin" par défaut |
| random_reaction_emoji | array | Non | Liste d'emojis de réaction aléatoires ; vide utilise le "Typing" par défaut |
## Configuration initiale
+9 -7
View File
@@ -1,4 +1,4 @@
> [README](../../project/README.ja.md) に戻る
> [README](../../../README.md) に戻る
# 飛書(Feishu)
@@ -12,11 +12,13 @@
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": ""
}
}
}
}
@@ -30,7 +32,7 @@
| encrypt_key | string | いいえ | イベントコールバックの暗号化キー |
| verification_token | string | いいえ | Webhook イベント検証に使用するトークン |
| allow_from | array | いいえ | 許可するユーザーIDのリスト。空の場合はすべてのユーザーを許可 |
| random_reaction_emoji | array | いいえ | ランダムに追加する絵文字のリスト。空の場合はデフォルトの "Pin" を使用 |
| random_reaction_emoji | array | いいえ | ランダムに追加する絵文字のリスト。空の場合はデフォルトの "Typing" を使用 |
## セットアップ手順
+10 -6
View File
@@ -6,17 +6,21 @@ Feishu (international name: Lark) is an enterprise collaboration platform by Byt
## Configuration
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": ""
}
}
}
}
@@ -30,7 +34,7 @@ Feishu (international name: Lark) is an enterprise collaboration platform by Byt
| encrypt_key | string | No | Encryption key for event callbacks |
| verification_token | string | No | Token used for Webhook event verification |
| allow_from | array | No | Allowlist of user IDs; empty means all users are allowed |
| random_reaction_emoji | array | No | List of random reaction emojis; empty uses the default "Pin" |
| random_reaction_emoji | array | No | List of random reaction emojis; empty uses the default "Typing" |
## Setup
+9 -7
View File
@@ -1,4 +1,4 @@
> Voltar ao [README](../../project/README.pt-br.md)
> Voltar ao [README](../../../README.md)
# Feishu
@@ -12,11 +12,13 @@ Feishu (nome internacional: Lark) é uma plataforma de colaboração empresarial
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": ""
}
}
}
}
@@ -30,7 +32,7 @@ Feishu (nome internacional: Lark) é uma plataforma de colaboração empresarial
| encrypt_key | string | Não | Chave de criptografia para callbacks de eventos |
| verification_token | string | Não | Token usado para verificação de eventos Webhook |
| allow_from | array | Não | Lista de IDs de usuários permitidos; vazio significa todos os usuários |
| random_reaction_emoji | array | Não | Lista de emojis de reação aleatórios; vazio usa o "Pin" padrão |
| random_reaction_emoji | array | Não | Lista de emojis de reação aleatórios; vazio usa o "Typing" padrão |
## Configuração inicial
+9 -7
View File
@@ -1,4 +1,4 @@
> Quay lại [README](../../project/README.vi.md)
> Quay lại [README](../../../README.md)
# Feishu
@@ -12,11 +12,13 @@ Feishu (tên quốc tế: Lark) là nền tảng cộng tác doanh nghiệp củ
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": ""
}
}
}
}
@@ -30,7 +32,7 @@ Feishu (tên quốc tế: Lark) là nền tảng cộng tác doanh nghiệp củ
| encrypt_key | string | Không | Khóa mã hóa cho callback sự kiện |
| verification_token | string | Không | Token dùng để xác minh sự kiện Webhook |
| allow_from | array | Không | Danh sách trắng ID người dùng; để trống nghĩa là cho phép tất cả |
| random_reaction_emoji | array | Không | Danh sách emoji phản ứng ngẫu nhiên; để trống dùng "Pin" mặc định |
| random_reaction_emoji | array | Không | Danh sách emoji phản ứng ngẫu nhiên; để trống dùng "Typing" mặc định |
## Hướng dẫn thiết lập
+14 -10
View File
@@ -1,23 +1,27 @@
> 返回 [README](../../project/README.zh.md)
> 返回 [README](../../../README.md)
# 飞书
飞书(国际版名称:Lark)是字节跳动旗下的企业协作平台。它通过事件驱动的 Webhook 同时支持中国和全球市场。
飞书(国际版名称:Lark)是字节跳动旗下的企业协作平台。本 fork 使用 WebSocket 长连接接收事件,无需公网 Webhook 回调地址。
## 配置
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"allow_from": [],
"is_lark": false
"settings": {
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
"verification_token": "",
"is_lark": false
}
}
}
}
@@ -29,16 +33,16 @@
| app_id | string | 是 | 飞书应用的 App ID(以cli\_开头) |
| app_secret | string | 是 | 飞书应用的 App Secret |
| encrypt_key | string | 否 | 事件回调加密密钥 |
| verification_token | string | 否 | 用于Webhook事件验证的Token |
| verification_token | string | 否 | 可选事件校验 Token,长连接模式无需配置公网回调 URL |
| allow_from | array | 否 | 用户ID白名单,空表示所有用户 |
| random_reaction_emoji | array | 否 | 随机添加的表情列表,空则使用默认 "Pin" |
| random_reaction_emoji | array | 否 | 随机添加的表情列表,空则使用默认 "Typing"(敲键盘) |
| is_lark | bool | 否 | 是否使用 Lark 国际版域名(`open.larksuite.com`),默认为 `false`(使用飞书域名 `open.feishu.cn`) |
## 设置流程
1. 前往 [飞书开放平台](https://open.feishu.cn/)(国际版用户请前往 [Lark 开放平台](https://open.larksuite.com/))创建应用程序
2. 获取 App ID 和 App Secret
3. 配置事件订阅和Webhook URL
3. 在开放平台的事件订阅中选择长连接接收事件,并订阅所需的消息事件
4. 设置加密(可选,生产环境建议启用)
5. 将 App ID、App Secret、Encrypt Key 和 Verification Token(如果启用加密) 填入配置文件中
6. 自定义你希望 PicoClaw react 你消息时的表情(可选, Reference URL: [Feishu Emoji List](https://open.larkoffice.com/document/server-docs/im-v1/message-reaction/emojis-introduce))
+2
View File
@@ -6,6 +6,8 @@ PicoClaw supports any MQTT client as a chat channel. Devices or services publish
**1. Add the channel to `~/.picoclaw/config.json`:**
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
+2
View File
@@ -6,6 +6,8 @@ PicoClaw 支持将任意 MQTT 客户端作为消息渠道。设备或服务向 B
**1. 在 `~/.picoclaw/config.json` 中添加渠道:**
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
+6 -4
View File
@@ -1,4 +1,4 @@
> Retour au [README](../../project/README.fr.md)
> Retour au [README](../../../README.md)
# OneBot
@@ -12,9 +12,11 @@ OneBot est un standard de protocole ouvert pour les bots QQ, fournissant une int
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://localhost:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://localhost:8080",
"access_token": ""
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> [README](../../project/README.ja.md) に戻る
> [README](../../../README.md) に戻る
# OneBot
@@ -12,9 +12,11 @@ OneBot は QQ ボット向けのオープンプロトコル標準で、複数の
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://localhost:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://localhost:8080",
"access_token": ""
}
}
}
}
+7 -3
View File
@@ -6,15 +6,19 @@ OneBot is an open protocol standard for QQ bots, providing a unified interface f
## Configuration
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://localhost:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://localhost:8080",
"access_token": ""
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Voltar ao [README](../../project/README.pt-br.md)
> Voltar ao [README](../../../README.md)
# OneBot
@@ -12,9 +12,11 @@ OneBot é um padrão de protocolo aberto para bots QQ, fornecendo uma interface
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://localhost:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://localhost:8080",
"access_token": ""
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Quay lại [README](../../project/README.vi.md)
> Quay lại [README](../../../README.md)
# OneBot
@@ -12,9 +12,11 @@ OneBot là tiêu chuẩn giao thức mở dành cho bot QQ, cung cấp giao di
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://localhost:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://localhost:8080",
"access_token": ""
}
}
}
}
+8 -4
View File
@@ -1,4 +1,4 @@
> 返回 [README](../../project/README.zh.md)
> 返回 [README](../../../README.md)
# OneBot
@@ -6,15 +6,19 @@ OneBot 是一个面向 QQ 机器人的开放协议标准,为多种 QQ 机器
## 配置
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://localhost:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://localhost:8080",
"access_token": ""
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Retour au [README](../../project/README.fr.md)
> Retour au [README](../../../README.md)
# QQ
@@ -12,9 +12,11 @@ PicoClaw prend en charge QQ via l'API Bot officielle de la plateforme ouverte QQ
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> [README](../../project/README.ja.md) に戻る
> [README](../../../README.md) に戻る
# QQ
@@ -12,9 +12,11 @@ PicoClaw は QQ オープンプラットフォームの公式 Bot API を通じ
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
+7 -3
View File
@@ -6,15 +6,19 @@ PicoClaw provides QQ support via the official Bot API from the QQ Open Platform.
## Configuration
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Voltar ao [README](../../project/README.pt-br.md)
> Voltar ao [README](../../../README.md)
# QQ
@@ -12,9 +12,11 @@ O PicoClaw oferece suporte ao QQ via API Bot oficial da Plataforma Aberta QQ.
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
+6 -4
View File
@@ -1,4 +1,4 @@
> Quay lại [README](../../project/README.vi.md)
> Quay lại [README](../../../README.md)
# QQ
@@ -12,9 +12,11 @@ PicoClaw hỗ trợ QQ thông qua API Bot chính thức của Nền tảng Mở
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
+8 -4
View File
@@ -1,4 +1,4 @@
> 返回 [README](../../project/README.zh.md)
> 返回 [README](../../../README.md)
# QQ
@@ -6,16 +6,20 @@ PicoClaw 通过 QQ 开放平台的官方机器人 API 提供对 QQ 的支持。
## 配置
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": [],
"max_base64_file_size_mib": 0
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"max_base64_file_size_mib": 0
}
}
}
}
+16 -8
View File
@@ -1,4 +1,4 @@
> Retour au [README](../../project/README.fr.md)
> Retour au [README](../../../README.md)
# Telegram
@@ -12,10 +12,14 @@ Le canal Telegram utilise le long polling via l'API Bot Telegram pour une commun
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"allow_from": ["123456789"],
"proxy": "",
"use_markdown_v2": false
"allow_from": [
"123456789"
],
"settings": {
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"proxy": "",
"use_markdown_v2": false
}
}
}
}
@@ -47,9 +51,13 @@ Vous pouvez définir `use_markdown_v2: true` pour activer les options de formata
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": true
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": true
}
}
}
}
+16 -8
View File
@@ -1,4 +1,4 @@
> [README](../../project/README.ja.md) に戻る
> [README](../../../README.md) に戻る
# Telegram
@@ -12,10 +12,14 @@ Telegram チャンネルは、Telegram Bot API を使用したロングポーリ
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"allow_from": ["123456789"],
"proxy": "",
"use_markdown_v2": false
"allow_from": [
"123456789"
],
"settings": {
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"proxy": "",
"use_markdown_v2": false
}
}
}
}
@@ -47,9 +51,13 @@ Telegram チャンネルは、Telegram Bot API を使用したロングポーリ
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": true
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": true
}
}
}
}
+19 -9
View File
@@ -2,21 +2,27 @@
# Telegram
The Telegram channel uses long polling via the Telegram Bot API for bot-based communication. It supports text messages, media attachments (photos, voice, audio, documents), voice transcription ([setup](../../guides/providers.md#voice-transcription)), and built-in command handling.
The Telegram channel uses long polling via the Telegram Bot API for bot-based communication. It supports text messages, media attachments (photos, voice, audio, documents), voice transcription ([setup](../../../pkg/audio/asr/README.md)), and built-in command handling.
## Configuration
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"allow_from": ["123456789"],
"proxy": "",
"use_markdown_v2": false,
"media_group_delay_ms": 500
"allow_from": [
"123456789"
],
"settings": {
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"proxy": "",
"use_markdown_v2": false,
"media_group_delay_ms": 500
}
}
}
}
@@ -73,9 +79,13 @@ You can set `use_markdown_v2: true` to enable enhanced formatting options. This
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": true
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": true
}
}
}
}
+16 -8
View File
@@ -1,4 +1,4 @@
> Voltar ao [README](../../project/README.pt-br.md)
> Voltar ao [README](../../../README.md)
# Telegram
@@ -12,10 +12,14 @@ O canal Telegram utiliza long polling via a API de Bot do Telegram para comunica
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"allow_from": ["123456789"],
"proxy": "",
"use_markdown_v2": false
"allow_from": [
"123456789"
],
"settings": {
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"proxy": "",
"use_markdown_v2": false
}
}
}
}
@@ -47,9 +51,13 @@ Você pode definir `use_markdown_v2: true` para habilitar opções de formataç
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": true
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": true
}
}
}
}
+16 -8
View File
@@ -1,4 +1,4 @@
> Quay lại [README](../../project/README.vi.md)
> Quay lại [README](../../../README.md)
# Telegram
@@ -12,10 +12,14 @@ Kênh Telegram sử dụng long polling qua Telegram Bot API để giao tiếp d
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"allow_from": ["123456789"],
"proxy": "",
"use_markdown_v2": false
"allow_from": [
"123456789"
],
"settings": {
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"proxy": "",
"use_markdown_v2": false
}
}
}
}
@@ -47,9 +51,13 @@ Bạn có thể đặt `use_markdown_v2: true` để bật các tùy chọn đ
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": true
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": true
}
}
}
}
+19 -9
View File
@@ -1,21 +1,27 @@
> 返回 [README](../../project/README.zh.md)
> 返回 [README](../../../README.md)
# Telegram
Telegram Channel 通过 Telegram 机器人 API 使用长轮询实现基于机器人的通信。它支持文本消息、媒体附件(照片、语音、音频、文档)、语音转录(配置见[提供商与模型配置](../../guides/providers.zh.md#语音转录)),以及内置命令处理器。
Telegram Channel 通过 Telegram 机器人 API 使用长轮询实现基于机器人的通信。它支持文本消息、媒体附件(照片、语音、音频、文档)、语音转录(配置见[提供商与模型配置](../../../pkg/audio/asr/README.zh.md)),以及内置命令处理器。
## 配置
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"allow_from": ["123456789"],
"proxy": "",
"use_markdown_v2": false
"allow_from": [
"123456789"
],
"settings": {
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"proxy": "",
"use_markdown_v2": false
}
}
}
}
@@ -67,9 +73,13 @@ explain how to squash the last 3 commits
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": true
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": true
}
}
}
}
+8 -6
View File
@@ -1,4 +1,4 @@
> Retour au [README](../../project/README.fr.md)
> Retour au [README](../../../README.md)
# WeCom
@@ -52,12 +52,14 @@ Si vous disposez déjà d'un `bot_id` et d'un `secret` depuis la plateforme WeCo
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
+8 -6
View File
@@ -1,4 +1,4 @@
> [README](../../project/README.ja.md) に戻る
> [README](../../../README.md) に戻る
# WeCom
@@ -52,12 +52,14 @@ WeCom AI Bot プラットフォームから `bot_id` と `secret` を既にお
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
+10 -6
View File
@@ -46,18 +46,22 @@ picoclaw auth wecom --timeout 10m
If you already have a `bot_id` and `secret` from the WeCom AI Bot platform, configure directly:
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
@@ -138,4 +142,4 @@ All fields can be overridden via environment variables with the prefix `PICOCLAW
### Replies do not arrive
- Check whether `allow_from` is blocking the sender.
- Check that `channels.wecom.bot_id` and `channels.wecom.secret` are set and non-empty.
- Check that `channel_list.wecom.settings.bot_id` and `channel_list.wecom.settings.secret` are set and non-empty.
+8 -6
View File
@@ -1,4 +1,4 @@
> Voltar ao [README](../../project/README.pt-br.md)
> Voltar ao [README](../../../README.md)
# WeCom
@@ -52,12 +52,14 @@ Se você já possui um `bot_id` e `secret` da plataforma WeCom AI Bot, configure
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
+8 -6
View File
@@ -1,4 +1,4 @@
> Quay lại [README](../../project/README.vi.md)
> Quay lại [README](../../../README.md)
# WeCom
@@ -52,12 +52,14 @@ Nếu bạn đã có `bot_id` và `secret` từ nền tảng WeCom AI Bot, hãy
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
+12 -8
View File
@@ -1,4 +1,4 @@
> 返回 [README](../../project/README.zh.md)
> 返回 [README](../../../README.md)
# 企业微信(WeCom)
@@ -32,7 +32,7 @@ picoclaw auth wecom
1. 向企业微信请求二维码并在终端打印
2. 同时打印一个**二维码链接**,终端二维码不清晰时可在浏览器中打开
3. 轮询确认状态——扫码后还需要在**企业微信 App 内点击确认**
4. 成功后将 `bot_id` 和 `secret` 写入 `channels.wecom` 并保存配置
4. 成功后将 `bot_id` 和 `secret` 写入 `channel_list.wecom.settings` 并保存配置
默认超时为 **5 分钟**,可通过 `--timeout` 延长:
@@ -46,18 +46,22 @@ picoclaw auth wecom --timeout 10m
如果已有企业微信 AI Bot 的 `bot_id` 和 `secret`,可直接配置:
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
@@ -138,4 +142,4 @@ picoclaw auth wecom --timeout 10m
### 收不到回复
- 检查 `allow_from` 是否屏蔽了发送者。
- 确认 `channels.wecom.bot_id` 和 `channels.wecom.secret` 已填写且非空。
- 确认 `channel_list.wecom.settings.bot_id` 和 `channel_list.wecom.settings.secret` 已填写且非空。
+7 -3
View File
@@ -25,7 +25,9 @@ picoclaw gateway
## ⚙️ Configuration
You can also manually configure the filter rules in `config.json` under the `channels.weixin` section.
You can also manually configure the filter rules in `config.json` under the `channel_list.weixin` section.
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
@@ -33,12 +35,14 @@ You can also manually configure the filter rules in `config.json` under the `cha
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_WEIXIN_TOKEN",
"allow_from": [
"user_id_1",
"user_id_2"
],
"proxy": ""
"settings": {
"token": "YOUR_WEIXIN_TOKEN",
"proxy": ""
}
}
}
}
+7 -3
View File
@@ -25,7 +25,9 @@ picoclaw gateway
## ⚙️ 配置说明
您也可以在 `config.json` 的 `channels.weixin` 段目下进行手动维护。
您也可以在 `config.json` 的 `channel_list.weixin` 段目下进行手动维护。
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
@@ -33,12 +35,14 @@ picoclaw gateway
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_WEIXIN_TOKEN",
"allow_from": [
"user_id_1",
"user_id_2"
],
"proxy": ""
"settings": {
"token": "YOUR_WEIXIN_TOKEN",
"proxy": ""
}
}
}
}
@@ -1,89 +0,0 @@
# 当前硬件支持现状与串口 Tool 方案
## 现状结论
当前项目已有的硬件相关能力主要分为两条线:
1. 设备事件监控
- `pkg/devices` 已实现设备事件服务。
- 当前只有 Linux USB 热插拔事件源 `pkg/devices/sources/usb_linux.go`。
- 能力定位是“发现和通知”,不是“总线读写控制”。
2. 硬件控制 Tool
- `pkg/tools/hardware/i2c*.go`:I2C Tool,支持 `detect`、`scan`、`read`、`write`。
- `pkg/tools/hardware/spi*.go`:SPI Tool,支持 `list`、`transfer`、`read`。
- 这两类 Tool 当前都只在 Linux 主机上启用,直接依赖 `/dev/i2c-*` 与 `/dev/spidev*`。
因此,项目在“硬件支持能力”上已经具备:
- Linux USB 设备插拔感知
- Linux I2C 总线控制
- Linux SPI 总线控制
但还缺少:
- 串口/UART 控制
- macOS / Windows 下可直接使用的硬件控制 Tool
- 面向统一硬件抽象的跨总线能力模型
## 本次新增
本次新增内建 `serial` Tool,并接入现有 Tool 体系:
- 配置项:`tools.serial.enabled`
- Tool 注册:`pkg/agent/agent_init.go`
## Serial Tool 设计
`serial` 采用无状态调用模型,每次请求都自行打开和关闭端口,避免在 agent 回合之间维护串口会话状态。
支持动作:
- `list`:枚举主机串口
- `read`:从串口读取指定长度字节
- `write`:向串口写入字节或文本
公共参数:
- `port`
- `baud`
- `data_bits`
- `parity`
- `stop_bits`
- `timeout_ms`
当前波特率实现边界:
- Windows 允许配置工具层接受的范围 `50-4000000`
- Linux / macOS 当前仅支持标准 termios 波特率,实际支持到 `230400`
- 因此 `baud` 的跨平台可移植取值应优先使用 `230400` 及以下的常见标准速率
安全约束:
- `write` 必须显式传 `confirm: true`
- 单次读写负载限制为 `4096` 字节
- `port` 只接受白名单串口名:
- Linux / macOS 仅允许 `/dev/tty*`、`/dev/cu.*` 及对应简写设备名
- Windows 仅允许 `COM\d+` 或 `\\.\COM\d+`
- 明确拒绝 `..`、普通文件绝对路径、盘符路径等非串口设备路径,避免路径穿越或误打开任意文件
## 跨平台实现边界
- Linux / macOS:
- 基于 `golang.org/x/sys/unix` 和 termios 配置串口参数。
- 当前仅接入标准 termios 波特率映射,最高到 `230400`,尚未扩展 `460800`、`921600`、`1000000`、`2000000` 等更高速率。
- 通过 `/dev/...` 枚举和访问设备。
- Windows:
- 基于 `kernel32` 串口 API 配置 `DCB` 和 `COMMTIMEOUTS`。
- 当前读写仍使用同步 `ReadFile` / `WriteFile`;一旦 syscall 已进入执行,turn context cancellation 不能立即打断,只能等待 `COMMTIMEOUTS` 触发后返回。
- 通过注册表 `HARDWARE\\DEVICEMAP\\SERIALCOMM` 枚举端口。
- 其他平台:
- `serial` Tool 显式返回 unsupported,不做静默降级。
## 后续建议
1. 如果需要持续交互式串口会话,建议再增加 session 型 Tool,而不是让 LLM 反复做短连接轮询。
2. 如果后续要支持 CAN、GPIO、PWM,建议抽出统一的硬件 capability 描述层,而不是继续只靠 Tool 名称区分。
3. 若需要生产级稳定性,建议补真实串口回环测试,至少覆盖 Linux PTY 和 Windows COM 模拟场景。
@@ -1,5 +1,7 @@
# Provider Architecture Refactoring - Test Suite Summary
> Historical design notes. This fork now supports only OpenAI and Anthropic; see the [current provider guide](../guides/providers.md). References below to other providers describe the earlier implementation.
This document summarizes the complete test suite designed for the Provider architecture refactoring.
## Test File Structure
+2
View File
@@ -1,5 +1,7 @@
# Provider Architecture Refactoring Design
> Historical design notes. This fork now supports only OpenAI and Anthropic; see the [current provider guide](../guides/providers.md). References below to other providers describe the earlier implementation.
> Issue: #283
> Discussion: #122
> Branch: feat/refactor-provider-by-protocol
-72
View File
@@ -1,72 +0,0 @@
> Retour au [README](../project/README.fr.md)
# Utiliser le fournisseur Antigravity dans PicoClaw
Ce guide explique comment configurer et utiliser le fournisseur **Antigravity** (Google Cloud Code Assist) dans PicoClaw.
## Prérequis
1. Un compte Google.
2. Google Cloud Code Assist activé (généralement disponible via l'intégration « Gemini for Google Cloud »).
## 1. Authentification
Pour vous authentifier avec Antigravity, exécutez la commande suivante :
```bash
picoclaw auth login --provider antigravity
```
### Authentification manuelle (Headless/VPS)
Si vous exécutez PicoClaw sur un serveur (Coolify/Docker) et ne pouvez pas accéder à `localhost`, suivez ces étapes :
1. Exécutez la commande ci-dessus.
2. Copiez l'URL fournie et ouvrez-la dans votre navigateur local.
3. Complétez la connexion.
4. Votre navigateur sera redirigé vers une URL `localhost:51121` (qui ne se chargera pas).
5. **Copiez cette URL finale** depuis la barre d'adresse de votre navigateur.
6. **Collez-la dans le terminal** où PicoClaw attend.
PicoClaw extraira automatiquement le code d'autorisation et terminera le processus.
## 2. Gestion des modèles
### Lister les modèles disponibles
Pour voir quels modèles sont accessibles à votre projet et vérifier leurs quotas :
```bash
picoclaw auth models
```
### Changer de modèle
Vous pouvez modifier le modèle par défaut dans `~/.picoclaw/config.json` ou le remplacer via le CLI :
```bash
# Remplacer pour une seule commande
picoclaw agent -m "Hello" --model claude-opus-4-6-thinking
```
## 3. Utilisation en production (Coolify/Docker)
Si vous déployez via Coolify ou Docker, suivez ces étapes pour tester :
1. **Variables d'environnement** :
* `PICOCLAW_AGENTS_DEFAULTS_MODEL=gemini-flash`
2. **Persistance de l'authentification** :
Si vous vous êtes connecté localement, vous pouvez copier vos identifiants vers le serveur :
```bash
scp ~/.picoclaw/auth.json user@your-server:~/.picoclaw/
```
*Alternativement*, exécutez la commande `auth login` une fois sur le serveur si vous avez un accès terminal.
## 4. Dépannage
* **Réponse vide** : Si un modèle renvoie une réponse vide, il peut être restreint pour votre projet. Essayez `gemini-3-flash` ou `claude-opus-4-6-thinking`.
* **429 Limite de débit** : Antigravity a des quotas stricts. PicoClaw affichera le « temps de réinitialisation » dans le message d'erreur si vous atteignez une limite.
* **404 Non trouvé** : Assurez-vous d'utiliser un ID de modèle provenant de la liste `picoclaw auth models`. Utilisez l'ID court (par ex. `gemini-3-flash`) et non le chemin complet.
## 5. Résumé des modèles fonctionnels
D'après les tests, les modèles suivants sont les plus fiables :
* `gemini-3-flash` (Rapide, haute disponibilité)
* `gemini-2.5-flash-lite` (Léger)
* `claude-opus-4-6-thinking` (Puissant, inclut le raisonnement)
-72
View File
@@ -1,72 +0,0 @@
> [README](../project/README.ja.md) に戻る
# PicoClaw で Antigravity プロバイダーを使用する
このガイドでは、PicoClaw で **Antigravity**(Google Cloud Code Assist)プロバイダーをセットアップして使用する方法を説明します。
## 前提条件
1. Google アカウント。
2. Google Cloud Code Assist が有効であること(通常「Gemini for Google Cloud」のオンボーディングから利用可能)。
## 1. 認証
Antigravity で認証するには、以下のコマンドを実行します:
```bash
picoclaw auth login --provider antigravity
```
### 手動認証(ヘッドレス/VPS)
サーバー(Coolify/Docker)上で実行しており、`localhost` にアクセスできない場合は、以下の手順に従ってください:
1. 上記のコマンドを実行します。
2. 表示された URL をコピーし、ローカルブラウザで開きます。
3. ログインを完了します。
4. ブラウザが `localhost:51121` URL にリダイレクトされます(ページは読み込めません)。
5. **ブラウザのアドレスバーからその最終 URL をコピーします**。
6. **PicoClaw が待機しているターミナルにそれを貼り付けます**。
PicoClaw が自動的に認証コードを抽出し、プロセスを完了します。
## 2. モデルの管理
### 利用可能なモデルの一覧
プロジェクトがアクセスできるモデルとそのクォータを確認するには:
```bash
picoclaw auth models
```
### モデルの切り替え
`~/.picoclaw/config.json` でデフォルトモデルを変更するか、CLI でオーバーライドできます:
```bash
# 単一コマンドでオーバーライド
picoclaw agent -m "Hello" --model claude-opus-4-6-thinking
```
## 3. 実際の使用方法(Coolify/Docker)
Coolify または Docker でデプロイしている場合、以下の手順でテストしてください:
1. **環境変数**:
* `PICOCLAW_AGENTS_DEFAULTS_MODEL=gemini-flash`
2. **認証の永続化**:
ローカルでログイン済みの場合、認証情報をサーバーにコピーできます:
```bash
scp ~/.picoclaw/auth.json user@your-server:~/.picoclaw/
```
*または*、ターミナルアクセスがある場合、サーバー上で `auth login` コマンドを一度実行してください。
## 4. トラブルシューティング
* **空のレスポンス**:モデルが空の応答を返す場合、プロジェクトで制限されている可能性があります。`gemini-3-flash` または `claude-opus-4-6-thinking` を試してください。
* **429 レート制限**:Antigravity には厳格なクォータがあります。制限に達した場合、PicoClaw はエラーメッセージに「リセット時間」を表示します。
* **404 Not Found**:`picoclaw auth models` リストのモデル ID を使用していることを確認してください。フルパスではなく、短い ID(例:`gemini-3-flash`)を使用してください。
## 5. 動作確認済みモデルのまとめ
テストに基づき、以下のモデルが最も信頼性が高いです:
* `gemini-3-flash`(高速、高可用性)
* `gemini-2.5-flash-lite`(軽量)
* `claude-opus-4-6-thinking`(高性能、推論機能を含む)
-70
View File
@@ -1,70 +0,0 @@
# Using Antigravity Provider in PicoClaw
This guide explains how to set up and use the **Antigravity** (Google Cloud Code Assist) provider in PicoClaw.
## Prerequisites
1. A Google account.
2. Google Cloud Code Assist enabled (usually available via the "Gemini for Google Cloud" onboarding).
## 1. Authentication
To authenticate with Antigravity, run the following command:
```bash
picoclaw auth login --provider antigravity
```
### Manual Authentication (Headless/VPS)
If you are running on a server (Coolify/Docker) and cannot reach `localhost`, follow these steps:
1. Run the command above.
2. Copy the URL provided and open it in your local browser.
3. Complete the login.
4. Your browser will redirect to a `localhost:51121` URL (which will fail to load).
5. **Copy that final URL** from your browser's address bar.
6. **Paste it back into the terminal** where PicoClaw is waiting.
PicoClaw will extract the authorization code and complete the process automatically.
## 2. Managing Models
### List Available Models
To see which models your project has access to and check their quotas:
```bash
picoclaw auth models
```
### Switch Models
You can change the default model in `~/.picoclaw/config.json` or override it via the CLI:
```bash
# Override for a single command
picoclaw agent -m "Hello" --model claude-opus-4-6-thinking
```
## 3. Real-world Usage (Coolify/Docker)
If you are deploying via Coolify or Docker, follow these steps to test:
1. **Environment Variables**:
* `PICOCLAW_AGENTS_DEFAULTS_MODEL=gemini-flash`
2. **Authentication persistence**:
If you've logged in locally, you can copy your credentials to the server:
```bash
scp ~/.picoclaw/auth.json user@your-server:~/.picoclaw/
```
*Alternatively*, run the `auth login` command once on the server if you have terminal access.
## 4. Troubleshooting
* **Empty Response**: If a model returns an empty reply, it may be restricted for your project. Try `gemini-3-flash` or `claude-opus-4-6-thinking`.
* **429 Rate Limit**: Antigravity has strict quotas. PicoClaw will display the "reset time" in the error message if you hit a limit.
* **404 Not Found**: Ensure you are using a model ID from the `picoclaw auth models` list. Use the short ID (e.g., `gemini-3-flash`) not the full path.
## 5. Summary of Working Models
Based on testing, the following models are most reliable:
* `gemini-3-flash` (Fast, highly available)
* `gemini-2.5-flash-lite` (Lightweight)
* `claude-opus-4-6-thinking` (Powerful, includes reasoning)
-72
View File
@@ -1,72 +0,0 @@
> Voltar ao [README](../project/README.pt-br.md)
# Usando o provedor Antigravity no PicoClaw
Este guia explica como configurar e usar o provedor **Antigravity** (Google Cloud Code Assist) no PicoClaw.
## Pré-requisitos
1. Uma conta Google.
2. Google Cloud Code Assist habilitado (geralmente disponível através da integração "Gemini for Google Cloud").
## 1. Autenticação
Para se autenticar com o Antigravity, execute o seguinte comando:
```bash
picoclaw auth login --provider antigravity
```
### Autenticação manual (Headless/VPS)
Se você está executando em um servidor (Coolify/Docker) e não consegue acessar `localhost`, siga estas etapas:
1. Execute o comando acima.
2. Copie a URL fornecida e abra-a no seu navegador local.
3. Complete o login.
4. Seu navegador será redirecionado para uma URL `localhost:51121` (que não carregará).
5. **Copie essa URL final** da barra de endereços do seu navegador.
6. **Cole-a de volta no terminal** onde o PicoClaw está aguardando.
O PicoClaw extrairá automaticamente o código de autorização e completará o processo.
## 2. Gerenciando modelos
### Listar modelos disponíveis
Para ver quais modelos seu projeto tem acesso e verificar suas cotas:
```bash
picoclaw auth models
```
### Trocar de modelo
Você pode alterar o modelo padrão em `~/.picoclaw/config.json` ou substituí-lo via CLI:
```bash
# Substituir para um único comando
picoclaw agent -m "Hello" --model claude-opus-4-6-thinking
```
## 3. Uso em produção (Coolify/Docker)
Se você está implantando via Coolify ou Docker, siga estas etapas para testar:
1. **Variáveis de ambiente**:
* `PICOCLAW_AGENTS_DEFAULTS_MODEL=gemini-flash`
2. **Persistência da autenticação**:
Se você já fez login localmente, pode copiar suas credenciais para o servidor:
```bash
scp ~/.picoclaw/auth.json user@your-server:~/.picoclaw/
```
*Alternativamente*, execute o comando `auth login` uma vez no servidor se você tiver acesso ao terminal.
## 4. Solução de problemas
* **Resposta vazia**: Se um modelo retorna uma resposta vazia, ele pode estar restrito para o seu projeto. Tente `gemini-3-flash` ou `claude-opus-4-6-thinking`.
* **429 Limite de taxa**: O Antigravity possui cotas rigorosas. O PicoClaw exibirá o "tempo de redefinição" na mensagem de erro se você atingir um limite.
* **404 Não encontrado**: Certifique-se de que está usando um ID de modelo da lista `picoclaw auth models`. Use o ID curto (ex.: `gemini-3-flash`) e não o caminho completo.
## 5. Resumo dos modelos funcionais
Com base nos testes, os seguintes modelos são os mais confiáveis:
* `gemini-3-flash` (Rápido, alta disponibilidade)
* `gemini-2.5-flash-lite` (Leve)
* `claude-opus-4-6-thinking` (Poderoso, inclui raciocínio)
-72
View File
@@ -1,72 +0,0 @@
> Quay lại [README](../project/README.vi.md)
# Sử dụng nhà cung cấp Antigravity trong PicoClaw
Hướng dẫn này giải thích cách thiết lập và sử dụng nhà cung cấp **Antigravity** (Google Cloud Code Assist) trong PicoClaw.
## Điều kiện tiên quyết
1. Một tài khoản Google.
2. Đã kích hoạt Google Cloud Code Assist (thường có sẵn thông qua quy trình giới thiệu "Gemini for Google Cloud").
## 1. Xác thực
Để xác thực với Antigravity, chạy lệnh sau:
```bash
picoclaw auth login --provider antigravity
```
### Xác thực thủ công (Headless/VPS)
Nếu bạn đang chạy trên máy chủ (Coolify/Docker) và không thể truy cập `localhost`, hãy làm theo các bước sau:
1. Chạy lệnh ở trên.
2. Sao chép URL được cung cấp và mở nó trong trình duyệt cục bộ của bạn.
3. Hoàn tất đăng nhập.
4. Trình duyệt của bạn sẽ chuyển hướng đến URL `localhost:51121` (trang sẽ không tải được).
5. **Sao chép URL cuối cùng đó** từ thanh địa chỉ trình duyệt.
6. **Dán nó vào terminal** nơi PicoClaw đang chờ.
PicoClaw sẽ tự động trích xuất mã ủy quyền và hoàn tất quy trình.
## 2. Quản lý mô hình
### Liệt kê các mô hình khả dụng
Để xem dự án của bạn có quyền truy cập vào những mô hình nào và kiểm tra hạn mức của chúng:
```bash
picoclaw auth models
```
### Chuyển đổi mô hình
Bạn có thể thay đổi mô hình mặc định trong `~/.picoclaw/config.json` hoặc ghi đè qua CLI:
```bash
# Ghi đè cho một lệnh duy nhất
picoclaw agent -m "Hello" --model claude-opus-4-6-thinking
```
## 3. Sử dụng thực tế (Coolify/Docker)
Nếu bạn đang triển khai qua Coolify hoặc Docker, hãy làm theo các bước sau để kiểm tra:
1. **Biến môi trường**:
* `PICOCLAW_AGENTS_DEFAULTS_MODEL=gemini-flash`
2. **Lưu trữ xác thực**:
Nếu bạn đã đăng nhập cục bộ, bạn có thể sao chép thông tin xác thực lên máy chủ:
```bash
scp ~/.picoclaw/auth.json user@your-server:~/.picoclaw/
```
*Hoặc*, chạy lệnh `auth login` một lần trên máy chủ nếu bạn có quyền truy cập terminal.
## 4. Khắc phục sự cố
* **Phản hồi trống**: Nếu một mô hình trả về phản hồi trống, nó có thể bị hạn chế cho dự án của bạn. Hãy thử `gemini-3-flash` hoặc `claude-opus-4-6-thinking`.
* **429 Giới hạn tốc độ**: Antigravity có hạn mức nghiêm ngặt. PicoClaw sẽ hiển thị "thời gian đặt lại" trong thông báo lỗi nếu bạn đạt đến giới hạn.
* **404 Không tìm thấy**: Đảm bảo bạn đang sử dụng ID mô hình từ danh sách `picoclaw auth models`. Sử dụng ID ngắn (ví dụ: `gemini-3-flash`) thay vì đường dẫn đầy đủ.
## 5. Tóm tắt các mô hình hoạt động tốt
Dựa trên kiểm tra, các mô hình sau đáng tin cậy nhất:
* `gemini-3-flash` (Nhanh, khả dụng cao)
* `gemini-2.5-flash-lite` (Nhẹ)
* `claude-opus-4-6-thinking` (Mạnh mẽ, bao gồm khả năng suy luận)
-72
View File
@@ -1,72 +0,0 @@
> 返回 [README](../project/README.zh.md)
# 在 PicoClaw 中使用 Antigravity 提供商
本指南介绍如何在 PicoClaw 中设置和使用 **Antigravity**(Google Cloud Code Assist)提供商。
## 前提条件
1. 一个 Google 账户。
2. 已启用 Google Cloud Code Assist(通常通过"Gemini for Google Cloud"引导流程获取)。
## 1. 身份验证
要使用 Antigravity 进行身份验证,请运行以下命令:
```bash
picoclaw auth login --provider antigravity
```
### 手动验证(无界面/VPS 环境)
如果你在服务器(Coolify/Docker)上运行且无法访问 `localhost`,请按照以下步骤操作:
1. 运行上述命令。
2. 复制提供的 URL 并在本地浏览器中打开。
3. 完成登录。
4. 浏览器将重定向到 `localhost:51121` URL(页面将无法加载)。
5. **从浏览器地址栏复制该最终 URL**。
6. **将其粘贴回 PicoClaw 正在等待的终端中**。
PicoClaw 将自动提取授权码并完成流程。
## 2. 管理模型
### 列出可用模型
查看你的项目可以访问哪些模型并检查其配额:
```bash
picoclaw auth models
```
### 切换模型
你可以在 `~/.picoclaw/config.json` 中更改默认模型,或通过 CLI 覆盖:
```bash
# 为单个命令覆盖
picoclaw agent -m "Hello" --model claude-opus-4-6-thinking
```
## 3. 实际使用(Coolify/Docker)
如果你通过 Coolify 或 Docker 部署,请按照以下步骤进行测试:
1. **环境变量**:
* `PICOCLAW_AGENTS_DEFAULTS_MODEL=gemini-flash`
2. **身份验证持久化**:
如果你已在本地登录,可以将凭据复制到服务器:
```bash
scp ~/.picoclaw/auth.json user@your-server:~/.picoclaw/
```
*或者*,如果你有终端访问权限,可以在服务器上运行一次 `auth login` 命令。
## 4. 故障排除
* **空响应**:如果模型返回空回复,可能是该模型在你的项目中受到限制。请尝试 `gemini-3-flash` 或 `claude-opus-4-6-thinking`。
* **429 速率限制**:Antigravity 有严格的配额限制。如果触发限制,PicoClaw 将在错误消息中显示"重置时间"。
* **404 未找到**:确保你使用的是 `picoclaw auth models` 列表中的模型 ID。请使用短 ID(例如 `gemini-3-flash`),而非完整路径。
## 5. 可用模型总结
根据测试,以下模型最为可靠:
* `gemini-3-flash`(快速,高可用性)
* `gemini-2.5-flash-lite`(轻量级)
* `claude-opus-4-6-thinking`(强大,包含推理能力)
+3 -2
View File
@@ -5,12 +5,13 @@ Task-oriented guides for setup, configuration, and common PicoClaw workflows.
- [Docker & Quick Start Guide](docker.md): install and run PicoClaw with Docker or the CLI.
- [Android Termux Guide](android-termux.md): run the PicoClaw terminal binary on an ARM64 Android phone.
- [Configuration Guide](configuration.md): environment variables, workspace layout, routing, and sandbox settings.
- [SQLite memory](memory.md): layers, commands, migration and backups.
- [Session Guide](session-guide.md): how session scope affects memory sharing, summaries, and isolation.
- [Routing Guide](routing-guide.md): agent dispatch, session overrides, and light-model routing.
- [Chat Apps Configuration](chat-apps.md): supported chat platforms and channel-specific setup paths.
- [Providers & Model Configuration](providers.md): `model_list`, providers, and model routing.
- [Spawn & Async Tasks](spawn-tasks.md): background work, long-running tasks, and sub-agent orchestration.
- [PicoClaw Hardware Compatibility List](hardware-compatibility.md): tested boards and platform notes.
- [Using Antigravity Provider in PicoClaw](ANTIGRAVITY_USAGE.md): Google Cloud Code Assist setup and usage.
- [Platforms and hardware boundaries](hardware-compatibility.md): build targets and optional hardware integrations.
- [Office Skills](office-skills.zh.md): Docker runtime for Word, Excel and PowerPoint files.
Translations usually live beside the English source when available.
+4 -83
View File
@@ -1,88 +1,9 @@
# Android Termux Guide
# Android Termux
> Back to [Guides](README.md)
This guide covers running the PicoClaw terminal binary on an ARM64 Android phone with Termux for a lightweight command-line install.
This fork currently publishes only Linux amd64 archives. There is no Android or Linux ARM64 release asset; the previous upstream download commands do not install this fork.
## Requirements
The Makefile retains `make build-android-arm64`, which produces `build/picoclaw-android-arm64` from this repository. Android builds and runtime behavior are outside the current CI and have not been verified for this fork. Check the target environment and dependencies before using them.
- ARM64 Android device. Run `uname -m` in Termux and use this guide when it prints `aarch64`.
- Termux installed from [Termux GitHub Releases](https://github.com/termux/termux-app/releases) or F-Droid.
- Network access for downloading the release and calling your LLM provider.
- An API key for at least one configured model provider.
## Install PicoClaw
Open Termux and install the packages used by the release archive and chroot wrapper:
```bash
pkg update
pkg install -y wget tar proot
```
Download and unpack the ARM64 Linux release:
```bash
mkdir -p ~/picoclaw
cd ~/picoclaw
wget https://github.com/sipeed/picoclaw/releases/latest/download/picoclaw_Linux_arm64.tar.gz
tar xzf picoclaw_Linux_arm64.tar.gz
chmod +x ./picoclaw
```
Start first-run setup through `termux-chroot`, which gives the Linux binary a more standard filesystem layout than a raw Android userspace:
```bash
termux-chroot ./picoclaw onboard
```
## Configure
Edit the generated config and add at least one model provider API key:
```bash
vim ~/.picoclaw/config.json
```
The default workspace is `~/.picoclaw/workspace`. If you want PicoClaw to read or write Android shared storage, run `termux-setup-storage` first and then point the workspace or any file paths at the mounted storage directory.
See [Configuration Guide](configuration.md) and [Providers & Model Configuration](providers.md) for the available config fields and provider examples.
## Run
Use one-shot agent mode to confirm the installation:
```bash
termux-chroot ./picoclaw agent -m "Hello from Termux"
```
For long-running use, start the gateway:
```bash
termux-chroot ./picoclaw gateway
```
Keep the Termux session open while PicoClaw is running. Android battery optimization can stop background work, so disable battery optimization for Termux if you expect PicoClaw to keep running after the screen locks.
## Update
Your config and workspace live under `~/.picoclaw`, so updating the binary does not remove them:
```bash
cd ~/picoclaw
rm -f picoclaw_Linux_arm64.tar.gz
wget https://github.com/sipeed/picoclaw/releases/latest/download/picoclaw_Linux_arm64.tar.gz
tar xzf picoclaw_Linux_arm64.tar.gz
chmod +x ./picoclaw
termux-chroot ./picoclaw version
```
## Troubleshooting
| Symptom | Check |
|---------|-------|
| `permission denied` | Run `chmod +x ./picoclaw` after unpacking the archive. |
| `not found` after running `./picoclaw` | Confirm `uname -m` prints `aarch64` and that you downloaded `picoclaw_Linux_arm64.tar.gz`. |
| Files or paths behave differently than Linux | Run PicoClaw through `termux-chroot` instead of calling the binary directly. |
| Provider requests fail | Check the API key and network access in `~/.picoclaw/config.json`. |
| PicoClaw stops when the phone sleeps | Disable Android battery optimization for Termux and keep a foreground Termux session active. |
For the maintained installation path, use [Linux amd64 or a local source build](../../README.md#从源码构建). Model protocols and configuration are described in the [provider guide](providers.md).
+3 -444
View File
@@ -1,446 +1,5 @@
# 💬 Configuration des Applications de Chat
# Chat channels in this fork
> Retour au [README](../project/README.fr.md)
Supported channels are Weixin, WeCom, Feishu, DingTalk, QQ, OneBot, Telegram, and MQTT. The previous WeCom app/webhook variants have been replaced by the unified AI Bot WebSocket channel.
## 💬 Applications de Chat
Communiquez avec votre PicoClaw via Telegram, QQ, DingTalk, WeCom, Feishu, OneBot, MQTT.
| Canal | Difficulté | Description | Documentation |
| -------------------- | ------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Telegram** | ⭐ Facile | Recommandé, transcription vocale, long polling (pas d'IP publique requise) | [Documentation](../channels/telegram/README.fr.md) |
| **Weixin** | ⭐ Facile | Scan QR natif (API Tencent iLink) | [Documentation](#weixin) |
| **QQ** | ⭐⭐ Moyen | API bot officielle, communauté chinoise | [Documentation](../channels/qq/README.fr.md) |
| **DingTalk** | ⭐⭐ Moyen | Mode Stream (pas d'IP publique requise), entreprise | [Documentation](../channels/dingtalk/README.fr.md) |
| **WeCom (企业微信)** | ⭐⭐⭐ Avancé | Bot groupe (Webhook), app personnalisée (API), AI Bot | [Guide](../channels/wecom/README.fr.md) |
| **Feishu (飞书)** | ⭐⭐⭐ Avancé | Collaboration entreprise, fonctionnalités riches | [Documentation](../channels/feishu/README.fr.md) |
| **OneBot** | ⭐⭐ Moyen | Compatible NapCat/Go-CQHTTP, écosystème communautaire | [Documentation](../channels/onebot/README.fr.md) |
| **MQTT** | ⭐ Facile | N'importe quel client MQTT via broker pub/sub | [Documentation](../channels/mqtt/README.fr.md) |
<a id="telegram"></a>
<details>
<summary><b>Telegram</b> (Recommandé)</summary>
**1. Créer un bot**
* Ouvrez Telegram, recherchez `@BotFather`
* Envoyez `/newbot`, suivez les instructions
* Copiez le token
**2. Configurer**
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
> Obtenez votre identifiant utilisateur via `@userinfobot` sur Telegram.
**3. Lancer**
```bash
picoclaw gateway
```
**4. Menu de commandes Telegram (enregistré automatiquement au démarrage)**
PicoClaw conserve les définitions de commandes dans un registre partagé unique. Au démarrage, Telegram enregistre automatiquement les commandes bot prises en charge (par exemple `/start`, `/help`, `/show`, `/list`, `/use`, `/btw`) afin que le menu de commandes et le comportement à l'exécution restent synchronisés.
L'enregistrement du menu de commandes Telegram reste une découverte UX locale au canal ; l'exécution générique des commandes est gérée de manière centralisée dans la boucle agent via l'exécuteur de commandes.
Si l'enregistrement des commandes échoue (erreurs transitoires réseau/API), le canal démarre quand même et PicoClaw réessaie l'enregistrement en arrière-plan.
Vous pouvez aussi gerer les competences installees directement depuis Telegram :
- `/list skills`
- `/use <skill> <message>`
- `/use <skill>` puis envoyer la vraie requete dans le message suivant
- `/use clear`
- `/btw <question>` pour poser une question annexe immediate sans modifier l'historique actif de la session ; `/btw` est traite comme une requete directe sans outils et n'entre pas dans le flux normal d'execution des outils
</details>
<a id="weixin"></a>
<details>
<summary><b>Weixin</b> (WeChat Personnel)</summary>
PicoClaw prend en charge la connexion à votre compte WeChat personnel via l'API officielle Tencent iLink.
**1. Connexion**
Lancez le flux de connexion interactif par QR code :
```bash
picoclaw auth weixin
```
Scannez le QR code affiché avec votre application WeChat mobile. Une fois connecté, le token est sauvegardé dans votre configuration.
**2. Configurer**
(Optionnel) Ajoutez votre identifiant utilisateur WeChat dans `allow_from` pour restreindre qui peut envoyer des messages au bot :
```json
{
"channel_list": {
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
**3. Lancer**
```bash
picoclaw gateway
```
</details>
<a id="qq"></a>
<details>
<summary><b>QQ</b></summary>
**Configuration rapide (recommandée)**
QQ Open Platform propose une page de configuration en un clic pour les bots compatibles OpenClaw :
1. Ouvrez [QQ Bot Quick Start](https://q.qq.com/qqbot/openclaw/index.html) et scannez le QR code pour vous connecter
2. Un bot est créé automatiquement — copiez l'**App ID** et l'**App Secret**
3. Configurez PicoClaw :
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
4. Lancez `picoclaw gateway` et ouvrez QQ pour discuter avec votre bot
> L'App Secret n'est affiché qu'une seule fois. Enregistrez-le immédiatement — le consulter à nouveau forcera une réinitialisation.
>
> Les bots créés via la page de configuration rapide sont initialement réservés au créateur et ne prennent pas en charge les discussions de groupe. Pour activer l'accès en groupe, configurez le mode sandbox sur la [QQ Open Platform](https://q.qq.com/).
**Configuration manuelle**
Si vous préférez créer le bot manuellement :
* Connectez-vous sur [QQ Open Platform](https://q.qq.com/) pour vous inscrire en tant que développeur
* Créez un bot QQ — personnalisez son avatar et son nom
* Copiez l'**App ID** et l'**App Secret** depuis les paramètres du bot
* Configurez comme indiqué ci-dessus et lancez `picoclaw gateway`
</details>
<a id="dingtalk"></a>
<details>
<summary><b>DingTalk</b></summary>
**1. Créer un bot**
* Allez sur [Open Platform](https://open.dingtalk.com/)
* Créez une application interne
* Copiez le Client ID et le Client Secret
**2. Configurer**
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
}
}
}
```
> Définissez `allow_from` vide pour autoriser tous les utilisateurs, ou spécifiez des identifiants DingTalk pour restreindre l'accès.
**3. Lancer**
```bash
picoclaw gateway
```
</details>
<a id="wecom"></a>
<details>
<summary><b>WeCom (企业微信)</b></summary>
PicoClaw prend en charge trois types d'intégration WeCom :
**Option 1 : WeCom Bot (Bot)** - Configuration plus facile, prend en charge les discussions de groupe
**Option 2 : WeCom App (Application personnalisée)** - Plus de fonctionnalités, messagerie proactive, chat privé uniquement
**Option 3 : WeCom AI Bot (Bot IA)** - Bot IA officiel, réponses en streaming, prend en charge les discussions de groupe et privées
Voir le [Guide de Configuration WeCom](../channels/wecom/README.fr.md) pour les instructions détaillées.
**Configuration rapide - WeCom Bot :**
**1. Créer un bot**
* Allez dans la console d'administration WeCom → Discussion de groupe → Ajouter un bot de groupe
* Copiez l'URL du webhook (format : `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx`)
**2. Configurer**
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY",
"webhook_path": "/webhook/wecom",
"allow_from": []
}
}
}
```
**Configuration rapide - WeCom App :**
**1. Créer une application**
* Allez dans la console d'administration WeCom → Gestion des applications → Créer une application
* Copiez **AgentId** et **Secret**
* Allez sur la page "Mon entreprise", copiez **CorpID**
**2. Configurer la réception des messages**
* Dans les détails de l'application, cliquez sur "Recevoir les messages" → "Configurer l'API"
* Définissez l'URL à `http://your-server:18790/webhook/wecom-app`
* Générez **Token** et **EncodingAESKey**
**3. Configurer**
```json
{
"channel_list": {
"wecom_app": {
"enabled": true,
"corp_id": "wwxxxxxxxxxxxxxxxx",
"corp_secret": "YOUR_CORP_SECRET",
"agent_id": 1000002,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-app",
"allow_from": []
}
}
}
```
**4. Lancer**
```bash
picoclaw gateway
```
> **Note** : Les callbacks webhook WeCom sont servis sur le port Gateway (par défaut 18790). Utilisez un reverse proxy pour HTTPS.
**Configuration rapide - WeCom AI Bot :**
**1. Créer un AI Bot**
* Allez dans la console d'administration WeCom → Gestion des applications → AI Bot
* Dans les paramètres du AI Bot, configurez l'URL de callback : `http://your-server:18790/webhook/wecom-aibot`
* Copiez **Token** et cliquez sur "Générer aléatoirement" pour **EncodingAESKey**
**2. Configurer**
```json
{
"channel_list": {
"wecom_aibot": {
"enabled": true,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-aibot",
"allow_from": [],
"welcome_message": "Hello! How can I help you?",
"processing_message": "⏳ Processing, please wait. The results will be sent shortly."
}
}
}
```
**3. Lancer**
```bash
picoclaw gateway
```
> **Note** : WeCom AI Bot utilise le protocole streaming pull — pas de problème de timeout de réponse. Les tâches longues (>30 secondes) basculent automatiquement vers la livraison push via `response_url`.
</details>
<a id="feishu"></a>
<details>
<summary><b>Feishu (飞书)</b></summary>
PicoClaw se connecte à Feishu via le mode WebSocket/SDK — aucune URL webhook publique ni serveur de callback nécessaire.
**1. Créer une application**
* Allez sur [Feishu Open Platform](https://open.feishu.cn/) et créez une application
* Dans les paramètres de l'application, activez la capacité **Bot**
* Créez une version et publiez l'application (l'application doit être publiée pour prendre effet)
* Copiez l'**App ID** (commence par `cli_`) et l'**App Secret**
**2. Configurer**
```json
{
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
Optionnel : `encrypt_key` et `verification_token` pour le chiffrement des événements (recommandé en production).
**3. Lancer et discuter**
```bash
picoclaw gateway
```
Ouvrez Feishu, recherchez le nom de votre bot et commencez à discuter. Vous pouvez aussi ajouter le bot à un groupe — utilisez `group_trigger.mention_only: true` pour ne répondre que lorsqu'il est @mentionné.
Pour toutes les options, voir le [Guide de Configuration du Canal Feishu](../channels/feishu/README.fr.md).
</details>
<a id="onebot"></a>
<details>
<summary><b>OneBot (QQ via protocole OneBot)</b></summary>
OneBot est un protocole ouvert pour les bots QQ. PicoClaw se connecte à toute implémentation compatible OneBot v11 (par ex. [Lagrange](https://github.com/LagrangeDev/Lagrange.Core), [NapCat](https://github.com/NapNeko/NapCatQQ)) via WebSocket.
**1. Configurer une implémentation OneBot**
Installez et exécutez un framework de bot QQ compatible OneBot v11. Activez son serveur WebSocket.
**2. Configurer**
```json
{
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
}
}
}
```
| Champ | Description |
|-------|-------------|
| `ws_url` | URL WebSocket de l'implémentation OneBot |
| `access_token` | Token d'accès pour l'authentification (si configuré dans OneBot) |
| `reconnect_interval` | Intervalle de reconnexion en secondes (par défaut : 5) |
**3. Lancer**
```bash
picoclaw gateway
```
</details>
<a id="mqtt"></a>
<details>
<summary><b>MQTT</b></summary>
N'importe quel client MQTT peut communiquer avec PicoClaw via un broker. Les appareils ou services publient des requêtes vers le broker ; PicoClaw s'abonne, les traite et publie les réponses en retour.
**1. Configurer**
```json
{
"channel_list": {
"mqtt": {
"enabled": true,
"type": "mqtt",
"settings": {
"broker": "ssl://votre-broker:8883",
"agent_id": "assistant",
"topic_prefix": "/picoclaw",
"keep_alive": 60,
"qos": 0
}
}
}
}
```
Nom d'utilisateur et mot de passe dans `~/.picoclaw/.security.yml` :
```yaml
channel_list:
mqtt:
settings:
username: votre_utilisateur
password: votre_mot_de_passe
```
**Format des topics**
```
{prefix}/{agent_id}/{client_id}/request # Client → PicoClaw
{prefix}/{agent_id}/{client_id}/response # PicoClaw → Client
```
Le `client_id` est défini par votre application cliente pour identifier les appareils ou sessions.
**2. Lancer**
```bash
picoclaw gateway
```
**3. Tester**
```bash
mosquitto_pub -t "/picoclaw/assistant/device1/request" \
-m '{"text": "Bonjour"}'
mosquitto_sub -t "/picoclaw/assistant/device1/response"
```
Pour les options complètes, voir [Documentation du canal MQTT](../channels/mqtt/README.fr.md).
</details>
Use the maintained [channel guide](chat-apps.md) or [中文说明](chat-apps.zh.md), and the current [configuration example](../../config/config.example.json). Channel-specific values belong under `channel_list.<name>.settings`.
+3 -441
View File
@@ -1,443 +1,5 @@
# 💬 チャットアプリ設定
# Chat channels in this fork
> [README](../project/README.ja.md) に戻る
Supported channels are Weixin, WeCom, Feishu, DingTalk, QQ, OneBot, Telegram, and MQTT. The previous WeCom app/webhook variants have been replaced by the unified AI Bot WebSocket channel.
## 💬 チャットアプリ連携
PicoClaw は複数のチャットプラットフォームをサポートしており、Agent をどこにでも接続できます。
### チャネル一覧
| チャネル | セットアップ難易度 | 特徴 | ドキュメント |
| -------------------- | ------------------ | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Telegram** | ⭐ 簡単 | 推奨、音声テキスト変換対応、ロングポーリング(公開 IP 不要) | [ドキュメント](../channels/telegram/README.ja.md) |
| **微信 (Weixin)** | ⭐ 簡単 | ネイティブ QR スキャン(Tencent iLink API)| [ドキュメント](#weixin) |
| **QQ** | ⭐⭐ 中程度 | 公式ボット API、中国コミュニティ向け | [ドキュメント](../channels/qq/README.ja.md) |
| **DingTalk** | ⭐⭐ 中程度 | Stream モード(公開 IP 不要)、企業向け | [ドキュメント](../channels/dingtalk/README.ja.md) |
| **WeCom (企業微信)** | ⭐⭐⭐ やや難 | グループ Bot (Webhook)、カスタムアプリ (API)、AI Bot 対応 | [ガイド](../channels/wecom/README.ja.md) |
| **Feishu (飛書)** | ⭐⭐⭐ やや難 | エンタープライズコラボレーション、機能豊富 | [ドキュメント](../channels/feishu/README.ja.md) |
| **OneBot** | ⭐⭐ 中程度 | NapCat/Go-CQHTTP 互換、コミュニティエコシステム充実 | [ドキュメント](../channels/onebot/README.ja.md) |
| **MQTT** | ⭐ 簡単 | ブローカー経由で任意の MQTT クライアントと通信 | [ドキュメント](../channels/mqtt/README.ja.md) |
---
<a id="telegram"></a>
<details>
<summary><b>Telegram</b>(推奨)</summary>
**1. Bot を作成**
* Telegram を開き、`@BotFather` を検索
* `/newbot` を送信し、プロンプトに従う
* Token をコピー
**2. 設定**
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
> Telegram の `@userinfobot` から User ID を取得できます。
**3. 実行**
```bash
picoclaw gateway
```
**4. Telegram コマンドメニュー(起動時に自動登録)**
PicoClaw は統一されたコマンド定義を使用します。起動時に Telegram がサポートするコマンド(例: `/start`、`/help`、`/show`、`/list`、`/use`、`/btw`)を Bot コマンドメニューに自動登録し、メニュー表示と実際の動作を一致させます。
Telegram 側はコマンドメニュー登録機能を保持し、汎用コマンドの実行は Agent Loop 内の commands executor で統一的に処理されます。
ネットワークや API の一時的なエラーで登録に失敗しても、チャネルの起動はブロックされません。システムがバックグラウンドで自動リトライします。
</details>
<a id="weixin"></a>
<details>
<summary><b>微信 (Weixin)</b></summary>
PicoClaw は Tencent iLink 公式 API を使用して WeChat 個人アカウントへの接続をサポートしています。
**1. ログイン**
インタラクティブな QR ログインフローを実行します:
```bash
picoclaw auth weixin
```
WeChat モバイルアプリで表示された QR コードをスキャンしてください。ログイン成功後、トークンが設定ファイルに保存されます。
**2. 設定**
(オプション)ボットと会話できるユーザーを制限するために `allow_from` に WeChat ユーザー ID を追加します:
```json
{
"channel_list": {
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
**3. 実行**
```bash
picoclaw gateway
```
</details>
<a id="qq"></a>
<details>
<summary><b>QQ</b></summary>
**クイックセットアップ(推奨)**
QQ 開放プラットフォームでは、OpenClaw 互換ボットのワンクリックセットアップページが提供されています:
1. [QQ Bot クイックスタート](https://q.qq.com/qqbot/openclaw/index.html) を開き、QR コードをスキャンしてログイン
2. ボットが自動的に作成されます — **App ID** と **App Secret** をコピー
3. PicoClaw を設定:
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
4. `picoclaw gateway` を実行し、QQ を開いてボットとチャット
> App Secret は一度しか表示されません。すぐに保存してください — 再度表示するとリセットされます。
>
> クイックセットアップで作成されたボットは、最初は作成者のみが使用でき、グループチャットには対応していません。グループアクセスを有効にするには、[QQ 開放プラットフォーム](https://q.qq.com/) でサンドボックスモードを設定してください。
**手動セットアップ**
ボットを手動で作成する場合:
* [QQ 開放プラットフォーム](https://q.qq.com/) にログインして開発者登録
* QQ ボットを作成 — アバターと名前をカスタマイズ
* ボット設定から **App ID** と **App Secret** をコピー
* 上記の設定を行い、`picoclaw gateway` を実行
</details>
<a id="dingtalk"></a>
<details>
<summary><b>DingTalk</b></summary>
**1. Bot を作成**
* [開放プラットフォーム](https://open.dingtalk.com/) にアクセス
* 内部アプリを作成
* Client ID と Client Secret をコピー
**2. 設定**
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
}
}
}
```
> `allow_from` を空にするとすべてのユーザーを許可します。DingTalk ユーザー ID を指定してアクセスを制限することもできます。
**3. 実行**
```bash
picoclaw gateway
```
</details>
<a id="feishu"></a>
<details>
<summary><b>Feishu (飛書)</b></summary>
PicoClaw は WebSocket/SDK モードで飛書に接続します — 公開 Webhook URL やコールバックサーバーは不要です。
**1. アプリを作成**
* [飛書開放プラットフォーム](https://open.feishu.cn/) にアクセスしてアプリケーションを作成
* アプリ設定で **ボット** 機能を有効化
* バージョンを作成してアプリを公開(アプリは公開しないと有効になりません)
* **App ID**(`cli_` で始まる)と **App Secret** をコピー
**2. 設定**
```json
{
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
オプション:`encrypt_key` と `verification_token` でイベント暗号化(本番環境推奨)。
**3. 実行してチャット**
```bash
picoclaw gateway
```
飛書を開き、ボット名を検索してチャットを開始できます。ボットをグループに追加することもできます — `group_trigger.mention_only: true` を設定すると @メンション時のみ応答します。
詳細なオプションについては [飛書チャネル設定ガイド](../channels/feishu/README.ja.md) を参照してください。
</details>
<a id="wecom"></a>
<details>
<summary><b>WeCom (企業微信)</b></summary>
PicoClaw は 3 種類の WeCom 統合をサポートしています:
**方式 1: グループ Bot (Bot)** — セットアップ簡単、グループチャット対応
**方式 2: カスタムアプリ (App)** — より多機能、プロアクティブメッセージング、プライベートチャットのみ
**方式 3: AI Bot** — 公式 AI Bot、ストリーミング返信、グループ・プライベートチャット対応
詳細なセットアップ手順は [WeCom 設定ガイド](../channels/wecom/README.ja.md) を参照してください。
**クイックセットアップ — グループ Bot:**
**1. Bot を作成**
* WeCom 管理コンソール → グループチャット → グループ Bot を追加
* Webhook URL をコピー(形式:`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx`)
**2. 設定**
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY",
"webhook_path": "/webhook/wecom",
"allow_from": []
}
}
}
```
**クイックセットアップ — カスタムアプリ:**
**1. アプリを作成**
* WeCom 管理コンソール → アプリ管理 → アプリを作成
* **AgentId** と **Secret** をコピー
* 「マイ企業」ページで **CorpID** をコピー
**2. メッセージ受信を設定**
* アプリ詳細で「メッセージ受信」→「API を設定」をクリック
* URL を `http://your-server:18790/webhook/wecom-app` に設定
* **Token** と **EncodingAESKey** を生成
**3. 設定**
```json
{
"channel_list": {
"wecom_app": {
"enabled": true,
"corp_id": "wwxxxxxxxxxxxxxxxx",
"corp_secret": "YOUR_CORP_SECRET",
"agent_id": 1000002,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-app",
"allow_from": []
}
}
}
```
**4. 実行**
```bash
picoclaw gateway
```
> **注意**: WeCom Webhook コールバックは Gateway ポート(デフォルト 18790)で提供されます。HTTPS にはリバースプロキシを使用してください。
**クイックセットアップ — AI Bot:**
**1. AI Bot を作成**
* WeCom 管理コンソール → アプリ管理 → AI Bot
* AI Bot 設定でコールバック URL を設定:`http://your-server:18790/webhook/wecom-aibot`
* **Token** をコピーし、「ランダム生成」をクリックして **EncodingAESKey** を取得
**2. 設定**
```json
{
"channel_list": {
"wecom_aibot": {
"enabled": true,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-aibot",
"allow_from": [],
"welcome_message": "こんにちは!何かお手伝いできますか?",
"processing_message": "⏳ Processing, please wait. The results will be sent shortly."
}
}
}
```
**3. 実行**
```bash
picoclaw gateway
```
> **注意**: WeCom AI Bot はストリーミングプルプロトコルを使用しており、返信タイムアウトの心配はありません。長時間タスク(30 秒超)は自動的に `response_url` プッシュ配信に切り替わります。
</details>
<a id="onebot"></a>
<details>
<summary><b>OneBot(OneBot プロトコル経由の QQ)</b></summary>
OneBot は QQ ボット向けのオープンプロトコルです。PicoClaw は OneBot v11 互換の実装(例:[Lagrange](https://github.com/LagrangeDev/Lagrange.Core)、[NapCat](https://github.com/NapNeko/NapCatQQ))に WebSocket で接続します。
**1. OneBot 実装をセットアップ**
OneBot v11 互換の QQ ボットフレームワークをインストールして実行します。WebSocket サーバーを有効にしてください。
**2. 設定**
```json
{
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
}
}
}
```
| フィールド | 説明 |
|-------|-------------|
| `ws_url` | OneBot 実装の WebSocket URL |
| `access_token` | 認証用アクセストークン(OneBot 側で設定している場合) |
| `reconnect_interval` | 再接続間隔(秒)(デフォルト:5) |
**3. 実行**
```bash
picoclaw gateway
```
</details>
<a id="mqtt"></a>
<details>
<summary><b>MQTT</b></summary>
任意の MQTT クライアントがブローカーを介して PicoClaw と通信できます。デバイスやサービスがブローカーにリクエストをパブリッシュし、PicoClaw がサブスクライブして処理し、レスポンスをパブリッシュして返します。
**1. 設定**
```json
{
"channel_list": {
"mqtt": {
"enabled": true,
"type": "mqtt",
"settings": {
"broker": "ssl://your-broker:8883",
"agent_id": "assistant",
"topic_prefix": "/picoclaw",
"keep_alive": 60,
"qos": 0
}
}
}
}
```
ユーザー名とパスワードは `~/.picoclaw/.security.yml` に記載します:
```yaml
channel_list:
mqtt:
settings:
username: your_username
password: your_password
```
**トピック形式**
```
{prefix}/{agent_id}/{client_id}/request # クライアント → PicoClaw
{prefix}/{agent_id}/{client_id}/response # PicoClaw → クライアント
```
`client_id` はクライアントアプリケーションがデバイスやセッションを識別するために設定します。
**2. 起動**
```bash
picoclaw gateway
```
**3. テスト**
```bash
mosquitto_pub -t "/picoclaw/assistant/device1/request" \
-m '{"text": "こんにちは"}'
mosquitto_sub -t "/picoclaw/assistant/device1/response"
```
完全な設定オプションは [MQTT チャンネルドキュメント](../channels/mqtt/README.ja.md) を参照してください。
</details>
Use the maintained [channel guide](chat-apps.md) or [中文说明](chat-apps.zh.md), and the current [configuration example](../../config/config.example.json). Channel-specific values belong under `channel_list.<name>.settings`.
+43 -23
View File
@@ -1,6 +1,6 @@
# 💬 Chat Apps Configuration
> Back to [README](../README.md)
> Back to [README](../../README.md)
## 💬 Chat Apps
@@ -31,15 +31,21 @@ Talk to your picoclaw through Telegram, QQ, DingTalk, WeCom, Feishu, OneBot, MQT
**2. Configure**
> Configuration: common fields such as `enabled`, `type`, and `allow_from` belong on the channel entry; channel-specific fields belong under `settings`. Credentials saved under `channel_list.<name>.settings` in `.security.yml` override the main JSON configuration.
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": false
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN",
"use_markdown_v2": false
}
}
}
}
@@ -98,8 +104,12 @@ Scan the printed QR code with your WeChat mobile app. On success, the token is s
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_TOKEN"
}
}
}
}
@@ -130,9 +140,11 @@ QQ Open Platform provides a one-click setup page for OpenClaw-compatible bots:
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
@@ -173,9 +185,11 @@ If you prefer to create the bot manually:
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
@@ -217,12 +231,14 @@ This command shows a QR code, waits for approval in WeCom, and writes `bot_id` +
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
@@ -259,9 +275,11 @@ PicoClaw connects to Feishu via WebSocket/SDK mode — no public webhook URL or
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
@@ -299,9 +317,11 @@ Install and run a OneBot v11 compatible QQ bot framework. Enable its WebSocket s
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://127.0.0.1:8080",
"access_token": ""
}
}
}
}
+3 -314
View File
@@ -1,316 +1,5 @@
# 💬 Konfigurasi Aplikasi Sembang
# Chat channels in this fork
> Kembali ke [README](../project/README.ms.md)
Supported channels are Weixin, WeCom, Feishu, DingTalk, QQ, OneBot, Telegram, and MQTT. The previous WeCom app/webhook variants have been replaced by the unified AI Bot WebSocket channel.
## 💬 Aplikasi Sembang
Berbual dengan picoclaw anda melalui Telegram, QQ, DingTalk, WeCom, Feishu, OneBot, MQTT
| Saluran | Penyediaan |
| ---------------- | ------------------------------------------ |
| **Telegram** | Mudah (hanya token) |
| **QQ** | Mudah (AppID + AppSecret) |
| **DingTalk** | Sederhana (kelayakan aplikasi) |
| **WeCom AI Bot** | Sederhana (Token + kunci AES) |
| **Feishu** | Sederhana (App ID + Secret, mod WebSocket) |
| **OneBot** | Sederhana (QQ melalui protokol OneBot) |
| **MQTT** | Mudah (broker + agent_id) |
<details>
<summary><b>Telegram</b> (Disyorkan)</summary>
**1. Cipta bot**
* Buka Telegram, cari `@BotFather`
* Hantar `/newbot`, ikut arahan
* Salin token
**2. Konfigurasi**
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": false,
}
}
}
```
> Dapatkan user ID anda daripada `@userinfobot` di Telegram.
**3. Jalankan**
```bash
picoclaw gateway
```
**4. Menu arahan Telegram (auto-register semasa startup)**
PicoClaw kini menyimpan definisi arahan dalam satu registry bersama. Semasa startup, Telegram akan mendaftarkan arahan bot yang disokong secara automatik (contohnya `/start`, `/help`, `/show`, `/list`, `/use`, `/btw`) supaya menu arahan dan tingkah laku runtime sentiasa selari.
Pendaftaran menu arahan Telegram kekal sebagai UX penemuan setempat saluran; pelaksanaan arahan generik dikendalikan secara berpusat dalam gelung agen melalui commands executor.
Jika pendaftaran arahan gagal (ralat sementara rangkaian/API), saluran tetap akan bermula dan PicoClaw akan mencuba semula pendaftaran di latar belakang.
Anda juga boleh mengurus skill yang dipasang terus dari Telegram:
- `/list skills`
- `/use <skill> <message>`
- `/use <skill>` kemudian hantar permintaan sebenar dalam mesej seterusnya
- `/use clear`
- `/btw <question>` untuk bertanya soalan sampingan segera tanpa mengubah sejarah sesi aktif; `/btw` dikendalikan sebagai pertanyaan langsung tanpa tool dan tidak memasuki aliran pelaksanaan tool biasa
**4. Pemformatan Lanjutan**
Anda boleh menetapkan `use_markdown_v2: true` untuk mengaktifkan pilihan pemformatan yang lebih maju. Ini membolehkan bot menggunakan keseluruhan set ciri Telegram MarkdownV2, termasuk gaya bersarang, spoiler, dan blok lebar tetap tersuai.
</details>
<details>
<summary><b>QQ</b></summary>
**1. Cipta bot**
- Pergi ke [QQ Open Platform](https://q.qq.com/#)
- Cipta aplikasi → Dapatkan **AppID** dan **AppSecret**
**2. Konfigurasi**
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
> Tetapkan `allow_from` kepada kosong untuk membenarkan semua pengguna, atau nyatakan nombor QQ untuk mengehadkan akses.
**3. Jalankan**
```bash
picoclaw gateway
```
</details>
<details>
<summary><b>DingTalk</b></summary>
**1. Cipta bot**
* Pergi ke [Open Platform](https://open.dingtalk.com/)
* Cipta aplikasi dalaman
* Salin Client ID dan Client Secret
**2. Konfigurasi**
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
}
}
}
```
> Tetapkan `allow_from` kepada kosong untuk membenarkan semua pengguna, atau nyatakan user ID DingTalk untuk mengehadkan akses.
**3. Jalankan**
```bash
picoclaw gateway
```
</details>
<details>
<summary><b>WeCom (企业微信)</b></summary>
PicoClaw menyokong tiga jenis integrasi WeCom:
**Pilihan 1: WeCom Bot (Bot)** - Penyediaan lebih mudah, menyokong sembang kumpulan
**Pilihan 2: WeCom App (Custom App)** - Lebih banyak ciri, pemesejan proaktif, sembang peribadi sahaja
**Pilihan 3: WeCom AI Bot (AI Bot)** - AI Bot rasmi, balasan streaming, menyokong sembang kumpulan & peribadi
Lihat [Panduan Konfigurasi WeCom](../channels/wecom/README.zh.md) untuk arahan penyediaan terperinci.
**Quick Setup - WeCom Bot:**
**1. Cipta bot**
* Pergi ke WeCom Admin Console → Group Chat → Add Group Bot
* Salin webhook URL (format: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx`)
**2. Konfigurasi**
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY",
"webhook_path": "/webhook/wecom",
"allow_from": []
}
}
}
```
**Quick Setup - WeCom App:**
**1. Cipta aplikasi**
* Pergi ke WeCom Admin Console → App Management → Create App
* Salin **AgentId** dan **Secret**
* Pergi ke halaman "My Company", salin **CorpID**
**2. Konfigurasi penerimaan mesej**
* Dalam butiran aplikasi, klik "Receive Message" → "Set API"
* Tetapkan URL kepada `http://your-server:18790/webhook/wecom-app`
* Jana **Token** dan **EncodingAESKey**
**3. Konfigurasi**
```json
{
"channel_list": {
"wecom_app": {
"enabled": true,
"corp_id": "wwxxxxxxxxxxxxxxxx",
"corp_secret": "YOUR_CORP_SECRET",
"agent_id": 1000002,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-app",
"allow_from": []
}
}
}
```
**4. Jalankan**
```bash
picoclaw gateway
```
> **Nota**: Callback webhook WeCom diservis pada port Gateway (lalai 18790). Gunakan reverse proxy untuk HTTPS.
**Quick Setup - WeCom AI Bot:**
**1. Cipta AI Bot**
* Pergi ke WeCom Admin Console → App Management → AI Bot
* Dalam tetapan AI Bot, konfigurasikan callback URL: `http://your-server:18791/webhook/wecom-aibot`
* Salin **Token** dan klik "Random Generate" untuk **EncodingAESKey**
**2. Konfigurasi**
```json
{
"channel_list": {
"wecom_aibot": {
"enabled": true,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-aibot",
"allow_from": [],
"welcome_message": "Hello! How can I help you?"
}
}
}
```
**3. Jalankan**
```bash
picoclaw gateway
```
> **Nota**: WeCom AI Bot menggunakan protokol streaming pull — tiada isu timeout balasan. Tugasan panjang (>30 saat) akan bertukar secara automatik kepada penghantaran push `response_url`.
</details>
<a id="mqtt"></a>
<details>
<summary><b>MQTT</b></summary>
Mana-mana client MQTT boleh berkomunikasi dengan PicoClaw melalui broker. Peranti atau perkhidmatan menerbitkan permintaan ke broker; PicoClaw melanggan, memproses dan menerbitkan respons kembali.
**1. Konfigurasi**
```json
{
"channel_list": {
"mqtt": {
"enabled": true,
"type": "mqtt",
"settings": {
"broker": "ssl://your-broker:8883",
"agent_id": "assistant",
"topic_prefix": "/picoclaw",
"keep_alive": 60,
"qos": 0
}
}
}
}
```
Nama pengguna dan kata laluan dalam `~/.picoclaw/.security.yml`:
```yaml
channel_list:
mqtt:
settings:
username: nama_pengguna
password: kata_laluan
```
**Format topik**
```
{prefix}/{agent_id}/{client_id}/request # Client → PicoClaw
{prefix}/{agent_id}/{client_id}/response # PicoClaw → Client
```
`client_id` ditetapkan oleh aplikasi client anda untuk mengenal pasti peranti atau sesi.
**2. Jalankan**
```bash
picoclaw gateway
```
**3. Uji**
```bash
mosquitto_pub -t "/picoclaw/assistant/device1/request" \
-m '{"text": "Helo"}'
mosquitto_sub -t "/picoclaw/assistant/device1/response"
```
Untuk semua pilihan konfigurasi, lihat [Dokumentasi Saluran MQTT](../channels/mqtt/README.md).
</details>
Use the maintained [channel guide](chat-apps.md) or [中文说明](chat-apps.zh.md), and the current [configuration example](../../config/config.example.json). Channel-specific values belong under `channel_list.<name>.settings`.
+3 -444
View File
@@ -1,446 +1,5 @@
# 💬 Configuração de Aplicativos de Chat
# Chat channels in this fork
> Voltar ao [README](../project/README.pt-br.md)
Supported channels are Weixin, WeCom, Feishu, DingTalk, QQ, OneBot, Telegram, and MQTT. The previous WeCom app/webhook variants have been replaced by the unified AI Bot WebSocket channel.
## 💬 Aplicativos de Chat
Converse com seu picoclaw através do Telegram, QQ, DingTalk, WeCom, Feishu, OneBot, MQTT
| Canal | Dificuldade | Descrição | Documentação |
| -------------------- | ------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Telegram** | ⭐ Fácil | Recomendado, voz para texto, long polling (sem IP público) | [Documentação](../channels/telegram/README.pt-br.md) |
| **Weixin** | ⭐ Fácil | Scan QR nativo (API Tencent iLink) | [Documentação](#weixin) |
| **QQ** | ⭐⭐ Médio | API bot oficial, comunidade chinesa | [Documentação](../channels/qq/README.pt-br.md) |
| **DingTalk** | ⭐⭐ Médio | Modo Stream (sem IP público), empresarial | [Documentação](../channels/dingtalk/README.pt-br.md) |
| **WeCom (企业微信)** | ⭐⭐⭐ Avançado | Bot de grupo (Webhook), app personalizado (API), AI Bot | [Guia](../channels/wecom/README.pt-br.md) |
| **Feishu (飞书)** | ⭐⭐⭐ Avançado | Colaboração empresarial, rico em recursos | [Documentação](../channels/feishu/README.pt-br.md) |
| **OneBot** | ⭐⭐ Médio | Compatível com NapCat/Go-CQHTTP, ecossistema comunitário | [Documentação](../channels/onebot/README.pt-br.md) |
| **MQTT** | ⭐ Fácil | Qualquer cliente MQTT via broker pub/sub | [Documentação](../channels/mqtt/README.pt-br.md) |
<a id="telegram"></a>
<details>
<summary><b>Telegram</b> (Recomendado)</summary>
**1. Criar um bot**
* Abra o Telegram, pesquise `@BotFather`
* Envie `/newbot`, siga as instruções
* Copie o token
**2. Configurar**
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
> Obtenha seu ID de usuário com `@userinfobot` no Telegram.
**3. Executar**
```bash
picoclaw gateway
```
**4. Menu de comandos do Telegram (registrado automaticamente na inicialização)**
O PicoClaw agora mantém definições de comandos em um registro compartilhado. Na inicialização, o Telegram registrará automaticamente os comandos de bot suportados (por exemplo `/start`, `/help`, `/show`, `/list`, `/use`, `/btw`) para que o menu de comandos e o comportamento em tempo de execução permaneçam sincronizados.
O registro do menu de comandos do Telegram permanece como descoberta UX local do canal; a execução genérica de comandos é tratada centralmente no loop do agente via commands executor.
Se o registro de comandos falhar (erros transitórios de rede/API), o canal ainda inicia e o PicoClaw tenta novamente o registro em segundo plano.
Voce tambem pode gerenciar skills instaladas diretamente pelo Telegram:
- `/list skills`
- `/use <skill> <message>`
- `/use <skill>` e depois enviar a solicitacao real na proxima mensagem
- `/use clear`
- `/btw <question>` para fazer uma pergunta lateral imediata sem alterar o historico ativo da sessao; `/btw` e tratado como uma consulta direta sem ferramentas e nao entra no fluxo normal de execucao de ferramentas
</details>
<a id="weixin"></a>
<details>
<summary><b>Weixin</b> (WeChat Pessoal)</summary>
O PicoClaw suporta conexão com sua conta pessoal do WeChat usando a API oficial Tencent iLink.
**1. Login**
Execute o fluxo de login interativo por QR code:
```bash
picoclaw auth weixin
```
Escaneie o QR code exibido com seu aplicativo WeChat mobile. Após o login bem-sucedido, o token é salvo na sua configuração.
**2. Configurar**
(Opcional) Adicione seu ID de usuário WeChat em `allow_from` para restringir quem pode enviar mensagens ao bot:
```json
{
"channel_list": {
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
**3. Executar**
```bash
picoclaw gateway
```
</details>
<a id="qq"></a>
<details>
<summary><b>QQ</b></summary>
**Configuração rápida (recomendada)**
A QQ Open Platform oferece uma página de configuração com um clique para bots compatíveis com OpenClaw:
1. Abra o [QQ Bot Quick Start](https://q.qq.com/qqbot/openclaw/index.html) e escaneie o QR code para fazer login
2. Um bot é criado automaticamente — copie o **App ID** e o **App Secret**
3. Configure o PicoClaw:
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
4. Execute `picoclaw gateway` e abra o QQ para conversar com seu bot
> O App Secret é exibido apenas uma vez. Salve-o imediatamente — visualizá-lo novamente forçará uma redefinição.
>
> Bots criados pela página de configuração rápida são inicialmente apenas para o criador e não suportam chats de grupo. Para habilitar o acesso em grupo, configure o modo sandbox na [QQ Open Platform](https://q.qq.com/).
**Configuração manual**
Se preferir criar o bot manualmente:
* Faça login na [QQ Open Platform](https://q.qq.com/) para se registrar como desenvolvedor
* Crie um bot QQ — personalize seu avatar e nome
* Copie o **App ID** e o **App Secret** nas configurações do bot
* Configure conforme mostrado acima e execute `picoclaw gateway`
</details>
<a id="dingtalk"></a>
<details>
<summary><b>DingTalk</b></summary>
**1. Criar um bot**
* Acesse a [Open Platform](https://open.dingtalk.com/)
* Crie um aplicativo interno
* Copie o Client ID e o Client Secret
**2. Configurar**
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
}
}
}
```
> Defina `allow_from` como vazio para permitir todos os usuários, ou especifique IDs de usuário DingTalk para restringir o acesso.
**3. Executar**
```bash
picoclaw gateway
```
</details>
<a id="wecom"></a>
<details>
<summary><b>WeCom (企业微信)</b></summary>
O PicoClaw suporta três tipos de integração WeCom:
**Opção 1: WeCom Bot (Bot)** - Configuração mais fácil, suporta chats de grupo
**Opção 2: WeCom App (App Personalizado)** - Mais recursos, mensagens proativas, apenas chat privado
**Opção 3: WeCom AI Bot (AI Bot)** - AI Bot oficial, respostas em streaming, suporta chat de grupo e privado
Veja o [Guia de Configuração do WeCom](../channels/wecom/README.pt-br.md) para instruções detalhadas de configuração.
**Configuração Rápida - WeCom Bot:**
**1. Criar um bot**
* Acesse o Console de Administração WeCom → Chat de Grupo → Adicionar Bot de Grupo
* Copie a URL do webhook (formato: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx`)
**2. Configurar**
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY",
"webhook_path": "/webhook/wecom",
"allow_from": []
}
}
}
```
**Configuração Rápida - WeCom App:**
**1. Criar um aplicativo**
* Acesse o Console de Administração WeCom → Gerenciamento de Apps → Criar App
* Copie o **AgentId** e o **Secret**
* Acesse a página "Minha Empresa", copie o **CorpID**
**2. Configurar recebimento de mensagens**
* Nos detalhes do App, clique em "Receber Mensagem" → "Configurar API"
* Defina a URL como `http://your-server:18790/webhook/wecom-app`
* Gere o **Token** e o **EncodingAESKey**
**3. Configurar**
```json
{
"channel_list": {
"wecom_app": {
"enabled": true,
"corp_id": "wwxxxxxxxxxxxxxxxx",
"corp_secret": "YOUR_CORP_SECRET",
"agent_id": 1000002,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-app",
"allow_from": []
}
}
}
```
**4. Executar**
```bash
picoclaw gateway
```
> **Nota**: Os callbacks de webhook do WeCom são servidos na porta do Gateway (padrão 18790). Use um proxy reverso para HTTPS.
**Configuração Rápida - WeCom AI Bot:**
**1. Criar um AI Bot**
* Acesse o Console de Administração WeCom → Gerenciamento de Apps → AI Bot
* Nas configurações do AI Bot, configure a URL de callback: `http://your-server:18790/webhook/wecom-aibot`
* Copie o **Token** e clique em "Gerar Aleatoriamente" para o **EncodingAESKey**
**2. Configurar**
```json
{
"channel_list": {
"wecom_aibot": {
"enabled": true,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-aibot",
"allow_from": [],
"welcome_message": "Hello! How can I help you?"
}
}
}
```
**3. Executar**
```bash
picoclaw gateway
```
> **Nota**: O WeCom AI Bot usa protocolo de streaming pull — sem preocupações com timeout de resposta. Tarefas longas (>30 segundos) mudam automaticamente para entrega via `response_url` push.
</details>
<a id="feishu"></a>
<details>
<summary><b>Feishu (Lark)</b></summary>
O PicoClaw se conecta ao Feishu via modo WebSocket/SDK — não é necessário URL de webhook público nem servidor de callback.
**1. Criar um aplicativo**
* Acesse a [Feishu Open Platform](https://open.feishu.cn/) e crie um aplicativo
* Nas configurações do aplicativo, habilite a capacidade **Bot**
* Crie uma versão e publique o aplicativo (o aplicativo deve ser publicado para funcionar)
* Copie o **App ID** (começa com `cli_`) e o **App Secret**
**2. Configurar**
```json
{
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
Opcional: `encrypt_key` e `verification_token` para criptografia de eventos (recomendado para produção).
**3. Executar e conversar**
```bash
picoclaw gateway
```
Abra o Feishu, pesquise o nome do seu bot e comece a conversar. Você também pode adicionar o bot a um grupo — use `group_trigger.mention_only: true` para responder apenas quando @mencionado.
Para opções completas, veja o [Guia de Configuração do Canal Feishu](../channels/feishu/README.pt-br.md).
</details>
<a id="onebot"></a>
<details>
<summary><b>OneBot (QQ via protocolo OneBot)</b></summary>
OneBot é um protocolo aberto para bots QQ. O PicoClaw se conecta a qualquer implementação compatível com OneBot v11 (ex.: [Lagrange](https://github.com/LagrangeDev/Lagrange.Core), [NapCat](https://github.com/NapNeko/NapCatQQ)) via WebSocket.
**1. Configurar uma implementação OneBot**
Instale e execute um framework de bot QQ compatível com OneBot v11. Habilite seu servidor WebSocket.
**2. Configurar**
```json
{
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
}
}
}
```
| Campo | Descrição |
|-------|-----------|
| `ws_url` | URL WebSocket da implementação OneBot |
| `access_token` | Token de acesso para autenticação (se configurado no OneBot) |
| `reconnect_interval` | Intervalo de reconexão em segundos (padrão: 5) |
**3. Executar**
```bash
picoclaw gateway
```
</details>
<a id="mqtt"></a>
<details>
<summary><b>MQTT</b></summary>
Qualquer cliente MQTT pode se comunicar com o PicoClaw via broker. Dispositivos ou serviços publicam requisições para o broker; o PicoClaw assina, processa e publica as respostas de volta.
**1. Configurar**
```json
{
"channel_list": {
"mqtt": {
"enabled": true,
"type": "mqtt",
"settings": {
"broker": "ssl://seu-broker:8883",
"agent_id": "assistant",
"topic_prefix": "/picoclaw",
"keep_alive": 60,
"qos": 0
}
}
}
}
```
Nome de usuário e senha em `~/.picoclaw/.security.yml`:
```yaml
channel_list:
mqtt:
settings:
username: seu_usuario
password: sua_senha
```
**Formato dos tópicos**
```
{prefix}/{agent_id}/{client_id}/request # Cliente → PicoClaw
{prefix}/{agent_id}/{client_id}/response # PicoClaw → Cliente
```
O `client_id` é definido pela sua aplicação cliente para identificar dispositivos ou sessões.
**2. Iniciar**
```bash
picoclaw gateway
```
**3. Testar**
```bash
mosquitto_pub -t "/picoclaw/assistant/device1/request" \
-m '{"text": "Olá"}'
mosquitto_sub -t "/picoclaw/assistant/device1/response"
```
Para todas as opções de configuração, veja a [Documentação do Canal MQTT](../channels/mqtt/README.pt-br.md).
</details>
Use the maintained [channel guide](chat-apps.md) or [中文说明](chat-apps.zh.md), and the current [configuration example](../../config/config.example.json). Channel-specific values belong under `channel_list.<name>.settings`.
+3 -445
View File
@@ -1,447 +1,5 @@
# 💬 Cấu Hình Ứng Dụng Chat
# Chat channels in this fork
> Quay lại [README](../project/README.vi.md)
Supported channels are Weixin, WeCom, Feishu, DingTalk, QQ, OneBot, Telegram, and MQTT. The previous WeCom app/webhook variants have been replaced by the unified AI Bot WebSocket channel.
## 💬 Ứng Dụng Chat
Trò chuyện với picoclaw của bạn qua Telegram, QQ, DingTalk, WeCom, Feishu, OneBot, MQTT
| Kênh | Độ khó | Mô tả | Tài liệu |
| -------------------- | ------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Telegram** | ⭐ Dễ | Khuyến nghị, chuyển giọng nói thành văn bản, long polling (không cần IP công khai) | [Tài liệu](../channels/telegram/README.vi.md) |
| **Weixin** | ⭐ Dễ | Quét QR gốc (API Tencent iLink) | [Tài liệu](#weixin) |
| **QQ** | ⭐⭐ Trung bình | API bot chính thức, cộng đồng Trung Quốc | [Tài liệu](../channels/qq/README.vi.md) |
| **DingTalk** | ⭐⭐ Trung bình | Chế độ Stream (không cần IP công khai), doanh nghiệp | [Tài liệu](../channels/dingtalk/README.vi.md) |
| **WeCom (企业微信)** | ⭐⭐⭐ Nâng cao | Bot nhóm (Webhook), ứng dụng tùy chỉnh (API), AI Bot | [Hướng dẫn](../channels/wecom/README.vi.md) |
| **Feishu (飞书)** | ⭐⭐⭐ Nâng cao | Cộng tác doanh nghiệp, nhiều tính năng | [Tài liệu](../channels/feishu/README.vi.md) |
| **OneBot** | ⭐⭐ Trung bình | Tương thích NapCat/Go-CQHTTP, hệ sinh thái cộng đồng | [Tài liệu](../channels/onebot/README.vi.md) |
| **MQTT** | ⭐ Dễ | Bất kỳ client MQTT nào qua broker pub/sub | [Tài liệu](../channels/mqtt/README.vi.md) |
<a id="telegram"></a>
<details>
<summary><b>Telegram</b> (Khuyến nghị)</summary>
**1. Tạo bot**
* Mở Telegram, tìm `@BotFather`
* Gửi `/newbot`, làm theo hướng dẫn
* Sao chép token
**2. Cấu hình**
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
> Lấy user ID của bạn từ `@userinfobot` trên Telegram.
**3. Chạy**
```bash
picoclaw gateway
```
**4. Menu lệnh Telegram (tự động đăng ký khi khởi động)**
PicoClaw hiện lưu trữ định nghĩa lệnh trong một registry chung. Khi khởi động, Telegram sẽ tự động đăng ký các lệnh bot được hỗ trợ (ví dụ `/start`, `/help`, `/show`, `/list`, `/use`, `/btw`) để menu lệnh và hành vi runtime luôn đồng bộ.
Đăng ký menu lệnh Telegram vẫn là UX khám phá cục bộ của kênh; thực thi lệnh chung được xử lý tập trung trong vòng lặp agent qua commands executor.
Nếu đăng ký lệnh thất bại (lỗi tạm thời mạng/API), kênh vẫn khởi động và PicoClaw thử lại đăng ký trong nền.
Ban cung co the quan ly skill da cai dat truc tiep tu Telegram:
- `/list skills`
- `/use <skill> <message>`
- `/use <skill>` roi gui yeu cau that o tin nhan tiep theo
- `/use clear`
- `/btw <question>` de hoi them mot cau ngoai le ngay lap tuc ma khong thay doi lich su phien dang hoat dong; `/btw` duoc xu ly nhu mot truy van truc tiep khong dung cong cu va khong di vao luong thuc thi cong cu thong thuong
</details>
<a id="weixin"></a>
<details>
<summary><b>Weixin</b> (WeChat Cá nhân)</summary>
PicoClaw hỗ trợ kết nối với tài khoản WeChat cá nhân của bạn thông qua API chính thức Tencent iLink.
**1. Đăng nhập**
Chạy luồng đăng nhập QR tương tác:
```bash
picoclaw auth weixin
```
Quét mã QR được in ra bằng ứng dụng WeChat trên điện thoại. Sau khi đăng nhập thành công, token sẽ được lưu vào cấu hình.
**2. Cấu hình**
(Tùy chọn) Thêm ID người dùng WeChat vào `allow_from` để giới hạn ai có thể nhắn tin với bot:
```json
{
"channel_list": {
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
}
}
```
**3. Chạy**
```bash
picoclaw gateway
```
</details>
<a id="qq"></a>
<details>
<summary><b>QQ</b></summary>
**Thiết lập nhanh (khuyến nghị)**
QQ Open Platform cung cấp trang thiết lập một chạm cho bot tương thích OpenClaw:
1. Mở [QQ Bot Quick Start](https://q.qq.com/qqbot/openclaw/index.html) và quét mã QR để đăng nhập
2. Bot được tạo tự động — sao chép **App ID** và **App Secret**
3. Cấu hình PicoClaw:
```json
{
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
4. Chạy `picoclaw gateway` và mở QQ để trò chuyện với bot của bạn
> App Secret chỉ hiển thị một lần. Lưu ngay lập tức — xem lại sẽ buộc phải đặt lại.
>
> Bot được tạo qua trang thiết lập nhanh ban đầu chỉ dành cho người tạo và không hỗ trợ chat nhóm. Để bật quyền truy cập nhóm, cấu hình chế độ sandbox trên [QQ Open Platform](https://q.qq.com/).
**Thiết lập thủ công**
Nếu bạn muốn tạo bot thủ công:
* Đăng nhập tại [QQ Open Platform](https://q.qq.com/) để đăng ký làm nhà phát triển
* Tạo bot QQ — tùy chỉnh avatar và tên
* Sao chép **App ID** và **App Secret** từ cài đặt bot
* Cấu hình như trên và chạy `picoclaw gateway`
</details>
<a id="dingtalk"></a>
<details>
<summary><b>DingTalk</b></summary>
**1. Tạo bot**
* Truy cập [Open Platform](https://open.dingtalk.com/)
* Tạo ứng dụng nội bộ
* Sao chép Client ID và Client Secret
**2. Cấu hình**
```json
{
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
}
}
}
```
> Đặt `allow_from` trống để cho phép tất cả người dùng, hoặc chỉ định DingTalk user ID để giới hạn truy cập.
**3. Chạy**
```bash
picoclaw gateway
```
</details>
<a id="wecom"></a>
<details>
<summary><b>WeCom (企业微信)</b></summary>
PicoClaw hỗ trợ ba loại tích hợp WeCom:
**Tùy chọn 1: WeCom Bot (Bot)** - Thiết lập dễ hơn, hỗ trợ chat nhóm
**Tùy chọn 2: WeCom App (App Tùy chỉnh)** - Nhiều tính năng hơn, nhắn tin chủ động, chỉ chat riêng
**Tùy chọn 3: WeCom AI Bot (AI Bot)** - AI Bot chính thức, phản hồi streaming, hỗ trợ chat nhóm & riêng
Xem [Hướng Dẫn Cấu Hình WeCom](../channels/wecom/README.vi.md) để biết hướng dẫn thiết lập chi tiết.
**Thiết Lập Nhanh - WeCom Bot:**
**1. Tạo bot**
* Truy cập Console Quản Trị WeCom → Chat Nhóm → Thêm Bot Nhóm
* Sao chép URL webhook (định dạng: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx`)
**2. Cấu hình**
```json
{
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY",
"webhook_path": "/webhook/wecom",
"allow_from": []
}
}
}
```
**Thiết Lập Nhanh - WeCom App:**
**1. Tạo ứng dụng**
* Truy cập Console Quản Trị WeCom → Quản Lý App → Tạo App
* Sao chép **AgentId** và **Secret**
* Truy cập trang "Công Ty Của Tôi", sao chép **CorpID**
**2. Cấu hình nhận tin nhắn**
* Trong chi tiết App, nhấp "Nhận Tin Nhắn" → "Cấu Hình API"
* Đặt URL thành `http://your-server:18790/webhook/wecom-app`
* Tạo **Token** và **EncodingAESKey**
**3. Cấu hình**
```json
{
"channel_list": {
"wecom_app": {
"enabled": true,
"corp_id": "wwxxxxxxxxxxxxxxxx",
"corp_secret": "YOUR_CORP_SECRET",
"agent_id": 1000002,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-app",
"allow_from": []
}
}
}
```
**4. Chạy**
```bash
picoclaw gateway
```
> **Lưu ý**: Callback webhook WeCom được phục vụ trên port Gateway (mặc định 18790). Sử dụng reverse proxy cho HTTPS.
**Thiết Lập Nhanh - WeCom AI Bot:**
**1. Tạo AI Bot**
* Truy cập Console Quản Trị WeCom → Quản Lý App → AI Bot
* Trong cài đặt AI Bot, cấu hình callback URL: `http://your-server:18790/webhook/wecom-aibot`
* Sao chép **Token** và nhấp "Tạo Ngẫu Nhiên" cho **EncodingAESKey**
**2. Cấu hình**
```json
{
"channel_list": {
"wecom_aibot": {
"enabled": true,
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY",
"webhook_path": "/webhook/wecom-aibot",
"allow_from": [],
"welcome_message": "Hello! How can I help you?",
"processing_message": "⏳ Processing, please wait. The results will be sent shortly."
}
}
}
```
**3. Chạy**
```bash
picoclaw gateway
```
> **Lưu ý**: WeCom AI Bot sử dụng giao thức streaming pull — không lo timeout phản hồi. Tác vụ dài (>30 giây) tự động chuyển sang gửi qua `response_url` push.
</details>
<a id="feishu"></a>
<details>
<summary><b>Feishu (Lark)</b></summary>
PicoClaw kết nối với Feishu qua chế độ WebSocket/SDK — không cần URL webhook công khai hay máy chủ callback.
**1. Tạo ứng dụng**
* Truy cập [Feishu Open Platform](https://open.feishu.cn/) và tạo ứng dụng
* Trong cài đặt ứng dụng, bật khả năng **Bot**
* Tạo phiên bản và xuất bản ứng dụng (ứng dụng phải được xuất bản mới có hiệu lực)
* Sao chép **App ID** (bắt đầu bằng `cli_`) và **App Secret**
**2. Cấu hình**
```json
{
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
}
}
}
```
Tùy chọn: `encrypt_key` và `verification_token` để mã hóa sự kiện (khuyến nghị cho môi trường production).
**3. Chạy và trò chuyện**
```bash
picoclaw gateway
```
Mở Feishu, tìm tên bot của bạn và bắt đầu trò chuyện. Bạn cũng có thể thêm bot vào nhóm — sử dụng `group_trigger.mention_only: true` để chỉ phản hồi khi được @mention.
Để xem đầy đủ các tùy chọn, xem [Hướng Dẫn Cấu Hình Kênh Feishu](../channels/feishu/README.vi.md).
</details>
<a id="onebot"></a>
<details>
<summary><b>OneBot (QQ qua giao thức OneBot)</b></summary>
OneBot là giao thức mở cho bot QQ. PicoClaw kết nối với bất kỳ triển khai tương thích OneBot v11 nào (ví dụ: [Lagrange](https://github.com/LagrangeDev/Lagrange.Core), [NapCat](https://github.com/NapNeko/NapCatQQ)) qua WebSocket.
**1. Thiết lập triển khai OneBot**
Cài đặt và chạy framework bot QQ tương thích OneBot v11. Bật máy chủ WebSocket của nó.
**2. Cấu hình**
```json
{
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
}
}
}
```
| Trường | Mô tả |
|--------|-------|
| `ws_url` | URL WebSocket của triển khai OneBot |
| `access_token` | Token truy cập để xác thực (nếu đã cấu hình trong OneBot) |
| `reconnect_interval` | Khoảng thời gian kết nối lại tính bằng giây (mặc định: 5) |
**3. Chạy**
```bash
picoclaw gateway
```
</details>
<a id="mqtt"></a>
<details>
<summary><b>MQTT</b></summary>
Bất kỳ client MQTT nào đều có thể giao tiếp với PicoClaw qua broker. Thiết bị hoặc dịch vụ publish yêu cầu lên broker; PicoClaw subscribe, xử lý và publish phản hồi trở lại.
**1. Cấu hình**
```json
{
"channel_list": {
"mqtt": {
"enabled": true,
"type": "mqtt",
"settings": {
"broker": "ssl://your-broker:8883",
"agent_id": "assistant",
"topic_prefix": "/picoclaw",
"keep_alive": 60,
"qos": 0
}
}
}
}
```
Tên người dùng và mật khẩu trong `~/.picoclaw/.security.yml`:
```yaml
channel_list:
mqtt:
settings:
username: ten_nguoi_dung
password: mat_khau
```
**Định dạng topic**
```
{prefix}/{agent_id}/{client_id}/request # Client → PicoClaw
{prefix}/{agent_id}/{client_id}/response # PicoClaw → Client
```
`client_id` do ứng dụng client đặt để phân biệt thiết bị hoặc phiên.
**2. Khởi động**
```bash
picoclaw gateway
```
**3. Kiểm tra**
```bash
mosquitto_pub -t "/picoclaw/assistant/device1/request" \
-m '{"text": "Xin chào"}'
mosquitto_sub -t "/picoclaw/assistant/device1/response"
```
Xem đầy đủ tùy chọn cấu hình tại [Tài liệu Kênh MQTT](../channels/mqtt/README.vi.md).
</details>
Use the maintained [channel guide](chat-apps.md) or [中文说明](chat-apps.zh.md), and the current [configuration example](../../config/config.example.json). Channel-specific values belong under `channel_list.<name>.settings`.
+43 -23
View File
@@ -1,6 +1,6 @@
# 💬 聊天应用配置
> 返回 [README](../project/README.zh.md)
> 返回 [README](../../README.md)
## 💬 聊天应用集成 (Chat Apps)
@@ -35,14 +35,20 @@ PicoClaw 支持多种聊天平台,使您的 Agent 能够连接到任何地方
**2. 配置**
> 配置结构:`enabled`、`type`、`allow_from` 等公共字段位于渠道条目,Token、App ID 等专有字段位于 `settings`。`.security.yml` 使用 `channel_list.<名称>.settings` 保存渠道密钥;其中的同名值会覆盖主配置。
```json
{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_BOT_TOKEN"
}
}
}
}
@@ -96,8 +102,12 @@ picoclaw auth weixin
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
"allow_from": [
"YOUR_USER_ID"
],
"settings": {
"token": "YOUR_TOKEN"
}
}
}
}
@@ -128,9 +138,11 @@ QQ 开放平台提供了一键创建 OpenClaw 兼容机器人的页面:
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
@@ -171,9 +183,11 @@ QQ 开放平台提供了一键创建 OpenClaw 兼容机器人的页面:
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
}
}
}
@@ -210,9 +224,11 @@ PicoClaw 通过 WebSocket/SDK 模式连接飞书 — 无需公网 Webhook URL
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
"allow_from": [],
"settings": {
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET"
}
}
}
}
@@ -249,7 +265,7 @@ PicoClaw 现在将企业微信统一为一个基于 WebSocket 的 AI Bot 渠道
picoclaw auth wecom
```
该命令会显示二维码,等待你在企业微信里确认,然后把 `bot_id` 和 `secret` 写入 `channels.wecom`。
该命令会显示二维码,等待你在企业微信里确认,然后把 `bot_id` 和 `secret` 写入 `channel_list.wecom.settings`。
**2. 如需手动配置**
@@ -259,12 +275,14 @@ picoclaw auth wecom
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true,
"allow_from": [],
"reasoning_channel_id": ""
"reasoning_channel_id": "",
"settings": {
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
"send_thinking_message": true
}
}
}
}
@@ -298,9 +316,11 @@ OneBot 是 QQ 机器人的开放协议。PicoClaw 通过 WebSocket 连接任何
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
"allow_from": [],
"settings": {
"ws_url": "ws://127.0.0.1:8080",
"access_token": ""
}
}
}
}
+8 -117
View File
@@ -1,6 +1,10 @@
# ⚙️ Guide de Configuration
> Retour au [README](../project/README.fr.md)
> [SQLite memory](memory.md): the old workspace memory and session files are no longer used at runtime.
> Fork configuration: `PICOCLAW_HOME` also changes the default config path; `PICOCLAW_CONFIG` overrides that path. For current model protocols and channel settings, use the [README](../../README.md) and [configuration example](../../config/config.example.json).
> Retour au [README](../../README.md)
## ⚙️ Configuration
@@ -23,7 +27,7 @@ Vous pouvez remplacer les chemins par défaut à l'aide de variables d'environne
PICOCLAW_CONFIG=/etc/picoclaw/production.json picoclaw gateway
# Run picoclaw with all its data stored in /opt/picoclaw
# Config will be loaded from the default ~/.picoclaw/config.json
# Config: /opt/picoclaw/config.json (PICOCLAW_HOME=/opt/picoclaw)
# Workspace will be created at /opt/picoclaw/workspace
PICOCLAW_HOME=/opt/picoclaw picoclaw agent
@@ -53,8 +57,6 @@ PicoClaw stocke les données dans votre workspace configuré (par défaut : `~/.
```
~/.picoclaw/workspace/
├── sessions/ # Sessions de conversation et historique
├── memory/ # Mémoire à long terme (MEMORY.md)
├── state/ # État persistant (dernier canal, etc.)
├── cron/ # Base de données des tâches planifiées
├── skills/ # Compétences personnalisées
@@ -64,7 +66,6 @@ PicoClaw stocke les données dans votre workspace configuré (par défaut : `~/.
└── USER.md # Préférences utilisateur
```
> **Remarque :** Les modifications apportées à `AGENT.md`, `SOUL.md`, `USER.md` et `memory/MEMORY.md` sont détectées automatiquement au moment de l'exécution via le suivi de la date de modification (mtime). Il n'est **pas nécessaire de redémarrer le gateway** après avoir modifié ces fichiers — l'agent charge le nouveau contenu à la prochaine requête.
### Politique de contexte de requête
@@ -352,119 +353,9 @@ Répond HEARTBEAT_OK Utilisateur reçoit le résultat
* `PICOCLAW_HEARTBEAT_ENABLED=false` pour désactiver
* `PICOCLAW_HEARTBEAT_INTERVAL=60` pour changer l'intervalle
### Providers
### Model providers
> [!NOTE]
> Groq fournit une transcription vocale gratuite via Whisper. Si configuré, les messages audio de n'importe quel canal seront automatiquement transcrits au niveau de l'agent.
| Provider | Usage | Obtenir une clé API |
| ------------ | --------------------------------------- | ------------------------------------------------------------ |
| `gemini` | LLM (Gemini direct) | [aistudio.google.com](https://aistudio.google.com) |
| `zhipu` | LLM (Zhipu direct) | [bigmodel.cn](https://bigmodel.cn) |
| `volcengine` | LLM (Volcengine direct) | [volcengine.com](https://www.volcengine.com/activity/codingplan?utm_campaign=PicoClaw&utm_content=PicoClaw&utm_medium=devrel&utm_source=OWO&utm_term=PicoClaw) |
| `openrouter` | LLM (recommandé, accès à tous modèles) | [openrouter.ai](https://openrouter.ai) |
| `anthropic` | LLM (Claude direct) | [console.anthropic.com](https://console.anthropic.com) |
| `openai` | LLM (GPT direct) | [platform.openai.com](https://platform.openai.com) |
| `deepseek` | LLM (DeepSeek direct) | [platform.deepseek.com](https://platform.deepseek.com) |
| `qwen` | LLM (Qwen direct) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) |
| `groq` | LLM + **Transcription vocale** (Whisper)| [console.groq.com](https://console.groq.com) |
| `cerebras` | LLM (Cerebras direct) | [cerebras.ai](https://cerebras.ai) |
| `vivgrid` | LLM (Vivgrid direct) | [vivgrid.com](https://vivgrid.com) |
### Configuration des Modèles (model_list)
> **Nouveauté :** PicoClaw utilise désormais une approche **centrée sur le modèle**. Spécifiez simplement le format `vendor/model` (ex. `zhipu/glm-4.7`) pour ajouter de nouveaux providers — **aucune modification de code requise !**
#### Tous les Vendors Supportés
| Vendor | Préfixe `model` | API Base par défaut | Protocole | API Key |
| ----------------------- | --------------- | --------------------------------------------------- | --------- | ---------------------------------------------------------------- |
| **OpenAI** | `openai/` | `https://api.openai.com/v1` | OpenAI | [Obtenir](https://platform.openai.com) |
| **Anthropic** | `anthropic/` | `https://api.anthropic.com/v1` | Anthropic | [Obtenir](https://console.anthropic.com) |
| **智谱 AI (GLM)** | `zhipu/` | `https://open.bigmodel.cn/api/paas/v4` | OpenAI | [Obtenir](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys) |
| **DeepSeek** | `deepseek/` | `https://api.deepseek.com/v1` | OpenAI | [Obtenir](https://platform.deepseek.com) |
| **Google Gemini** | `gemini/` | `https://generativelanguage.googleapis.com/v1beta` | Gemini | [Obtenir](https://aistudio.google.com/api-keys) |
| **Groq** | `groq/` | `https://api.groq.com/openai/v1` | OpenAI | [Obtenir](https://console.groq.com) |
| **通义千问 (Qwen)** | `qwen/` | `https://dashscope.aliyuncs.com/compatible-mode/v1` | OpenAI | [Obtenir](https://dashscope.console.aliyun.com) |
| **Ollama** | `ollama/` | `http://localhost:11434/v1` | OpenAI | Local (pas de clé) |
| **OpenRouter** | `openrouter/` | `https://openrouter.ai/api/v1` | OpenAI | [Obtenir](https://openrouter.ai/keys) |
| **VolcEngine (Doubao)** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Obtenir](https://www.volcengine.com/activity/codingplan?utm_campaign=PicoClaw&utm_content=PicoClaw&utm_medium=devrel&utm_source=OWO&utm_term=PicoClaw) |
| **Antigravity** | `antigravity/` | Google Cloud | Custom | OAuth uniquement |
#### Équilibrage de Charge
Configurez plusieurs endpoints pour le même nom de modèle — PicoClaw effectuera automatiquement un round-robin :
```json
{
"model_list": [
{ "model_name": "gpt-5.4", "model": "openai/gpt-5.4", "api_base": "https://api1.example.com/v1", "api_keys": ["sk-key1"] },
{ "model_name": "gpt-5.4", "model": "openai/gpt-5.4", "api_base": "https://api2.example.com/v1", "api_keys": ["sk-key2"] }
]
}
```
#### Migration depuis l'ancienne config `providers`
L'ancienne configuration `providers` est **dépréciée** et a été supprimée dans V2. Les configs V0/V1 existantes sont auto-migrées. Voir [docs/migration/model-list-migration.md](../migration/model-list-migration.md).
#### Configuration du Streaming
Le streaming provider utilise un double opt-in et est désactivé par défaut. L'agent ne tente le streaming que lorsque le channel courant a `settings.streaming.enabled: true`, que l'entrée de modèle active a `streaming.enabled: true`, et que le provider comme le channel prennent en charge le streaming. Si une condition manque, PicoClaw utilise le chemin de requête non-streaming normal.
Laissez `streaming` absent si vous ne voulez pas de streaming. Un bloc `streaming` omis signifie désactivé; il n'est pas nécessaire d'écrire `"streaming": {"enabled": false}`.
Exemple d'activation :
```json
{
"model_list": [
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4",
"api_keys": ["sk-your-openai-key"],
"streaming": {
"enabled": true
}
}
],
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"settings": {
"token": "YOUR_TELEGRAM_TOKEN",
"streaming": {
"enabled": true
}
}
}
}
}
```
| Champ | Type | Défaut | Description |
| ----- | ---- | ------ | ----------- |
| `channel_list.<name>.settings.streaming.enabled` | bool | `false` | Autorise ce channel à afficher la sortie streaming du provider |
| `channel_list.<name>.settings.streaming.throttle_seconds` | int | Telegram: `3` | Intervalle minimal entre les mises à jour intermédiaires; le contenu final est toujours envoyé |
| `channel_list.<name>.settings.streaming.min_growth_chars` | int | Telegram: `200` | Croissance minimale du texte avant une mise à jour intermédiaire; le contenu final est toujours envoyé |
| `model_list[].streaming.enabled` | bool | `false` | Autorise cette entrée de modèle à tenter des requêtes provider en streaming |
Les anciennes variables d'environnement Telegram restent compatibles : `PICOCLAW_CHANNELS_TELEGRAM_STREAMING_ENABLED`, `PICOCLAW_CHANNELS_TELEGRAM_STREAMING_THROTTLE_SECONDS` et `PICOCLAW_CHANNELS_TELEGRAM_STREAMING_MIN_GROWTH_CHARS`.
Le comportement d'échec est volontairement conservateur : si le streaming échoue avant l'envoi d'un chunk visible, PicoClaw réessaie une fois via le chemin `Chat()` normal. Si un chunk a déjà été affiché à l'utilisateur, PicoClaw n'envoie pas une deuxième réponse non-streaming, afin d'éviter une sortie dupliquée.
### Architecture des Providers
PicoClaw route les providers par famille de protocole :
- **Compatible OpenAI** : OpenRouter, Groq, Zhipu, endpoints vLLM et la plupart des autres.
- **Gemini natif** : Google Gemini via les endpoints natifs `models/*:generateContent` et `models/*:streamGenerateContent`.
- **Anthropic** : Comportement natif de l'API Claude.
- **Codex/OAuth** : Route d'authentification OAuth/token OpenAI.
Cela maintient le runtime léger tout en faisant des nouveaux backends compatibles OpenAI principalement une opération de configuration (`api_base` + `api_keys`).
This fork supports only OpenAI (Responses / Chat Completions) and Anthropic Messages. For compatible endpoints, API keys, streaming and login, see the maintained [provider guide](providers.md) or [中文说明](providers.zh.md).
### Tâches Planifiées / Rappels
Loaded 100 of 557 files, more files were not shown because too many files have changed in this diff. Show more