hipowork-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. hipowork_cli-0.1.0/PKG-INFO +180 -0
  2. hipowork_cli-0.1.0/README.md +147 -0
  3. hipowork_cli-0.1.0/pyproject.toml +54 -0
  4. hipowork_cli-0.1.0/setup.cfg +4 -0
  5. hipowork_cli-0.1.0/src/hipowork_cli/__init__.py +116 -0
  6. hipowork_cli-0.1.0/src/hipowork_cli/examples/job.example.json +24 -0
  7. hipowork_cli-0.1.0/src/hipowork_cli/examples/resume.example.json +63 -0
  8. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_accounts.py +116 -0
  9. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_auth.py +289 -0
  10. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_authorize.py +247 -0
  11. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_e2e.py +152 -0
  12. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_healthcheck.py +115 -0
  13. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_market.py +80 -0
  14. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_match_candidates.py +104 -0
  15. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_match_jobs.py +54 -0
  16. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_mcp_client.py +279 -0
  17. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_publish_job.py +98 -0
  18. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_resume_extract.py +95 -0
  19. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_resume_import.py +161 -0
  20. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_resume_validate.py +255 -0
  21. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_search_candidates.py +68 -0
  22. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_stats.py +55 -0
  23. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_token_refresh.py +40 -0
  24. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_token_status.py +33 -0
  25. hipowork_cli-0.1.0/src/hipowork_cli/scripts/hipo_token_sync.py +78 -0
  26. hipowork_cli-0.1.0/src/hipowork_cli/templates/success.html +94 -0
  27. hipowork_cli-0.1.0/src/hipowork_cli.egg-info/PKG-INFO +180 -0
  28. hipowork_cli-0.1.0/src/hipowork_cli.egg-info/SOURCES.txt +32 -0
  29. hipowork_cli-0.1.0/src/hipowork_cli.egg-info/dependency_links.txt +1 -0
  30. hipowork_cli-0.1.0/src/hipowork_cli.egg-info/entry_points.txt +2 -0
  31. hipowork_cli-0.1.0/src/hipowork_cli.egg-info/requires.txt +10 -0
  32. hipowork_cli-0.1.0/src/hipowork_cli.egg-info/top_level.txt +1 -0
  33. hipowork_cli-0.1.0/tests/test_hipo_accounts.py +115 -0
  34. hipowork_cli-0.1.0/tests/test_hipo_resume_import.py +77 -0
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: hipowork-cli
3
+ Version: 0.1.0
4
+ Summary: HiPo Work CLI — Agent 友好的招聘平台命令行工具集(OAuth 授权 / 岗位发布 / 候选人匹配 / 简历导入)
5
+ Author-email: Lin Tong <sexylin2010@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://hipowork.com
8
+ Project-URL: Repository, https://github.com/sexylin/hipowork-cli
9
+ Project-URL: Documentation, https://hipowork.com
10
+ Keywords: hipo,hipowork,recruitment,hiring,candidate-matching,cli,ai-agent
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Office/Business :: Financial :: Investment
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: mcp>=1.10
26
+ Requires-Dist: httpx>=0.27
27
+ Provides-Extra: resume
28
+ Requires-Dist: pymupdf>=1.24; extra == "resume"
29
+ Provides-Extra: dev
30
+ Requires-Dist: build>=1.0; extra == "dev"
31
+ Requires-Dist: twine>=5.0; extra == "dev"
32
+ Requires-Dist: pytest>=7.0; extra == "dev"
33
+
34
+ # hipowork-cli
35
+
36
+ HiPo Work 客户端命令行工具集 — 面向求职者和招聘方的纯 Python 脚本集,
37
+ 直接对接 https://api.hipowork.com 后端 REST API(底层与 MCP 工具同一套接口),
38
+ 无需浏览器、无需配置 API Key,用 OAuth 授权后即可在终端完成简历导入、岗位发布、
39
+ 候选人匹配、市场分析等操作。
40
+
41
+ ## 安装
42
+
43
+ ```bash
44
+ # 从 PyPI 安装(Python 3.10+)
45
+ pip install hipowork-cli
46
+
47
+ # 可选:简历 PDF 提取依赖
48
+ pip install hipowork-cli[resume]
49
+ ```
50
+
51
+ 安装后提供 `hipo` 命令,可从任意目录运行。
52
+
53
+ ## 快速开始
54
+
55
+ ```bash
56
+ # 1. 授权(浏览器完成邮箱验证码登录)
57
+ hipo authorize --role candidate # 求职者授权
58
+ # hipo authorize --role employer # 招聘方授权
59
+
60
+ # 2. 看授权状态 / 刷新 / 多账户
61
+ hipo status
62
+ hipo refresh
63
+ hipo accounts list
64
+
65
+ # 3. 用起来
66
+ hipo match-jobs # 求职者匹配岗位
67
+ hipo resume-import --json my_resume.json # 导入简历
68
+ hipo publish-job --json examples/job.example.json # 招聘方发布岗位
69
+ hipo search "成都 Python 后端"
70
+ ```
71
+
72
+ > 提示:授权流程需要浏览器完成邮箱验证码登录;授权完成后 token 自动刷新,
73
+ > 无需再手动处理。token 只存在本机 `~/.hipo_mcp_tokens.json`(0600 权限)。
74
+
75
+ ### 开发模式(从源码运行)
76
+
77
+ ```bash
78
+ git clone git@github.com:sexylin/hipowork-cli.git
79
+ cd hipowork-cli
80
+ python3.13 -m venv .venv
81
+ .venv/bin/pip install -e . # 可编辑安装,命令即 hipo
82
+ .venv/bin/python -m unittest discover -s tests # 运行测试
83
+ ```
84
+
85
+ ## 命令速查
86
+
87
+ ### 认证与令牌
88
+ | 命令 | 说明 |
89
+ |---|---|
90
+ | `hipo authorize --role candidate/employer [--email x]` | OAuth 授权(PKCE + 邮箱验证码) |
91
+ | `hipo status` | 查看当前 token:角色/scope/过期时间 |
92
+ | `hipo refresh` | 强制刷新 access_token |
93
+ | `hipo token-sync [--refresh]` | 导出 token 到浏览器 localStorage(4 个 base64) |
94
+ | `hipo accounts list/current/switch/delete` | 多账户管理(多邮箱多角色分开存) |
95
+
96
+ ### 求职者
97
+ | 命令 | 说明 |
98
+ |---|---|
99
+ | `hipo match-jobs [--json]` | 根据我的简历匹配岗位 |
100
+ | `hipo resume-extract <file.pdf> [--out x.txt]` | 提取简历文本(PDF/DOCX/TXT) |
101
+ | `hipo resume-validate <resume.json>` | 导入前校验 JSON 结构 |
102
+ | `hipo resume-import --json <resume.json>` | 校验后导入简历(推荐) |
103
+ | `hipo resume-import --text <resume.txt>` | 走平台 AI 服务解析后导入 |
104
+
105
+ ### 招聘方
106
+ | 命令 | 说明 |
107
+ |---|---|
108
+ | `hipo publish-job --title x --text "..." [--json file]` | 发布岗位 |
109
+ | `hipo search "自然语言描述" [--max n]` | 自然语言搜索候选人 |
110
+ | `hipo match-candidates --text "..." / --json cond.json / --job <id>` | 结构化匹配候选人 |
111
+ | `hipo market --keyword python [--industry tech]` | 人才市场分析 |
112
+ | `hipo stats` | 平台统计 |
113
+
114
+ ### 运维诊断
115
+ | 命令 | 说明 |
116
+ |---|---|
117
+ | `hipo healthcheck` | 检查 API / MCP / OAuth metadata / Embedding 连通性 |
118
+ | `hipo e2e` | 端到端冒烟:token → REST /auth/me → MCP 会话 → 工具调用 |
119
+
120
+ 任意命令加 `--help` 查看详细参数;大部分命令支持 `--json` 输出原始 JSON 便于脚本消费。
121
+
122
+ ## 简历导入两种方式
123
+
124
+ 1. **推荐:`--json`** — 用你自己的 LLM / Agent 把简历解析为结构化 JSON
125
+ (参考 `examples/resume.example.json`),本地校验通过后导入。不依赖平台 AI 服务。
126
+ ```bash
127
+ hipo resume-import --json my_resume.json
128
+ ```
129
+ 2. **`--text`** — 传入简历纯文本,由平台后端 AI 服务解析(需要后端配置了
130
+ AI_SERVICE_URL;否则会提示改用 `--json`)。
131
+ ```bash
132
+ hipo resume-extract resume.pdf --out resume.txt
133
+ hipo resume-import --text resume.txt
134
+ ```
135
+
136
+ `hipo resume-validate` 会提前发现常见问题:`duration_months` 缺失
137
+ (会导致经验年限不累计、岗位匹配经验分拿不到)、字段超长、类型错误、
138
+ 数量超限等,规则与后端 `POST /agent/import-resume` 的白名单/上限一致。
139
+
140
+ ## 目录结构
141
+
142
+ ```text
143
+ src/hipowork_cli/
144
+ __init__.py # 统一入口(console script: hipo)
145
+ scripts/
146
+ hipo_auth.py # 共享认证库:token 仓库/刷新/API 客户端
147
+ hipo_authorize.py # OAuth 授权 + 本地回调 + 统一成功页
148
+ hipo_token_status.py # token 状态
149
+ hipo_token_refresh.py # 强制刷新
150
+ hipo_token_sync.py # token → 浏览器 localStorage
151
+ hipo_accounts.py # 多账户管理
152
+ hipo_mcp_client.py # 业务封装:匹配/发布/搜索/统计/导入等
153
+ hipo_match_jobs.py # 求职者匹配岗位
154
+ hipo_publish_job.py # 发布岗位
155
+ hipo_search_candidates.py # 搜索候选人
156
+ hipo_match_candidates.py # 结构化匹配候选人
157
+ hipo_market.py # 市场分析
158
+ hipo_stats.py # 平台统计
159
+ hipo_resume_extract.py # 简历文本提取
160
+ hipo_resume_validate.py # 简历 JSON 校验
161
+ hipo_resume_import.py # 简历导入
162
+ hipo_healthcheck.py # 服务连通性检查
163
+ hipo_e2e.py # 端到端冒烟
164
+ templates/
165
+ success.html # 统一授权成功页(深色玻璃拟态)
166
+ examples/
167
+ resume.example.json # 结构化简历示例
168
+ job.example.json # 结构化岗位示例
169
+ tests/
170
+ test_hipo_accounts.py # 多账户管理单元测试
171
+ test_hipo_resume_import.py # 简历流水线单元测试
172
+ ```
173
+
174
+ ## 相关服务地址
175
+
176
+ ```text
177
+ API: https://api.hipowork.com (docs: /docs)
178
+ MCP: https://mcp.hipowork.com/mcp
179
+ 官网: https://hipowork.com
180
+ ```
@@ -0,0 +1,147 @@
1
+ # hipowork-cli
2
+
3
+ HiPo Work 客户端命令行工具集 — 面向求职者和招聘方的纯 Python 脚本集,
4
+ 直接对接 https://api.hipowork.com 后端 REST API(底层与 MCP 工具同一套接口),
5
+ 无需浏览器、无需配置 API Key,用 OAuth 授权后即可在终端完成简历导入、岗位发布、
6
+ 候选人匹配、市场分析等操作。
7
+
8
+ ## 安装
9
+
10
+ ```bash
11
+ # 从 PyPI 安装(Python 3.10+)
12
+ pip install hipowork-cli
13
+
14
+ # 可选:简历 PDF 提取依赖
15
+ pip install hipowork-cli[resume]
16
+ ```
17
+
18
+ 安装后提供 `hipo` 命令,可从任意目录运行。
19
+
20
+ ## 快速开始
21
+
22
+ ```bash
23
+ # 1. 授权(浏览器完成邮箱验证码登录)
24
+ hipo authorize --role candidate # 求职者授权
25
+ # hipo authorize --role employer # 招聘方授权
26
+
27
+ # 2. 看授权状态 / 刷新 / 多账户
28
+ hipo status
29
+ hipo refresh
30
+ hipo accounts list
31
+
32
+ # 3. 用起来
33
+ hipo match-jobs # 求职者匹配岗位
34
+ hipo resume-import --json my_resume.json # 导入简历
35
+ hipo publish-job --json examples/job.example.json # 招聘方发布岗位
36
+ hipo search "成都 Python 后端"
37
+ ```
38
+
39
+ > 提示:授权流程需要浏览器完成邮箱验证码登录;授权完成后 token 自动刷新,
40
+ > 无需再手动处理。token 只存在本机 `~/.hipo_mcp_tokens.json`(0600 权限)。
41
+
42
+ ### 开发模式(从源码运行)
43
+
44
+ ```bash
45
+ git clone git@github.com:sexylin/hipowork-cli.git
46
+ cd hipowork-cli
47
+ python3.13 -m venv .venv
48
+ .venv/bin/pip install -e . # 可编辑安装,命令即 hipo
49
+ .venv/bin/python -m unittest discover -s tests # 运行测试
50
+ ```
51
+
52
+ ## 命令速查
53
+
54
+ ### 认证与令牌
55
+ | 命令 | 说明 |
56
+ |---|---|
57
+ | `hipo authorize --role candidate/employer [--email x]` | OAuth 授权(PKCE + 邮箱验证码) |
58
+ | `hipo status` | 查看当前 token:角色/scope/过期时间 |
59
+ | `hipo refresh` | 强制刷新 access_token |
60
+ | `hipo token-sync [--refresh]` | 导出 token 到浏览器 localStorage(4 个 base64) |
61
+ | `hipo accounts list/current/switch/delete` | 多账户管理(多邮箱多角色分开存) |
62
+
63
+ ### 求职者
64
+ | 命令 | 说明 |
65
+ |---|---|
66
+ | `hipo match-jobs [--json]` | 根据我的简历匹配岗位 |
67
+ | `hipo resume-extract <file.pdf> [--out x.txt]` | 提取简历文本(PDF/DOCX/TXT) |
68
+ | `hipo resume-validate <resume.json>` | 导入前校验 JSON 结构 |
69
+ | `hipo resume-import --json <resume.json>` | 校验后导入简历(推荐) |
70
+ | `hipo resume-import --text <resume.txt>` | 走平台 AI 服务解析后导入 |
71
+
72
+ ### 招聘方
73
+ | 命令 | 说明 |
74
+ |---|---|
75
+ | `hipo publish-job --title x --text "..." [--json file]` | 发布岗位 |
76
+ | `hipo search "自然语言描述" [--max n]` | 自然语言搜索候选人 |
77
+ | `hipo match-candidates --text "..." / --json cond.json / --job <id>` | 结构化匹配候选人 |
78
+ | `hipo market --keyword python [--industry tech]` | 人才市场分析 |
79
+ | `hipo stats` | 平台统计 |
80
+
81
+ ### 运维诊断
82
+ | 命令 | 说明 |
83
+ |---|---|
84
+ | `hipo healthcheck` | 检查 API / MCP / OAuth metadata / Embedding 连通性 |
85
+ | `hipo e2e` | 端到端冒烟:token → REST /auth/me → MCP 会话 → 工具调用 |
86
+
87
+ 任意命令加 `--help` 查看详细参数;大部分命令支持 `--json` 输出原始 JSON 便于脚本消费。
88
+
89
+ ## 简历导入两种方式
90
+
91
+ 1. **推荐:`--json`** — 用你自己的 LLM / Agent 把简历解析为结构化 JSON
92
+ (参考 `examples/resume.example.json`),本地校验通过后导入。不依赖平台 AI 服务。
93
+ ```bash
94
+ hipo resume-import --json my_resume.json
95
+ ```
96
+ 2. **`--text`** — 传入简历纯文本,由平台后端 AI 服务解析(需要后端配置了
97
+ AI_SERVICE_URL;否则会提示改用 `--json`)。
98
+ ```bash
99
+ hipo resume-extract resume.pdf --out resume.txt
100
+ hipo resume-import --text resume.txt
101
+ ```
102
+
103
+ `hipo resume-validate` 会提前发现常见问题:`duration_months` 缺失
104
+ (会导致经验年限不累计、岗位匹配经验分拿不到)、字段超长、类型错误、
105
+ 数量超限等,规则与后端 `POST /agent/import-resume` 的白名单/上限一致。
106
+
107
+ ## 目录结构
108
+
109
+ ```text
110
+ src/hipowork_cli/
111
+ __init__.py # 统一入口(console script: hipo)
112
+ scripts/
113
+ hipo_auth.py # 共享认证库:token 仓库/刷新/API 客户端
114
+ hipo_authorize.py # OAuth 授权 + 本地回调 + 统一成功页
115
+ hipo_token_status.py # token 状态
116
+ hipo_token_refresh.py # 强制刷新
117
+ hipo_token_sync.py # token → 浏览器 localStorage
118
+ hipo_accounts.py # 多账户管理
119
+ hipo_mcp_client.py # 业务封装:匹配/发布/搜索/统计/导入等
120
+ hipo_match_jobs.py # 求职者匹配岗位
121
+ hipo_publish_job.py # 发布岗位
122
+ hipo_search_candidates.py # 搜索候选人
123
+ hipo_match_candidates.py # 结构化匹配候选人
124
+ hipo_market.py # 市场分析
125
+ hipo_stats.py # 平台统计
126
+ hipo_resume_extract.py # 简历文本提取
127
+ hipo_resume_validate.py # 简历 JSON 校验
128
+ hipo_resume_import.py # 简历导入
129
+ hipo_healthcheck.py # 服务连通性检查
130
+ hipo_e2e.py # 端到端冒烟
131
+ templates/
132
+ success.html # 统一授权成功页(深色玻璃拟态)
133
+ examples/
134
+ resume.example.json # 结构化简历示例
135
+ job.example.json # 结构化岗位示例
136
+ tests/
137
+ test_hipo_accounts.py # 多账户管理单元测试
138
+ test_hipo_resume_import.py # 简历流水线单元测试
139
+ ```
140
+
141
+ ## 相关服务地址
142
+
143
+ ```text
144
+ API: https://api.hipowork.com (docs: /docs)
145
+ MCP: https://mcp.hipowork.com/mcp
146
+ 官网: https://hipowork.com
147
+ ```
@@ -0,0 +1,54 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "hipowork-cli"
7
+ version = "0.1.0"
8
+ description = "HiPo Work CLI — Agent 友好的招聘平台命令行工具集(OAuth 授权 / 岗位发布 / 候选人匹配 / 简历导入)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Lin Tong", email = "sexylin2010@gmail.com" }]
13
+ keywords = ["hipo", "hipowork", "recruitment", "hiring", "candidate-matching", "cli", "ai-agent"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Office/Business :: Financial :: Investment",
26
+ "Topic :: Utilities",
27
+ ]
28
+ dependencies = [
29
+ "mcp>=1.10",
30
+ "httpx>=0.27",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ resume = ["pymupdf>=1.24"]
35
+ dev = ["build>=1.0", "twine>=5.0", "pytest>=7.0"]
36
+
37
+ [project.urls]
38
+ Homepage = "https://hipowork.com"
39
+ Repository = "https://github.com/sexylin/hipowork-cli"
40
+ Documentation = "https://hipowork.com"
41
+
42
+ [project.scripts]
43
+ hipo = "hipowork_cli:main"
44
+
45
+ [tool.setuptools]
46
+ package-dir = { "" = "src" }
47
+ packages = ["hipowork_cli"]
48
+
49
+ [tool.setuptools.package-data]
50
+ hipowork_cli = [
51
+ "scripts/*.py",
52
+ "templates/*.html",
53
+ "examples/*.json",
54
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,116 @@
1
+ """HiPo Work CLI — 面向求职者和招聘方的命令行工具集。
2
+
3
+ 安装后提供 `hipo` 命令(等价于仓库根目录时代的 hipo.py):
4
+
5
+ hipo authorize --role candidate
6
+ hipo match-jobs
7
+ hipo publish-job --json examples/job.example.json
8
+
9
+ scripts/ 下 16 个子命令模块通过 hipo CLI 统一调度。
10
+ """
11
+ from __future__ import annotations
12
+
13
+ import os
14
+ import subprocess
15
+ import sys
16
+ from pathlib import Path
17
+
18
+ __version__ = "0.1.0"
19
+
20
+ SCRIPTS_DIR = Path(__file__).resolve().parent / "scripts"
21
+
22
+ # 命令名 → 对应脚本文件(不含 .py)
23
+ COMMANDS = {
24
+ "authorize": "hipo_authorize",
25
+ "status": "hipo_token_status",
26
+ "refresh": "hipo_token_refresh",
27
+ "token-sync": "hipo_token_sync",
28
+ "accounts": "hipo_accounts",
29
+ "match-jobs": "hipo_match_jobs",
30
+ "publish-job": "hipo_publish_job",
31
+ "search": "hipo_search_candidates",
32
+ "match-candidates": "hipo_match_candidates",
33
+ "market": "hipo_market",
34
+ "stats": "hipo_stats",
35
+ "resume-extract": "hipo_resume_extract",
36
+ "resume-validate": "hipo_resume_validate",
37
+ "resume-import": "hipo_resume_import",
38
+ "healthcheck": "hipo_healthcheck",
39
+ "e2e": "hipo_e2e",
40
+ }
41
+
42
+ # 各命令的一句话说明(help 输出用)
43
+ HELP = {
44
+ "authorize": "OAuth 授权(打开浏览器完成邮箱验证码登录)",
45
+ "status": "查看 token 状态(角色/scope/过期)",
46
+ "refresh": "强制刷新 token",
47
+ "token-sync": "导出 token 到浏览器 localStorage(4 个 base64)",
48
+ "accounts": "多账户管理(list/switch/delete)",
49
+ "match-jobs": "求职者:匹配岗位",
50
+ "publish-job": "招聘方:发布岗位",
51
+ "search": "招聘方:自然语言搜索候选人",
52
+ "match-candidates": "招聘方:结构化/自然语言匹配候选人",
53
+ "market": "招聘方:人才市场分析",
54
+ "stats": "平台统计",
55
+ "resume-extract": "简历文本提取(PDF/DOCX/TXT)",
56
+ "resume-validate": "简历 JSON 结构校验",
57
+ "resume-import": "简历导入(校验 + 写入)",
58
+ "healthcheck": "服务连通性检查(API/MCP/Embedding)",
59
+ "e2e": "端到端冒烟测试",
60
+ }
61
+
62
+ # 需要前置授权的命令(帮助提示用)
63
+ AUTH_REQUIRED = {
64
+ "status", "refresh", "token-sync", "accounts", "match-jobs", "publish-job",
65
+ "search", "match-candidates", "market", "stats", "resume-import", "e2e",
66
+ }
67
+
68
+
69
+ def _print_help() -> None:
70
+ print("HiPo Work CLI — 统一入口")
71
+ print("用法: hipo <command> [args...]\n")
72
+ print("认证与令牌:")
73
+ for k in ("authorize", "status", "refresh", "token-sync", "accounts"):
74
+ print(f" {k:<16} {HELP[k]}")
75
+ print("\n招聘方:")
76
+ for k in ("publish-job", "search", "match-candidates", "market", "stats"):
77
+ print(f" {k:<16} {HELP[k]}")
78
+ print("\n求职者:")
79
+ for k in ("match-jobs", "resume-extract", "resume-validate", "resume-import"):
80
+ print(f" {k:<16} {HELP[k]}")
81
+ print("\n运维:")
82
+ for k in ("healthcheck", "e2e"):
83
+ print(f" {k:<16} {HELP[k]}")
84
+ print("\n任何命令都可用 --help 查看详细参数,例如:")
85
+ print(" hipo publish-job --help")
86
+ print("\n也可以直接运行 src/hipowork_cli/scripts/ 下的独立脚本(等价)。")
87
+
88
+
89
+ def main() -> int:
90
+ # 允许从任意目录运行:把 scripts/ 加进 PYTHONPATH
91
+ env = dict(os.environ)
92
+ pythonpath = env.get("PYTHONPATH", "")
93
+ env["PYTHONPATH"] = str(SCRIPTS_DIR) + (os.pathsep + pythonpath if pythonpath else "")
94
+
95
+ args = sys.argv[1:]
96
+ if not args or args[0] in ("-h", "--help", "help"):
97
+ _print_help()
98
+ return 0
99
+
100
+ cmd = args[0]
101
+ if cmd not in COMMANDS:
102
+ print(f"❌ 未知命令: {cmd}\n", file=sys.stderr)
103
+ _print_help()
104
+ return 2
105
+
106
+ script = SCRIPTS_DIR / f"{COMMANDS[cmd]}.py"
107
+ if not script.exists():
108
+ print(f"❌ 脚本缺失: {script}", file=sys.stderr)
109
+ return 2
110
+
111
+ # 转发剩余参数;子进程继承 PYTHONPATH,保证 scripts 内部互相 import 正常
112
+ return subprocess.call([sys.executable, str(script), *args[1:]], env=env)
113
+
114
+
115
+ if __name__ == "__main__":
116
+ sys.exit(main())
@@ -0,0 +1,24 @@
1
+ {
2
+ "title": "Python/FastAPI 后端工程师",
3
+ "raw_text": "成都 Python/FastAPI 后端开发,3 年以上经验,要求高并发系统经验,熟悉 PostgreSQL,有区块链经验优先",
4
+ "required": [
5
+ {"field": "location", "operator": "eq", "value": "成都"},
6
+ {"field": "experience_years", "operator": "gte", "value": 3}
7
+ ],
8
+ "preferred": {
9
+ "semantic_query": "高并发系统设计,FastAPI 后端,区块链 Web3",
10
+ "skills": [
11
+ {"name": "FastAPI", "min_years": 2, "weight": 1.0},
12
+ {"name": "PostgreSQL", "min_years": 2, "weight": 1.0},
13
+ {"name": "Python", "min_years": 3, "weight": 1.0}
14
+ ],
15
+ "keywords": [
16
+ {"text": "高并发", "weight": 1.0},
17
+ {"text": "智能合约", "weight": 0.8}
18
+ ]
19
+ },
20
+ "salary_min": 20,
21
+ "salary_max": 35,
22
+ "salary_unit": "monthly",
23
+ "benefits": ["五险一金", "弹性工作", "远程办公", "年终奖"]
24
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "basic_info": {
3
+ "name": "张三",
4
+ "location": "成都",
5
+ "headline": "区块链全栈工程师",
6
+ "summary": "5 年全栈开发经验,专注区块链与 Web3,熟悉 Solidity 智能合约、Python/FastAPI 后端和 React 前端,主导过多个 DeFi 项目从 0 到 1。",
7
+ "industry": "tech"
8
+ },
9
+ "work_experiences": [
10
+ {
11
+ "company": "某科技公司",
12
+ "role": "高级全栈工程师",
13
+ "start_date": "2022-03",
14
+ "end_date": "2026-08",
15
+ "duration_months": 53,
16
+ "industry": "tech",
17
+ "responsibilities": ["负责核心后端服务设计与开发", "主导智能合约安全审计流程"],
18
+ "achievements": ["支撑百万级用户的高并发系统,QPS 提升 40%"],
19
+ "tech_stack": ["Python", "FastAPI", "PostgreSQL", "Redis", "Solidity"],
20
+ "team_size": 8,
21
+ "ai_summary": "5 年全栈经验,主导多个区块链项目"
22
+ }
23
+ ],
24
+ "projects": [
25
+ {
26
+ "name": "DeFi 借贷协议",
27
+ "role": "核心开发者",
28
+ "start_date": "2023-01",
29
+ "end_date": "2024-06",
30
+ "description": "基于 Solidity 的链上借贷协议,支持多币种抵押借贷与清算",
31
+ "responsibilities": ["设计智能合约架构", "实现清算机器人"],
32
+ "achievements": ["TVL 峰值 5000 万美元", "通过第三方安全审计"],
33
+ "tech_stack": ["Solidity", "Hardhat", "Web3.js"],
34
+ "project_url": "https://github.com/example/defi-lending",
35
+ "ai_summary": "链上借贷协议,TVL 峰值 5000 万美元"
36
+ }
37
+ ],
38
+ "education": [
39
+ {
40
+ "school": "某大学",
41
+ "degree": "本科",
42
+ "major": "计算机科学与技术",
43
+ "start_year": 2015,
44
+ "end_year": 2019,
45
+ "gpa": 3.6,
46
+ "school_type": "211",
47
+ "ai_summary": "计算机本科,GPA 3.6"
48
+ }
49
+ ],
50
+ "skills": [
51
+ {"name": "Python", "category": "programming_language", "level": 5, "years": 5, "context": "后端开发,AI 服务"},
52
+ {"name": "Solidity", "category": "programming_language", "level": 4, "years": 3, "context": "智能合约开发"},
53
+ {"name": "FastAPI", "category": "framework", "level": 4, "years": 3, "context": "后端 API 服务"},
54
+ {"name": "PostgreSQL", "category": "tool", "level": 4, "years": 4, "context": "数据存储,pgvector 向量检索"}
55
+ ],
56
+ "certificates": [
57
+ {"name": "区块链工程师认证", "issuer": "某机构", "year": 2023}
58
+ ],
59
+ "languages": [
60
+ {"language": "中文", "level": "native"},
61
+ {"language": "英语", "level": "business"}
62
+ ]
63
+ }