ai-pdf-builder
由人工智能驱动的 PDF 生成器,用于生成法律文档、推介材料和报告。 SAFE、NDA、条款清单、白皮书。 npx ai-pdf-builder。与 Claude、Cursor、GPT、Copilot 一起工作。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~nextfrontierbuilds-ai-pdf-buildercURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~nextfrontierbuilds-ai-pdf-builder/file -o nextfrontierbuilds-ai-pdf-builder.md# AI PDF Builder
**YC-style docs in seconds.** AI-powered PDF generator for legal documents, pitch decks, and professional reports.
Generate SAFEs, NDAs, term sheets, whitepapers, and memos from simple prompts. Works with Claude, GPT, Cursor, and AI coding agents. Perfect for:
- Whitepapers & Litepapers
- Term Sheets
- SAFEs & NDAs
- Memos & Reports
- Legal Agreements
## What's New in v1.1.0
- **AI Content Generation** - Generate documents from prompts using Claude
- **`--company` Flag** - Inject company name directly via CLI
- **`enhance` Command** - Improve existing content with AI
- **`summarize` Command** - Generate executive summaries from documents
- **Content Sanitization** - Automatic cleanup of AI-generated content
## Requirements
**Option A: Local Generation (Free, Unlimited)**
```bash
# 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
```
**Option B: Cloud API (Coming Soon)**
No install required. Get API key at ai-pdf-builder.com
**For AI Features:**
Set your Anthropic API key:
```bash
export ANTHROPIC_API_KEY="your-key-here"
```
## Usage
### Check System
```bash
npx ai-pdf-builder check
```
### Generate via CLI
```bash
# 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 Content Generation (New!)
```bash
# 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"
```
### Enhance Existing Content (New!)
```bash
# 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
```
### Summarize Documents (New!)
```bash
# 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
```
### Generate via Code
```typescript
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.' }
);
```
## Document Types
| Type | Function | Best For |
|------|----------|----------|
| `whitepaper` | `generateWhitepaper()` | Technical docs, litepapers |
| `memo` | `generateMemo()` | Executive summaries |
| `agreement` | `generateAgreement()` | Legal contracts |
| `termsheet` | `generateTermsheet()` | Investment terms |
| `safe` | `generateSAFE()` | SAFE agreements |
| `nda` | `generateNDA()` | Non-disclosure agreements |
| `report` | `generateReport()` | Business reports |
| `proposal` | `generateProposal()` | Business proposals |
## Custom Branding
```typescript
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 Instructions
When a user asks to generate a PDF:
1. Check what type of document they need (whitepaper, term sheet, memo, etc.)
2. Determine if they want AI generation or have existing content
3. Get the content - either from their message, a file, or use AI to generate
4. Ask for metadata if not provided (title, author, company name)
5. Use `--company` flag to inject company branding
6. Check if Pandoc is installed: `which pandoc`
7. If Pandoc missing, provide install instructions or suggest cloud API
8. Generate the PDF using the appropriate function
9. Send the PDF file to the user
**AI Commands Quick Reference:**
- `ai <type> "<prompt>"` - Generate new document from prompt
- `enhance <file>` - Improve existing content
- `summarize <file>` - Create executive summary
- `--company "Name"` - Add company branding to any command
## Links
- npm: https://www.npmjs.com/package/ai-pdf-builder
- GitHub: https://github.com/NextFrontierBuilds/ai-pdf-builder
---
Built by [@NextXFrontier](https://x.com/NextXFrontier) & [@DLhugly](https://github.com/DLhugly)
---
## 中文说明
# AI PDF Builder
**几秒钟生成 YC 风格的文档。** 由人工智能驱动的 PDF 生成器,用于生成法律文档、推介材料和专业报告。
通过简单的提示词即可生成 SAFE、NDA、条款清单、白皮书和备忘录。可与 Claude、GPT、Cursor 以及各类 AI 编程 Agent 协同工作。非常适合:
- 白皮书与简版白皮书(Litepaper)
- 条款清单(Term Sheet)
- SAFE 与 NDA
- 备忘录与报告
- 法律协议
## v1.1.0 新特性
- **AI 内容生成** —— 使用 Claude 根据提示词生成文档
- **`--company` 参数** —— 通过 CLI 直接注入公司名称
- **`enhance` 命令** —— 借助 AI 改进现有内容
- **`summarize` 命令** —— 从文档生成执行摘要
- **内容清洗** —— 自动清理 AI 生成的内容
## 环境要求
**方案 A:本地生成(免费、无限制)**
```bash
# 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 密钥:
```bash
export ANTHROPIC_API_KEY="your-key-here"
```
## 使用方式
### 检查系统
```bash
npx ai-pdf-builder check
```
### 通过 CLI 生成
```bash
# 从 markdown 文件
npx ai-pdf-builder generate whitepaper ./content.md -o output.pdf
# 附带公司名称
npx ai-pdf-builder generate whitepaper ./content.md -o output.pdf --company "Acme Corp"
# 文档类型:whitepaper, memo, agreement, termsheet, safe, nda, report, proposal
```
### AI 内容生成(新功能!)
```bash
# 根据提示词生成白皮书
npx ai-pdf-builder ai whitepaper "Write a whitepaper about decentralized identity" -o identity.pdf
# 带公司品牌信息生成
npx ai-pdf-builder ai whitepaper "AI in healthcare" -o healthcare.pdf --company "HealthTech Inc"
# 生成其他文档类型
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"
```
### 改进现有内容(新功能!)
```bash
# 改进并扩展现有 markdown
npx ai-pdf-builder enhance ./draft.md -o enhanced.md
# 一步完成改进并转换为 PDF
npx ai-pdf-builder enhance ./draft.md -o enhanced.pdf --pdf
```
### 总结文档(新功能!)
```bash
# 生成执行摘要
npx ai-pdf-builder summarize ./long-document.md -o summary.md
# 以 PDF 形式生成摘要
npx ai-pdf-builder summarize ./report.pdf -o summary.pdf --pdf
```
### 通过代码生成
```typescript
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 L