Feat/move weixin login to auth and update docs (#1945)

* move weixin to auth and update docs

* fix ci test
This commit is contained in:
Hua Audio 2026-03-24 06:33:35 +01:00 committed by GitHub
parent ce1619051d
commit b23a6b3f54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 23 additions and 25 deletions

View file

@ -524,7 +524,7 @@ Connectez PicoClaw au réseau social des Agents simplement en envoyant un seul m
| Commande | Description | | Commande | Description |
| ------------------------- | ---------------------------------------- | | ------------------------- | ---------------------------------------- |
| `picoclaw onboard` | Initialiser la config & le workspace | | `picoclaw onboard` | Initialiser la config & le workspace |
| `picoclaw onboard weixin` | Connecter un compte WeChat via QR | | `picoclaw auth weixin` | Connecter un compte WeChat via QR |
| `picoclaw agent -m "..."` | Chatter avec l'agent | | `picoclaw agent -m "..."` | Chatter avec l'agent |
| `picoclaw agent` | Mode chat interactif | | `picoclaw agent` | Mode chat interactif |
| `picoclaw gateway` | Démarrer le gateway | | `picoclaw gateway` | Démarrer le gateway |

View file

@ -520,7 +520,7 @@ Hubungkan PicoClaw ke Jaringan Sosial Agent hanya dengan mengirim satu pesan mel
| Perintah | Deskripsi | | Perintah | Deskripsi |
| -------------------------- | -------------------------------- | | -------------------------- | -------------------------------- |
| `picoclaw onboard` | Inisialisasi konfigurasi & workspace | | `picoclaw onboard` | Inisialisasi konfigurasi & workspace |
| `picoclaw onboard weixin` | Hubungkan akun WeChat via QR | | `picoclaw auth weixin` | Hubungkan akun WeChat via QR |
| `picoclaw agent -m "..."` | Chat dengan agent | | `picoclaw agent -m "..."` | Chat dengan agent |
| `picoclaw agent` | Mode chat interaktif | | `picoclaw agent` | Mode chat interaktif |
| `picoclaw gateway` | Mulai gateway | | `picoclaw gateway` | Mulai gateway |

View file

@ -520,7 +520,7 @@ Connetti PicoClaw al Social Network degli Agent semplicemente inviando un singol
| Comando | Descrizione | | Comando | Descrizione |
| ------------------------- | ---------------------------------- | | ------------------------- | ---------------------------------- |
| `picoclaw onboard` | Inizializza config & workspace | | `picoclaw onboard` | Inizializza config & workspace |
| `picoclaw onboard weixin` | Connetti account WeChat tramite QR | | `picoclaw auth weixin` | Connetti account WeChat tramite QR |
| `picoclaw agent -m "..."` | Chatta con l'agent | | `picoclaw agent -m "..."` | Chatta con l'agent |
| `picoclaw agent` | Modalità chat interattiva | | `picoclaw agent` | Modalità chat interattiva |
| `picoclaw gateway` | Avvia il gateway | | `picoclaw gateway` | Avvia il gateway |

View file

@ -520,7 +520,7 @@ CLI または統合チャットアプリからメッセージを 1 つ送るだ
| コマンド | 説明 | | コマンド | 説明 |
| ------------------------- | ------------------------------ | | ------------------------- | ------------------------------ |
| `picoclaw onboard` | 設定&ワークスペースの初期化 | | `picoclaw onboard` | 設定&ワークスペースの初期化 |
| `picoclaw onboard weixin` | WeChat アカウントを QR で接続 | | `picoclaw auth weixin` | WeChat アカウントを QR で接続 |
| `picoclaw agent -m "..."` | Agent とチャット | | `picoclaw agent -m "..."` | Agent とチャット |
| `picoclaw agent` | インタラクティブチャットモード | | `picoclaw agent` | インタラクティブチャットモード |
| `picoclaw gateway` | Gateway を起動 | | `picoclaw gateway` | Gateway を起動 |

View file

@ -523,7 +523,7 @@ Connect PicoClaw to the Agent Social Network simply by sending a single message
| Command | Description | | Command | Description |
| ------------------------- | -------------------------------- | | ------------------------- | -------------------------------- |
| `picoclaw onboard` | Initialize config & workspace | | `picoclaw onboard` | Initialize config & workspace |
| `picoclaw onboard weixin` | Connect WeChat account via QR | | `picoclaw auth weixin` | Connect WeChat account via QR |
| `picoclaw agent -m "..."` | Chat with the agent | | `picoclaw agent -m "..."` | Chat with the agent |
| `picoclaw agent` | Interactive chat mode | | `picoclaw agent` | Interactive chat mode |
| `picoclaw gateway` | Start the gateway | | `picoclaw gateway` | Start the gateway |

View file

@ -520,7 +520,7 @@ Conecte o PicoClaw à Rede Social de Agents simplesmente enviando uma única men
| Comando | Descrição | | Comando | Descrição |
| ------------------------- | -------------------------------------- | | ------------------------- | -------------------------------------- |
| `picoclaw onboard` | Inicializar config e workspace | | `picoclaw onboard` | Inicializar config e workspace |
| `picoclaw onboard weixin` | Conectar conta WeChat via QR | | `picoclaw auth weixin` | Conectar conta WeChat via QR |
| `picoclaw agent -m "..."` | Conversar com o agent | | `picoclaw agent -m "..."` | Conversar com o agent |
| `picoclaw agent` | Modo de chat interativo | | `picoclaw agent` | Modo de chat interativo |
| `picoclaw gateway` | Iniciar o gateway | | `picoclaw gateway` | Iniciar o gateway |

View file

@ -520,7 +520,7 @@ Kết nối PicoClaw với Mạng xã hội Agent chỉ bằng cách gửi một
| Lệnh | Mô tả | | Lệnh | Mô tả |
| ------------------------- | ---------------------------------------- | | ------------------------- | ---------------------------------------- |
| `picoclaw onboard` | Khởi tạo cấu hình & workspace | | `picoclaw onboard` | Khởi tạo cấu hình & workspace |
| `picoclaw onboard weixin` | Kết nối tài khoản WeChat qua QR | | `picoclaw auth weixin` | Kết nối tài khoản WeChat qua QR |
| `picoclaw agent -m "..."` | Trò chuyện với agent | | `picoclaw agent -m "..."` | Trò chuyện với agent |
| `picoclaw agent` | Chế độ trò chuyện tương tác | | `picoclaw agent` | Chế độ trò chuyện tương tác |
| `picoclaw gateway` | Khởi động gateway | | `picoclaw gateway` | Khởi động gateway |

View file

@ -520,7 +520,7 @@ PicoClaw 原生支持 [MCP](https://modelcontextprotocol.io/) — 连接任意 M
| 命令 | 说明 | | 命令 | 说明 |
| ------------------------- | ---------------------- | | ------------------------- | ---------------------- |
| `picoclaw onboard` | 初始化配置与工作区 | | `picoclaw onboard` | 初始化配置与工作区 |
| `picoclaw onboard weixin` | 扫码连接微信个人号 | | `picoclaw auth weixin` | 扫码连接微信个人号 |
| `picoclaw agent -m "..."` | 与 Agent 对话 | | `picoclaw agent -m "..."` | 与 Agent 对话 |
| `picoclaw agent` | 交互式对话模式 | | `picoclaw agent` | 交互式对话模式 |
| `picoclaw gateway` | 启动网关 | | `picoclaw gateway` | 启动网关 |

View file

@ -16,6 +16,7 @@ func NewAuthCommand() *cobra.Command {
newLogoutCommand(), newLogoutCommand(),
newStatusCommand(), newStatusCommand(),
newModelsCommand(), newModelsCommand(),
newWeixinCommand(),
) )
return cmd return cmd

View file

@ -32,6 +32,7 @@ func TestNewAuthCommand(t *testing.T) {
"logout", "logout",
"status", "status",
"models", "models",
"weixin",
} }
subcommands := cmd.Commands() subcommands := cmd.Commands()

