Skip to main content

xiumi-agent

终端 TUI 形态的公众号排版 Agent:通过 CDP 直接驱动你本机的 Edge 打开 秀米(xiumi.us),由 LLM 调用插件工具自动完成「写稿 → 排版 → 插图 → 保存草稿」。

架构

TUI (Textual) ──事件总线──▶ Agent 主循环 (OpenAI 兼容 function calling)
                                  │ 工具调用
                            插件管理器(browser / xiumi_login / xiumi_editor)
                                  │ JS 模拟用户操作 + CDP 特例(截图/上传文件/真实按键)
                          Edge (msedge.exe, 独立 profile, CDP 9222)
  • 插件化:核心只有主循环+注册表;所有网页能力都是 plugins/*/plugin.py 里的 Plugin,挂载即用
  • 凭据安全:账号密码只在 TUI 模态框输入,直达登录插件执行,不进 LLM 上下文
  • 选择器可维护:plugins/*/selectors.json 集中管理,recon 踩点后直接改 JSON

快速开始

方式一:PyPI 直接安装(推荐)

pip install xiumiagent
xiumi                      # 任意目录、任意终端直接进入 TUI

首次运行会在 ~/.xiumi-agent/.env 自动生成配置模板,填入 OPENAI_API_KEY 后重启即可。

方式二:从 GitHub 安装(获取最新开发版)

pip install git+https://github.com/ZMJJKK123-hub/xiumi-creator.git

方式三:源码运行

git clone https://github.com/ZMJJKK123-hub/xiumi-creator.git
cd xiumi-creator
pip install -r requirements.txt
pip install -e .            # 安装全局命令 xiumi(一次性)
copy .env.example .env      # 填 OPENAI_API_KEY / OPENAI_BASE_URL / MODEL
xiumi                       # 或 python main.py

xiumi recon = 页面踩点,xiumi version = 版本。

首次使用:未登录时界面会提示 /login 与 /model 两个命令,/login 输入账号密码完成登录,长期保留。

用法

输入任务回车:写一篇秋天咖啡店探店推文,主色暖棕,结尾引导关注
/model                      配置模型、API Key、接口地址(同屏填写保存)
/file examples/task.md      载入文件任务(支持 [img:路径] 图片位置标记)
/login                      登录秀米
/shot                       截图当前页面
/help                       帮助
输入 / 自动弹出命令候选,Tab 切换,Enter 确定
esc 中断任务 · Ctrl+L 清屏 · Ctrl+Q 退出

任务两种姿势:

  • 全自动:只给主题 → Agent 写全文 + 排版 + 保存
  • 只排版:给正文 → Agent 只做排版加工

图片:在正文任意位置写 [img:D:\pics\a.jpg],Agent 会上传到秀米图库并插入该位置(无需多模态模型)。

踩点(重要)

插件里的选择器是启发式默认值。如果页面操作失败,运行:

python main.py recon        # dump 登录页/首页 DOM 树 + 截图到 recon/

人工确认选择器后更新 plugins/xiumi_login/selectors.json 与 plugins/xiumi_editor/selectors.json。手动登录秀米后,把编辑器 URL 加进 scripts/recon.py 的 TARGETS 再跑一次即可踩编辑器。

目录

core/      agent 主循环 / LLM 客户端 / 工具注册表 / 插件契约 / 事件总线
cdp/       CDP 连接 / Edge 管理 / Tab 封装 / 注入式 JS 操作库
tui/       Textual 界面(聊天面板、动作面板、登录/账密模态屏)
plugins/   browser 通用操控 · tool_browser 后台浏览器(dsh适配) · xiumi_login 登录 · xiumi_editor 排版
scripts/   recon.py 页面踩点

Metadata

Release files for xiumiagent 0.3.1

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

Source distribution (sdist)

Source distribution for xiumiagent 0.3.1
File Size Uploaded
xiumiagent-0.3.1.tar.gz 81.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xiumiagent 0.3.1
File Interpreter ABI Platform
xiumiagent-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 184.6 kB

Release files / xiumiagent-0.3.1.tar.gz

Download URL xiumiagent-0.3.1.tar.gz
Size 81.5 kB
Tags Source
SHA-256 checksum
How to use checksums
817cb28bf1f98d3c64643c7ece57ef4654d78012278946e3236c1a19dd770803
BLAKE2b-256 checksum
How to use checksums
cca743c1c7d5e9a38372cef38298c3abf31385ca39dbb66b897e88ff898f7433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / xiumiagent-0.3.1-py3-none-any.whl

Download URL xiumiagent-0.3.1-py3-none-any.whl
Size 103.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c05a10b8c11032b0fa9dc332dc8a678f69df2e440cd8dbb50cb906fd05dccf5f
BLAKE2b-256 checksum
How to use checksums
71f902f7548a7b09d7397c9eace20d8942f383110ef234ce233d335830e97901
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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