catalog/repos/ahpxex--resume-cli.md

146 lines
4.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CLI简历生成工具
`CLI` `简历` `PDF` `Bun` `模板`
# resumy
English README / [中文文档](https://github.com/ahpxex/resume-cli/blob/main/README.zh-CN.md)
`resumy` 是一个以 Bun 为核心的 CLI 工具,可通过结构化参数和内置模板生成精美简历。设计目标是保持可脚本化、确定性,并对偏好显式命令输入而非交互式流程的 Agent 或高级用户友好。
## 安装
使用 Bun 全局安装 `resumy`
```bash
bun add -g resumy
bun install -g resumy
```
安装后,全局命令为:
```bash
resumy --help
```
## 发布到 npm
将包公开发布到 npm
```bash
npm login
npm publish
```
发布后,其他用户可以用 Bun 全局安装并直接调用 `resumy`
## 安装 Agent Skill
本仓库还为 `skills` 安装器提供了 `agent-resume` skill。
从 GitHub 安装:
```bash
bunx skills add https://github.com/ahpxex/resume-cli --skill agent-resume
```
开发时本地调试:
```bash
bunx skills add . --list
bunx skills add . --skill agent-resume
```
## 快速开始
列出内置模板:
```bash
resumy templates
```
生成 PDF 简历:
```bash
resumy generate pdf \
--theme professional \
--name "Jordan Lee" \
--title "产品工程师" \
--email "jordan@example.com" \
--phone "+1 (555) 123-4567" \
--location "旧金山,加利福尼亚" \
--website "https://jordanlee.dev" \
--link "GitHub|https://github.com/jordanlee" \
--link "LinkedIn|https://linkedin.com/in/jordanlee" \
--summary "具有产品思维的工程师,有丰富的精美用户体验交付经验。" \
--experience "role=高级产品工程师;company=Northstar Labs;start=2022;end=至今;location=远程;summary=主导面向客户工作流的前端架构。" \
--experience-bullet "0|跨三个产品团队构建了基于设计系统的 UI 平台。" \
--experience-bullet "0|通过引导式设置流程将新用户引导完成率提升了 18%。" \
--experience-tech "0|TypeScript, React, Bun, 设计系统" \
--project "name=Resume Studio;role=创建者;url=https://github.com/jordanlee/resume-studio;summary=一个面向结构化内容的模板驱动简历渲染器。" \
--project-bullet "0|设计了支持多种布局的标准化简历数据结构。" \
--project-tech "0|TypeScript, Bun, HTML, CSS" \
--education "institution=华盛顿大学;degree=计算机科学学士;start=2015;end=2019;location=西雅图,华盛顿州" \
--education-highlight "0|专注于人机交互与分布式系统。" \
--skill-group "编程语言|TypeScript, JavaScript, SQL, HTML, CSS" \
--skill-group "框架|React, Next.js, Bun, Node.js" \
--extra "认证|AWS 认证云从业者" \
--output ./dist/resume.pdf
```
同时输出中间 HTML 文件:
```bash
resumy generate pdf ... --html-output ./dist/resume.html
```
## 命令
- `resumy templates`:列出内置布局
- `resumy generate pdf`:通过显式参数生成 PDF 简历
## PDF 导出原理
`resumy` 先将结构化简历数据渲染为 HTML然后通过 Playwright 启动无头浏览器,让浏览器将该 HTML 打印为 PDF。这样既保持了模板开发的简洁性又保留了浏览器级别的布局、字体、颜色和打印样式。
## Playwright 与 Chromium
- `resumy` 依赖 Playwright JavaScript 包进行浏览器自动化。
- 发布的 `resumy` 包本身不在包内捆绑 Chromium 二进制文件。
- 运行时,`resumy` 优先使用 Playwright 的 Chromium如果不可用则回退到本地安装的 Google Chrome。
- 如果两者都不可用,请通过 `bunx playwright install chromium` 安装 Chromium。
## 输入模型
CLI 设计上是显式的,重复条目通过重复参数传入:
- `--experience "role=...;company=...;start=...;end=...;location=...;summary=..."`
- `--experience-bullet "0|构建了某项功能"`
- `--experience-tech "0|TypeScript, React, Bun"`
- `--project "name=...;role=...;url=...;summary=..."`
- `--project-bullet "0|交付了某项功能"`
- `--project-tech "0|TypeScript, Bun, HTML, CSS"`
- `--education "institution=...;degree=...;start=...;end=...;location=..."`
- `--education-highlight "0|专注于..."`
- `--skill-group "编程语言|TypeScript, JavaScript, SQL"`
- `--extra "认证|AWS 认证云从业者"`
使用从零开始的索引将要点和技术栈附加到对应条目。
## 排版选项
- `--density``standard`(标准)或 `compact`(紧凑)
- `--theme-color`:链接、标题及视觉细节的强调色
- `--font-family`:正文字体栈
- `--heading-font-family`:标题字体栈
- `--font-face`:嵌入本地 `.ttf``.otf``.woff``.woff2` 字体文件
## 开发
```bash
bun install
bun run check
bun test
bun run build
npm publish --dry-run
```