Skip to main content

QQ Browser Skill

Browser automation CLI for AI agents — 通过 WebSocket 控制 QQ 浏览器,实现网页自动化操作。

安装

从 PyPI 安装(推荐)

pip install qqbrowser-skill

安装 QQ 浏览器

安装 Python 包后,还需安装 QQ 浏览器本体:

qqbrowser-skill install          # 安装 QQ 浏览器
qqbrowser-skill install --force  # 强制重新安装

快速开始

1. 启动守护进程

执行任何浏览器操作前,必须先启动守护进程服务:

qqbrowser-skill serve --daemon   # 后台模式启动
qqbrowser-skill status           # 检查守护进程状态
qqbrowser-skill stop             # 停止守护进程

2. 基本使用流程

# 导航到目标页面
qqbrowser-skill browser_go_to_url --url https://example.com

# 获取页面快照(包含元素索引)
qqbrowser-skill browser_snapshot

# 使用元素索引进行交互
qqbrowser-skill browser_click_element --index 1
qqbrowser-skill browser_input_text --index 2 --text "hello"

# 截图
qqbrowser-skill browser_screenshot

3. 查看所有可用命令

qqbrowser-skill list                     # 列出所有可用技能
qqbrowser-skill <skill_name> --help      # 查看特定技能的帮助

开发指南

环境准备

本项目使用 uv 作为包管理和构建工具,使用 hatchling 作为构建后端。

# 安装 uv(如未安装)
curl -LsSf https://astral.sh/uv/install.sh | sh

# 克隆项目
git clone <repo-url>
cd X5UseLinuxMcp

# 安装依赖
uv sync

项目结构

X5UseLinuxMcp/
├── pyproject.toml          # 项目配置与依赖
├── publish.sh              # 构建 & 发布脚本
├── SKILL.md                # 技能使用说明(供 AI Agent 参考)
├── uv.lock                 # 锁定的依赖版本
├── src/x5use/
│   ├── __init__.py
│   ├── server.py           # CLI 入口 & 主服务
│   ├── daemon_server.py    # 守护进程服务
│   ├── skill_registry.py   # 技能注册表
│   ├── websocket_manager.py# WebSocket 管理
│   ├── rpc_client.py       # RPC 客户端
│   ├── installer.py        # 安装器入口
│   ├── installer_linux.py  # Linux 安装逻辑
│   ├── installer_mac.py    # macOS 安装逻辑
│   ├── installer_win.py    # Windows 安装逻辑
│   ├── installer_common.py # 安装通用逻辑
│   ├── upgrader.py         # 升级模块
│   ├── constants.py        # 常量定义
│   ├── debug_collector.py  # 调试信息收集
│   ├── vnc_proxy.py        # VNC 代理
│   └── vnc_util.py         # VNC 工具
└── build_whl/              # 预构建的 whl 包

本地开发运行

# 使用 uv 直接运行
uv run qqbrowser-skill <command>

# 或者先安装到虚拟环境再运行
uv pip install -e .
qqbrowser-skill <command>

构建

使用 uv build 构建 sdist 和 wheel 包:

uv build

构建产物输出到 dist/ 目录。

发布到 PyPI

项目提供了 publish.sh 脚本来自动化构建和上传流程。

前置条件

  1. 安装 uv 和 twine:

    pip install twine
    # 或
    uv pip install twine
    
  2. 配置 PyPI API Token(任选其一):

    • 设置环境变量:export TWINE_PASSWORD="pypi-你的Token"
    • 配置 ~/.pypirc 文件
    • 运行时传入:TWINE_PASSWORD="pypi-xxx" bash publish.sh

发布命令

# 发布到正式 PyPI
bash publish.sh

# 发布到 TestPyPI(用于测试)
bash publish.sh --test

发布脚本会自动执行以下步骤:

  1. 清理旧的构建产物
  2. 执行 uv build 构建包
  3. 使用 twine check 检查包合法性
  4. 使用 twine upload 上传到 PyPI

版本管理

修改 pyproject.toml 中的 version 字段来更新版本号:

[project]
version = "1.0.10"

升级

qqbrowser-skill upgrade                # 检查并升级 qqbrowser-skill 和 QQ 浏览器
qqbrowser-skill upgrade --check-only   # 仅检查更新,不执行升级
qqbrowser-skill upgrade --skip-browser # 仅升级 Python 包,跳过浏览器更新

调试

qqbrowser-skill debug                          # 收集调试信息和日志
qqbrowser-skill debug --output /tmp/debug.tar.gz  # 指定输出路径

依赖

Metadata

Release files for mybrowser-skill 1.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mybrowser-skill 1.0.15
File Size Uploaded Provenance Actions
mybrowser_skill-1.0.15.tar.gz 41.8 kB Without provenance Details for mybrowser_skill-1.0.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mybrowser-skill 1.0.15
File Interpreter ABI Platform Actions
mybrowser_skill-1.0.15-py3-none-any.whl Python 3 none any Details for mybrowser_skill-1.0.15-py3-none-any.whl

Total release size: 94.2 kB

Release files / mybrowser_skill-1.0.15.tar.gz

Download URL mybrowser_skill-1.0.15.tar.gz
Size 41.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d5c0121056c4f96417871f526cc3edb192c8ffbcaa18f72b269bc50750369a63
BLAKE2b-256 checksum
How to use checksums
6550645058698c8668fe725a0b8c6713109168a61bc94c6c9bc7a230e1c714d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / mybrowser_skill-1.0.15-py3-none-any.whl

Download URL mybrowser_skill-1.0.15-py3-none-any.whl
Size 52.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
807d5ab3a7f73037723887f3984ba552ce8f3f61f9ab0c65096c9e6074ae8354
BLAKE2b-256 checksum
How to use checksums
8f940a8eb15147714f2aa36420bf6ddf454ab2205dbec5e672f7fbc2328405a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for mybrowser-skill 1.0.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.15 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page