View file

@ -1,4 +1,4 @@
package onboard package auth
import ( import (
"context" "context"
@ -27,7 +27,7 @@ to authorize your account. On success, the bot token is saved to the picoclaw
config so you can start the gateway immediately. config so you can start the gateway immediately.
Example: Example:
picoclaw onboard weixin`, picoclaw auth weixin`,
RunE: func(cmd *cobra.Command, _ []string) error { RunE: func(cmd *cobra.Command, _ []string) error {
return runWeixinOnboard(baseURL, proxy, time.Duration(timeout)*time.Second) return runWeixinOnboard(baseURL, proxy, time.Duration(timeout)*time.Second)
}, },

View file

@ -16,7 +16,7 @@ func NewOnboardCommand() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "onboard", Use: "onboard",
Aliases: []string{"o"}, Aliases: []string{"o"},
Short: "Initialize picoclaw configuration, workspace, and channel accounts", Short: "Initialize picoclaw configuration and workspace",
// Run without subcommands → original onboard flow // Run without subcommands → original onboard flow
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 { if len(args) == 0 {
@ -30,8 +30,5 @@ func NewOnboardCommand() *cobra.Command {
cmd.Flags().BoolVar(&encrypt, "enc", false, cmd.Flags().BoolVar(&encrypt, "enc", false,
"Enable credential encryption (generates SSH key and prompts for passphrase)") "Enable credential encryption (generates SSH key and prompts for passphrase)")
// Channel onboarding subcommands
cmd.AddCommand(newWeixinCommand())
return cmd return cmd
} }

View file

@ -13,7 +13,7 @@ func TestNewOnboardCommand(t *testing.T) {
require.NotNil(t, cmd) require.NotNil(t, cmd)
assert.Equal(t, "onboard", cmd.Use) assert.Equal(t, "onboard", cmd.Use)
assert.Equal(t, "Initialize picoclaw configuration, workspace, and channel accounts", cmd.Short) assert.Equal(t, "Initialize picoclaw configuration and workspace", cmd.Short)
assert.Len(t, cmd.Aliases, 1) assert.Len(t, cmd.Aliases, 1)
assert.True(t, cmd.HasAlias("o")) assert.True(t, cmd.HasAlias("o"))
@ -28,6 +28,5 @@ func TestNewOnboardCommand(t *testing.T) {
encFlag := cmd.Flags().Lookup("enc") encFlag := cmd.Flags().Lookup("enc")
require.NotNil(t, encFlag, "expected --enc flag to be registered") require.NotNil(t, encFlag, "expected --enc flag to be registered")
assert.Equal(t, "false", encFlag.DefValue, "--enc should default to false") assert.Equal(t, "false", encFlag.DefValue, "--enc should default to false")
assert.True(t, cmd.HasSubCommands()) assert.False(t, cmd.HasSubCommands())
assert.NotNil(t, cmd.Commands())
} }

View file

@ -7,7 +7,7 @@ PicoClaw supports connecting to your personal WeChat account using the official
The easiest way to set up the Weixin channel is using the interactive onboarding command: The easiest way to set up the Weixin channel is using the interactive onboarding command:
```bash ```bash
picoclaw onboard weixin picoclaw auth weixin
``` ```
This command will: This command will:

View file

@ -7,7 +7,7 @@ PicoClaw 支持使用腾讯官方 iLink API 连接您的个人微信账号。
最简单的方法是使用交互式 onboarding 命令进行一键激活: 最简单的方法是使用交互式 onboarding 命令进行一键激活:
```bash ```bash
picoclaw onboard weixin picoclaw auth weixin
``` ```
该命令将: 该命令将:

View file

@ -190,7 +190,7 @@ PicoClaw supports connecting to your personal WeChat account using the official
Run the interactive QR login flow: Run the interactive QR login flow:
```bash ```bash
picoclaw onboard weixin picoclaw auth weixin
``` ```
Scan the printed QR code with your WeChat mobile app. On success, the token is saved to your config. Scan the printed QR code with your WeChat mobile app. On success, the token is saved to your config.

View file

@ -179,7 +179,7 @@ PicoClaw prend en charge la connexion à votre compte WeChat personnel via l'API
Lancez le flux de connexion interactif par QR code : Lancez le flux de connexion interactif par QR code :
```bash ```bash
picoclaw onboard weixin picoclaw auth weixin
``` ```
Scannez le QR code affiché avec votre application WeChat mobile. Une fois connecté, le token est sauvegardé dans votre configuration. Scannez le QR code affiché avec votre application WeChat mobile. Une fois connecté, le token est sauvegardé dans votre configuration.

View file

@ -184,7 +184,7 @@ PicoClaw は Tencent iLink 公式 API を使用して WeChat 個人アカウン
インタラクティブな QR ログインフローを実行します: インタラクティブな QR ログインフローを実行します:
```bash ```bash
picoclaw onboard weixin picoclaw auth weixin
``` ```
WeChat モバイルアプリで表示された QR コードをスキャンしてください。ログイン成功後、トークンが設定ファイルに保存されます。 WeChat モバイルアプリで表示された QR コードをスキャンしてください。ログイン成功後、トークンが設定ファイルに保存されます。

View file

@ -179,7 +179,7 @@ O PicoClaw suporta conexão com sua conta pessoal do WeChat usando a API oficial
Execute o fluxo de login interativo por QR code: Execute o fluxo de login interativo por QR code:
```bash ```bash
picoclaw onboard weixin 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. Escaneie o QR code exibido com seu aplicativo WeChat mobile. Após o login bem-sucedido, o token é salvo na sua configuração.

View file

@ -179,7 +179,7 @@ PicoClaw hỗ trợ kết nối với tài khoản WeChat cá nhân của bạn
Chạy luồng đăng nhập QR tương tác: Chạy luồng đăng nhập QR tương tác:
```bash ```bash
picoclaw onboard weixin 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. 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.

View file

@ -191,7 +191,7 @@ PicoClaw 通过腾讯 iLink 官方 API 支持连接微信个人号。
运行交互式扫码登录流程: 运行交互式扫码登录流程:
```bash ```bash
picoclaw onboard weixin picoclaw auth weixin
``` ```
用微信手机端扫描打印出的二维码。登录成功后token 会自动保存到配置文件。 用微信手机端扫描打印出的二维码。登录成功后token 会自动保存到配置文件。