关于 ai-pdf-builder
AI PDF Builder 是用于从提示词或现有内容生成专业文档的命令行工具和库。它支持文档生成、内容润色、摘要制作和公司品牌信息。
主要功能
- 01将 Markdown 转为 PDF
- 02根据 AI 提示词生成文档
- 03润色现有内容
- 04总结文档
- 05添加公司品牌信息
适用场景
- 01根据提示词撰写白皮书
- 02将现有草稿转换为 PDF
- 03生成执行摘要
- 04制作带品牌信息的法律或商务文档
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ pedronauck/ skills --skill ai-pdf-builder安装后在 Claude Code 中输入/ai-pdf-builder确认已加载。
附带文件README.md_meta.json
详细介绍
AI PDF Builder
数秒内生成 YC 风格文档。 由 AI 驱动的 PDF 生成器,适用于法律文档、融资演示文稿和专业报告。
只需简单提示词,即可生成 SAFE、NDA、条款清单、白皮书和备忘录。兼容 Claude、GPT、Cursor 和 AI 编码 Agent。适用于:
- 白皮书和轻量白皮书
- 条款清单
- SAFE 和 NDA
- 备忘录和报告
- 法律协议
v1.1.0 新增内容
- AI 内容生成 - 使用 Claude 根据提示词生成文档
--company标志 - 通过 CLI 直接注入公司名称enhance命令 - 使用 AI 改进现有内容summarize命令 - 根据文档生成执行摘要- 内容清理 - 自动清理 AI 生成的内容
要求
选项 A:本地生成(免费、不限量)
# macOS
brew install pandoc
brew install --cask basictex
sudo tlmgr install collection-fontsrecommended fancyhdr titlesec enumitem xcolor booktabs longtable geometry hyperref graphicx setspace array multirow
# Linux
sudo apt-get install pandoc texlive-full
选项 B:云端 API(即将推出) 无需安装。前往 ai-pdf-builder.com 获取 API 密钥
AI 功能: 设置你的 Anthropic API 密钥:
export ANTHROPIC_API_KEY="your-key-here"
用法
检查系统
npx ai-pdf-builder check
通过 CLI 生成
# From markdown file
npx ai-pdf-builder generate whitepaper ./content.md -o output.pdf
# With company name
npx ai-pdf-builder generate whitepaper ./content.md -o output.pdf --company "Acme Corp"
# Document types: whitepaper, memo, agreement, termsheet, safe, nda, report, proposal
AI 内容生成(新增!)
# Generate a whitepaper from a prompt
npx ai-pdf-builder ai whitepaper "Write a whitepaper about decentralized identity" -o identity.pdf
# Generate with company branding
npx ai-pdf-builder ai whitepaper "AI in healthcare" -o healthcare.pdf --company "HealthTech Inc"
# Generate other document types
npx ai-pdf-builder ai termsheet "Series A for a fintech startup" -o termsheet.pdf
npx ai-pdf-builder ai memo "Q4 strategy update" -o memo.pdf --company "TechCorp"
改进现有内容(新增!)
# Improve and expand existing markdown
npx ai-pdf-builder enhance ./draft.md -o enhanced.md
# Enhance and convert to PDF in one step
npx ai-pdf-builder enhance ./draft.md -o enhanced.pdf --pdf
总结文档(新增!)
# Generate executive summary
npx ai-pdf-builder summarize ./long-document.md -o summary.md
# Summarize as PDF
npx ai-pdf-builder summarize ./report.pdf -o summary.pdf --pdf
通过代码生成
import { generateWhitepaper, generateTermsheet, generateSAFE, aiGenerate, enhance, summarize } from 'ai-pdf-builder';
// AI-Generated Whitepaper
const aiResult = await aiGenerate('whitepaper',
'Write about blockchain scalability solutions',
{ company: 'ScaleChain Labs' }
);
// Whitepaper from content
const result = await generateWhitepaper(
'# My Whitepaper\n\nContent here...',
{ title: 'Project Name', author: 'Your Name', version: 'v1.0', company: 'Acme Corp' }
);
if (result.success) {
fs.writeFileSync('whitepaper.pdf', result.buffer);
}
// Enhance existing content
const enhanced = await enhance(existingMarkdown);
// Summarize a document
const summary = await summarize(longDocument);
// Term Sheet with company
const termsheet = await generateTermsheet(
'# Series Seed Term Sheet\n\n## Investment Amount\n\n$500,000...',
{ title: 'Series Seed', subtitle: 'Your Company Inc.', company: 'Investor LLC' }
);
// SAFE
const safe = await generateSAFE(
'# Simple Agreement for Future Equity\n\n...',
{ title: 'SAFE Agreement', subtitle: 'Your Company Inc.' }
);
文档类型
| 类型 | 功能 | 适用场景 |
|---|---|---|
whitepaper | generateWhitepaper() | 技术文档、轻量白皮书 |
memo | generateMemo() | 执行摘要 |
agreement | generateAgreement() | 法律合同 |
termsheet | generateTermsheet() | 投资条款 |
safe | generateSAFE() | SAFE 协议 |
nda | generateNDA() | 保密协议 |
report | generateReport() | 商业报告 |
proposal | generateProposal() | 商业提案 |
自定义品牌
const result = await generateWhitepaper(content, metadata, {
customColors: {
primary: '#E85D04', // Signal Orange
secondary: '#14B8A6', // Coordinate Teal
accent: '#0D0D0D' // Frontier Dark
},
fontSize: 11,
margin: '1in',
paperSize: 'letter'
});
Agent 指令
当用户要求生成 PDF 时:
- 确认他们需要哪种类型的文档(白皮书、条款清单、备忘录等)
- 确定他们想使用 AI 生成内容,还是已有内容
- 获取内容——可以来自他们的消息、文件,或使用 AI 生成
- 如果未提供元数据,则询问元数据(标题、作者、公司名称)
- 使用
--company标志注入公司品牌信息 - 检查是否已安装 Pandoc:
which pandoc - 如果缺少 Pandoc,则提供安装说明或建议使用云端 API
- 使用适当的函数生成 PDF
- 将 PDF 文件发送给用户
AI 命令快速参考:
ai <type> "<prompt>"- 根据提示词生成新文档enhance <file>- 改进现有内容summarize <file>- 创建执行摘要--company "Name"- 为任意命令添加公司品牌信息
链接
- npm:https://www.npmjs.com/package/ai-pdf-builder
- GitHub:https://github.com/NextFrontierBuilds/ai-pdf-builder
由 @NextXFrontier 和 @DLhugly 构建
评论
支持 Markdown