{"id":48496912,"url":"https://github.com/can4hou6joeng4/boss-agent-cli","last_synced_at":"2026-04-19T18:03:36.612Z","repository":{"id":345993471,"uuid":"1187014628","full_name":"can4hou6joeng4/boss-agent-cli","owner":"can4hou6joeng4","description":"AI Agent 专用的 BOSS 直聘求职 CLI 工具 — 搜索职位 · 福利筛选 · 个性化推荐 · 自动打招呼 · 导出数据","archived":false,"fork":false,"pushed_at":"2026-04-01T11:31:09.000Z","size":518,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-01T11:42:29.030Z","etag":null,"topics":["agent-skill","ai-agent","automation","boss-zhipin","cli","job-search","patchright","python","recruitment","reverse-engineering","zhipin"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/can4hou6joeng4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-20T08:41:59.000Z","updated_at":"2026-04-01T11:31:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/can4hou6joeng4/boss-agent-cli","commit_stats":null,"previous_names":["can4hou6joeng4/boss-agent-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/can4hou6joeng4/boss-agent-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/can4hou6joeng4%2Fboss-agent-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/can4hou6joeng4%2Fboss-agent-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/can4hou6joeng4%2Fboss-agent-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/can4hou6joeng4%2Fboss-agent-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/can4hou6joeng4","download_url":"https://codeload.github.com/can4hou6joeng4/boss-agent-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/can4hou6joeng4%2Fboss-agent-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31513375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skill","ai-agent","automation","boss-zhipin","cli","job-search","patchright","python","recruitment","reverse-engineering","zhipin"],"created_at":"2026-04-07T12:31:42.459Z","updated_at":"2026-04-19T18:03:36.604Z","avatar_url":"https://github.com/can4hou6joeng4.png","language":"Python","funding_links":[],"categories":["未分类"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# boss-agent-cli\n\n**专为 AI Agent 设计的 BOSS 直聘求职 CLI 工具**\n\n\u003e 搜索职位 · 福利筛选 · 个性化推荐 · 自动打招呼 · 求职流水线 · 增量监控 · AI 简历优化\n\n[![CI](https://github.com/can4hou6joeng4/boss-agent-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/can4hou6joeng4/boss-agent-cli/actions/workflows/ci.yml)\n[![Coverage](https://codecov.io/gh/can4hou6joeng4/boss-agent-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/can4hou6joeng4/boss-agent-cli)\n[![Python](https://img.shields.io/badge/Python-≥3.10-3776AB?logo=python\u0026logoColor=white)](https://python.org)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![GitHub Release](https://img.shields.io/github/v/release/can4hou6joeng4/boss-agent-cli)](https://github.com/can4hou6joeng4/boss-agent-cli/releases)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/can4hou6joeng4/boss-agent-cli/pulls)\n[![Open in Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/can4hou6joeng4/boss-agent-cli)\n\n[安装](#-安装) · [快速开始](#-快速开始) · [Agent 集成](#-ai-agent-集成) · [命令参考](#-命令参考) · [架构](#-技术架构) · [更新日志](CHANGELOG.md) · [路线图](ROADMAP.md)\n\n**中文** | [English](README.en.md)\n\n\u003cimg src=\"demo.gif\" alt=\"boss-agent-cli 终端演示\" width=\"100%\"\u003e\n\n\u003c/div\u003e\n\n\u003e A CLI tool designed for AI Agents to interact with [BOSS Zhipin](https://www.zhipin.com/) (China's largest recruitment platform). All output is structured JSON, 34 commands, 4-tier login fallback. See [README.en.md](README.en.md) for the English version.\n\n---\n\n## 💡 为什么用 boss-agent-cli？\n\n传统求职：打开网页 → 翻几十页 → 逐个看详情 → 手动打招呼 → 忘了跟进谁。\n\n**boss-agent-cli 让 AI Agent 替你完成全部操作**：\n\n```bash\nboss search \"Golang\" --city 广州 --welfare \"双休,五险一金\"   # 搜索 + 福利筛选\nboss detail \u003csecurity_id\u003e                                    # 查看详情\nboss greet \u003csecurity_id\u003e \u003cjob_id\u003e                            # 一键打招呼\nboss pipeline                                                # 流水线追踪\nboss digest                                                  # 每日汇报\n```\n\n所有输出为 **结构化 JSON**，Agent 一调用就能理解，一调用就能行动。\n\n---\n\n## 🌟 核心能力\n\n| 能力 | 说明 | 命令 |\n|------|------|------|\n| 🔍 **职位发现** | 关键词搜索 + 8 维筛选 + 个性化推荐 | `search` `recommend` |\n| 🎯 **福利筛选** | `--welfare \"双休,五险一金\"` 自动翻页逐条匹配 | `search --welfare` |\n| 👋 **主动出击** | 单个/批量打招呼、立即沟通投递 | `greet` `batch-greet` `apply` |\n| 📊 **进度管理** | 求职流水线 + 跟进提醒 + 每日摘要 | `pipeline` `follow-up` `digest` |\n| 👀 **增量监控** | 保存搜索条件、定期执行、标出新职位 | `watch` `shortlist` `preset` |\n| 💬 **沟通管理** | 聊天记录、结构化摘要、标签管理 | `chat` `chatmsg` `chat-summary` |\n| 🤖 **AI 优化** | 岗位分析 + 简历润色 + 匹配优化 + 面试准备 + 沟通指导 | `ai analyze-jd` `ai polish` `ai optimize` `ai interview-prep` `ai chat-coach` |\n| 📤 **数据导出** | CSV / JSON / HTML / Markdown 多格式 | `export` `chat --export` |\n\n---\n\n## 📦 安装\n\n```bash\n# 推荐：通过 uv 安装（秒级，自动隔离）\nuv tool install boss-agent-cli\n\n# 安装浏览器（用于登录）\npatchright install chromium\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e📋 其他安装方式\u003c/summary\u003e\n\n```bash\n# pipx（隔离环境）\npipx install boss-agent-cli\npatchright install chromium\n\n# pip\npip install boss-agent-cli\npatchright install chromium\n\n# 从源码（开发用）\ngit clone https://github.com/can4hou6joeng4/boss-agent-cli.git\ncd boss-agent-cli\nuv sync --all-extras\nuv run patchright install chromium\n```\n\n\u003c/details\u003e\n\n---\n\n## 🚀 快速开始\n\n```bash\n# 1. 环境自检\nboss doctor\n\n# 2. 登录（自动四级降级）\nboss login\n\n# 3. 验证登录态\nboss status\n\n# 4. 搜索广州的 Golang 职位，要求双休+五险一金\nboss search \"Golang\" --city 广州 --welfare \"双休,五险一金\"\n\n# 5. 查看详情 → 打招呼 → 投递\nboss detail \u003csecurity_id\u003e\nboss greet \u003csecurity_id\u003e \u003cjob_id\u003e\nboss apply \u003csecurity_id\u003e \u003cjob_id\u003e\n\n# 6. 推荐 + 导出\nboss recommend\nboss export \"Golang\" --city 广州 --count 50 -o jobs.csv\n\n# 7. 流水线 + 每日摘要\nboss pipeline\nboss digest\n\n# 8. 增量监控\nboss watch add my-golang \"Golang\" --city 广州 --welfare \"双休\"\nboss watch run my-golang\n```\n\n---\n\n## 🔐 登录链路\n\n`boss login` 采用**四级降级策略**，适配不同环境：\n\n| 级别 | 方式 | 说明 | 需要浏览器？ |\n|:---:|------|------|:---:|\n| 1 | **Cookie 提取** | 从本地 Chrome/Firefox/Edge 等 10+ 浏览器免扫码提取 | 否 |\n| 2 | **CDP 登录** | 复用带 `--remote-debugging-port` 的 Chrome | 需 Chrome |\n| 3 | **QR httpx** | 纯 HTTP 二维码扫码，无需安装任何浏览器 | 否 |\n| 4 | **patchright** | 反检测 Chromium 兜底 | 需 Chromium |\n\n\u003cdetails\u003e\n\u003csummary\u003e📖 CDP 启动示例\u003c/summary\u003e\n\n```bash\n# macOS\n/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome \\\n  --remote-debugging-port=9222 --user-data-dir=/tmp/boss-chrome\n\n# Linux\ngoogle-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/boss-chrome\n\n# 使用 CDP 登录\nboss --cdp-url http://localhost:9222 login --cdp\n```\n\n\u003c/details\u003e\n\n---\n\n## 🤖 AI Agent 集成\n\n推荐先阅读：[Agent Quickstart](docs/agent-quickstart.md) · [Host Examples](docs/agent-hosts.md) · [Capability Matrix](docs/capability-matrix.md)\n\n### 方式一：Skill 安装（推荐）\n\n```bash\nnpx skills add can4hou6joeng4/boss-agent-cli\n```\n\n安装后 Agent 自动获得调用 `boss` 命令的能力，无需手动配置。\n\n### 方式二：手动配置\n\n在 AI Agent 的规则文件中添加：\n\n```markdown\n当用户要求搜索职位、投递、打招呼等 BOSS 直聘操作时，通过 Bash 调用 `boss` CLI：\n1. 运行 `boss status` 检查登录态\n2. 若未登录，运行 `boss login` 提示用户扫码\n3. 根据用户意图调用 search / recommend / detail / greet\n4. 解析 stdout JSON，`ok` 字段判断成败\n5. 用户提到福利要求时使用 `--welfare` 参数\n```\n\n### 输出协议\n\n所有命令输出 JSON 到 stdout，统一信封格式：\n\n```json\n{\n  \"ok\": true,\n  \"schema_version\": \"1.0\",\n  \"command\": \"search\",\n  \"data\": [...],\n  \"pagination\": {\"page\": 1, \"has_more\": true, \"total\": 15},\n  \"error\": null,\n  \"hints\": {\"next_actions\": [\"boss detail \u003csecurity_id\u003e\"]}\n}\n```\n\n| 约定 | 说明 |\n|------|------|\n| `stdout` | 仅 JSON 结构化数据 |\n| `stderr` | 日志和进度信息 |\n| `exit 0` | 命令成功 (`ok=true`) |\n| `exit 1` | 命令失败 (`ok=false`) |\n\n---\n\n## 📚 命令参考\n\n### 基础操作\n\n| 命令 | 说明 |\n|------|------|\n| `boss schema` | 输出 32 个命令的完整能力描述（Agent 首先调用） |\n| `boss login` | 四级降级登录 |\n| `boss logout` | 退出登录 |\n| `boss status` | 检查登录态 |\n| `boss doctor` | 诊断环境、依赖、凭据完整性和网络 |\n| `boss me` | 我的信息（用户/简历/期望/投递记录） |\n\n### 职位搜索\n\n| 命令 | 说明 |\n|------|------|\n| `boss search \u003cquery\u003e` | 搜索职位（支持 `--welfare` 筛选、`--preset` 预设） |\n| `boss recommend` | 个性化推荐 |\n| `boss detail \u003csecurity_id\u003e` | 职位详情（`--job-id` 走快速通道） |\n| `boss show \u003c#\u003e` | 按编号查看上次搜索结果 |\n| `boss cities` | 40 个支持城市 |\n\n### 求职动作\n\n| 命令 | 说明 |\n|------|------|\n| `boss greet \u003csid\u003e \u003cjid\u003e` | 打招呼 |\n| `boss batch-greet \u003cquery\u003e` | 批量打招呼（上限 10） |\n| `boss apply \u003csid\u003e \u003cjid\u003e` | 投递/立即沟通（幂等） |\n| `boss exchange \u003csid\u003e` | 交换手机/微信 |\n\n### 沟通跟进\n\n| 命令 | 说明 |\n|------|------|\n| `boss chat` | 沟通列表（导出 html/md/csv/json） |\n| `boss chatmsg \u003csid\u003e` | 聊天消息历史 |\n| `boss chat-summary \u003csid\u003e` | 结构化摘要 |\n| `boss mark \u003csid\u003e --label X` | 标签管理（9 种） |\n| `boss interviews` | 面试邀请 |\n| `boss history` | 浏览历史 |\n\n### 流水线监控\n\n| 命令 | 说明 |\n|------|------|\n| `boss pipeline` | 求职流水线（各阶段状态） |\n| `boss follow-up` | 跟进提醒（超时未推进） |\n| `boss digest` | 每日摘要 |\n| `boss watch add/list/remove/run` | 增量监控 |\n| `boss shortlist add/list/remove` | 候选池 |\n| `boss preset add/list/remove` | 搜索预设 |\n\n### 简历与 AI\n\n| 命令 | 说明 |\n|------|------|\n| `boss resume init/list/show/edit/delete/export/import/clone/diff` | 本地简历管理 |\n| `boss ai config` | 配置 AI 服务 |\n| `boss ai analyze-jd` | 分析岗位要求 |\n| `boss ai polish` | 润色简历 |\n| `boss ai optimize` | 针对目标岗位优化 |\n| `boss ai suggest` | 求职建议 |\n| `boss ai reply` | 生成招聘者消息回复草稿 |\n| `boss ai interview-prep` | 基于 JD 生成模拟面试题 |\n| `boss ai chat-coach` | 基于聊天记录给沟通建议 |\n\n\u003e 支持 Claude 4.7 / GPT-5 / DeepSeek-V3 / Qwen3 等最新模型，详见 [推荐模型与入口](docs/integrations/ai-models.md)。\n\n### 系统管理\n\n| 命令 | 说明 |\n|------|------|\n| `boss config list/set/reset` | 配置管理 |\n| `boss clean` | 清理缓存 |\n| `boss export \u003cquery\u003e` | 导出结果（CSV/JSON） |\n\n\u003cdetails\u003e\n\u003csummary\u003e🔎 搜索筛选参数详解\u003c/summary\u003e\n\n```bash\nboss search \"golang\" \\\n  --city 广州 \\             # 城市（40 个可选）\n  --salary 20-50K \\         # 薪资范围\n  --experience 3-5年 \\      # 经验要求\n  --education 本科 \\        # 学历要求\n  --scale 100-499人 \\       # 公司规模\n  --industry 互联网 \\       # 行业\n  --stage 已上市 \\          # 融资阶段\n  --welfare \"双休,五险一金\"  # 福利筛选（AND 逻辑）\n```\n\n**福利筛选工作原理**：\n1. 先检查职位福利标签（`welfareList`）\n2. 标签不匹配时自动获取职位描述全文搜索\n3. 自动翻页（最多 5 页）\n4. 每个结果带 `welfare_match` 说明匹配来源\n\n支持关键词：`双休` `五险一金` `年终奖` `餐补` `住房补贴` `定期体检` `股票期权` `加班补助` `带薪年假`\n\n\u003c/details\u003e\n\n---\n\n## 🔧 诊断与排障\n\n```bash\nboss doctor\n```\n\n| 检查项 | 说明 |\n|--------|------|\n| `python` | Python 版本 \u003e= 3.10 |\n| `patchright` | CLI 已安装 |\n| `patchright_chromium` | Chromium 已安装 |\n| `cookie_extract` | 本地浏览器 Cookie 可提取 |\n| `auth_session` | 登录态存在且可解密 |\n| `auth_token_quality` | 核心凭据（wt2 / stoken） |\n| `cookie_completeness` | 辅助凭据（wbg / zp_at） |\n| `cdp` | Chrome 调试端口可连 |\n| `network` | zhipin.com 可访问 |\n\n\u003cdetails\u003e\n\u003csummary\u003e📖 常见问题修复\u003c/summary\u003e\n\n```bash\n# 安装浏览器内核\npatchright install chromium\n\n# 重建登录态\nboss logout \u0026\u0026 boss login\n\n# CDP 诊断\nboss --cdp-url http://localhost:9222 doctor\n```\n\n**auth_session 显示\"损坏\"**：登录态来自旧机器指纹或文件损坏 → `boss logout \u0026\u0026 boss login`\n\n**auth_token_quality 各状态含义**：\n- `wt2/stoken 均存在`：完整，可正常使用\n- `wt2 存在，stoken 缺失`：部分可用，接口失败时 `boss login` 刷新\n- `wt2 缺失`：无效 → `boss logout \u0026\u0026 boss login`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e📖 错误码与自动修复\u003c/summary\u003e\n\n| 错误码 | 含义 | Agent 自动修复 |\n|--------|------|---------------|\n| `AUTH_REQUIRED` | 未登录 | `boss login` |\n| `AUTH_EXPIRED` | 登录过期 | `boss login` |\n| `RATE_LIMITED` | 频率过高 | 等待后重试 |\n| `TOKEN_REFRESH_FAILED` | Token 刷新失败 | `boss login` |\n| `ACCOUNT_RISK` | 风控拦截 | CDP Chrome 重试 |\n| `INVALID_PARAM` | 参数错误 | 修正参数 |\n| `ALREADY_GREETED` | 已打过招呼 | 跳过 |\n| `GREET_LIMIT` | 今日次数用完 | 告知用户 |\n| `NETWORK_ERROR` | 网络错误 | 重试 |\n| `AI_NOT_CONFIGURED` | AI 未配置 | `boss ai config` |\n\n\u003c/details\u003e\n\n---\n\n## ⚙️ 配置\n\n```bash\nboss config list            # 查看所有配置\nboss config set default_city 广州   # 设置默认城市\nboss config reset           # 恢复默认\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e📖 完整配置项\u003c/summary\u003e\n\n`~/.boss-agent/config.json`：\n\n```json\n{\n  \"default_city\": null,\n  \"default_salary\": null,\n  \"request_delay\": [1.5, 3.0],\n  \"batch_greet_delay\": [2.0, 5.0],\n  \"batch_greet_max\": 10,\n  \"log_level\": \"error\",\n  \"login_timeout\": 120,\n  \"cdp_url\": null,\n  \"export_dir\": null\n}\n```\n\n| 配置项 | 说明 |\n|--------|------|\n| `default_city` | 默认城市 |\n| `default_salary` | 默认薪资范围 |\n| `request_delay` | 请求间隔（秒），`[min, max]` |\n| `batch_greet_delay` | 批量打招呼间隔 |\n| `batch_greet_max` | 批量打招呼上限 |\n| `log_level` | 日志级别（error/warning/info/debug） |\n| `login_timeout` | 登录超时（秒） |\n| `cdp_url` | CDP 地址 |\n| `export_dir` | 导出目录 |\n\n\u003c/details\u003e\n\n---\n\n## 🏗️ 技术架构\n\n```\nCLI (Click)\n    │\n    ├── AuthManager ── Cookie 提取 / CDP / QR httpx / patchright\n    │       └── TokenStore (Fernet + PBKDF2 机器绑定加密)\n    │\n    ├── BossClient ── httpx (低风险) + 浏览器 (高风险) 混合通道\n    │       ├── RequestThrottle (高斯延迟 + 突发惩罚)\n    │       ├── BrowserSession (CDP / Bridge / patchright)\n    │       └── BOSS 直聘 wapi (18+ 端点)\n    │\n    ├── CacheStore (SQLite WAL)\n    ├── AIService (OpenAI / Anthropic / 兼容 API)\n    └── output.py → JSON 信封 → stdout\n```\n\n| 层级 | 选型 |\n|------|------|\n| 语言 | Python \u003e= 3.10 |\n| CLI | Click |\n| HTTP | httpx |\n| 浏览器 | patchright（Playwright 反检测 fork） |\n| Cookie | browser-cookie3（10+ 浏览器） |\n| 加密 | cryptography (Fernet + PBKDF2) |\n| 数据库 | sqlite3 (WAL 模式) |\n| 渲染 | rich |\n| AI | OpenAI / Anthropic Chat Completions API |\n| 测试 | pytest（666 项） |\n\n---\n\n## 🤝 贡献\n\n欢迎提交 Issue 和 Pull Request。\n\n```bash\n# 本地开发\ngit clone https://github.com/can4hou6joeng4/boss-agent-cli.git\ncd boss-agent-cli\nuv sync --all-extras\nuv run pytest tests/ -v    # 运行测试\nuv run ruff check src/     # 代码检查\n```\n\n详见 [CONTRIBUTING.md](CONTRIBUTING.md)\n\n---\n\n## 🙏 致谢\n\n- [geekgeekrun](https://github.com/geekgeekrun/geekgeekrun) — 浏览器自动化 + 反检测策略\n- [boss-cli](https://github.com/jackwener/boss-cli) — CLI 结构化输出 + Agent 友好设计\n- [opencli](https://github.com/jackwener/opencli) — Browser Bridge 架构理念\n\n---\n\n## ⚠️ 免责声明\n\n本项目仅用于学习交流，使用时请遵守相关法律法规及 BOSS 直聘平台用户协议。因不当使用产生的一切后果由使用者自行承担，与本项目作者无关。\n\n---\n\n## 📑 许可证\n\n[MIT](LICENSE)\n\n## 👭 友情链接\n\n- [LINUX DO - 新的理想型社区](https://linux.do/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcan4hou6joeng4%2Fboss-agent-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcan4hou6joeng4%2Fboss-agent-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcan4hou6joeng4%2Fboss-agent-cli/lists"}