nudocs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNudocs
Nudocs
Upload documents to Nudocs.ai for rich editing, get shareable links, and pull back the results.
将文档上传至Nudocs.ai进行富文本编辑,获取可共享链接,并拉取编辑后的结果。
Setup
配置步骤
- Install the CLI:
bash
npm install -g @nutrient-sdk/nudocs-cli-
Get your API key from https://nudocs.ai (click "Integration" after signing in)
-
Configure the key:
bash
undefined- 安装CLI:
bash
npm install -g @nutrient-sdk/nudocs-cli-
配置密钥:
bash
undefinedOption 1: Environment variable
选项1:环境变量
export NUDOCS_API_KEY="nudocs_your_key_here"
export NUDOCS_API_KEY="nudocs_your_key_here"
Option 2: Config file
选项2:配置文件
mkdir -p ~/.config/nudocs
echo "nudocs_your_key_here" > ~/.config/nudocs/api_key
undefinedmkdir -p ~/.config/nudocs
echo "nudocs_your_key_here" > ~/.config/nudocs/api_key
undefinedCommands
命令
bash
nudocs upload <file> # Upload and get edit link
nudocs list # List all documents
nudocs link [ulid] # Get edit link (last upload if no ULID)
nudocs pull [ulid] [--format fmt] # Download document (default: docx)
nudocs delete <ulid> # Delete a document
nudocs config # Show configurationbash
nudocs upload <file> # 上传文档并获取编辑链接
nudocs list # 列出所有文档
nudocs link [ulid] # 获取编辑链接(未指定ULID则返回最后一次上传的文档链接)
nudocs pull [ulid] [--format fmt] # 下载文档(默认格式:docx)
nudocs delete <ulid> # 删除文档
nudocs config # 查看配置信息Workflow
工作流程
Upload Flow
上传流程
- Create/write document content
- Save as markdown (or other supported format)
- Run:
nudocs upload <file> - Share the returned edit link with user
- 创建/撰写文档内容
- 保存为markdown(或其他支持的格式)
- 运行:
nudocs upload <file> - 将返回的编辑链接分享给用户
Pull Flow
拉取流程
- User requests document back
- Run:
nudocs pull [ulid] --format <fmt> - Read and present the downloaded file
- 用户请求取回文档
- 运行:
nudocs pull [ulid] --format <fmt> - 读取并展示下载后的文件
Format Selection
格式选择
| Scenario | Recommended Format |
|---|---|
| User edited with rich formatting | |
| Simple text/code content | |
| Final delivery/sharing | |
See for full format support.
references/formats.md| 场景 | 推荐格式 |
|---|---|
| 用户进行了富格式编辑 | |
| 简单文本/代码内容 | |
| 最终交付/分享 | |
完整格式支持请查看。
references/formats.mdNatural Language Triggers
自然语言触发指令
Recognize these user intents:
Upload/Send:
- "send to nudocs"
- "upload to nudocs"
- "open in nudocs"
- "edit this in nudocs"
- "let me edit this in nudocs"
- "put this in nudocs"
Pull/Fetch:
- "pull it back"
- "pull from nudocs"
- "get that doc"
- "fetch from nudocs"
- "download from nudocs"
- "grab the updated version"
- "what did I change"
- "get my edits"
Link:
- "get the nudocs link"
- "share link"
- "where's that doc"
- "nudocs url"
List:
- "show my nudocs"
- "list my documents"
- "what docs do I have"
- "my nudocs documents"
识别以下用户意图:
上传/发送:
- "send to nudocs"
- "upload to nudocs"
- "open in nudocs"
- "edit this in nudocs"
- "let me edit this in nudocs"
- "put this in nudocs"
拉取/获取:
- "pull it back"
- "pull from nudocs"
- "get that doc"
- "fetch from nudocs"
- "download from nudocs"
- "grab the updated version"
- "what did I change"
- "get my edits"
链接:
- "get the nudocs link"
- "share link"
- "where's that doc"
- "nudocs url"
列表:
- "show my nudocs"
- "list my documents"
- "what docs do I have"
- "my nudocs documents"
Document Best Practices
文档最佳实践
Before uploading, ensure good structure:
- Clear heading hierarchy (H1 → H2 → H3)
- Consistent spacing
- Appropriate list formatting
- Concise paragraphs (3-5 sentences)
See for templates and guidelines.
references/document-design.md上传前,请确保文档结构规范:
- 清晰的标题层级(H1 → H2 → H3)
- 统一的间距
- 合适的列表格式
- 简洁的段落(3-5句话)
模板和指南请查看。
references/document-design.mdExample Session
示例会话
User: Write me a blog post about remote work and send it to Nudocs
Agent:
1. Writes blog-remote-work.md with proper structure
2. Runs: nudocs upload blog-remote-work.md
3. Returns: "Here's your Nudocs link: https://nudocs.ai/file/01ABC..."
User: *edits in Nudocs, adds formatting, images*
User: Pull that back
Agent:
1. Runs: nudocs pull --format docx
2. Reads the downloaded file
3. Returns: "Got your updated document! Here's what changed..."用户:写一篇关于远程工作的博客文章并发送到Nudocs
Agent:
1. 撰写结构规范的blog-remote-work.md
2. 运行:nudocs upload blog-remote-work.md
3. 返回:"这是你的Nudocs链接:https://nudocs.ai/file/01ABC..."
用户:*在Nudocs中编辑,添加格式、图片*
用户:把它拉回来
Agent:
1. 运行:nudocs pull --format docx
2. 读取下载的文件
3. 返回:"已获取你更新后的文档!以下是修改内容..."Error Handling
错误处理
| Error | Cause | Solution |
|---|---|---|
| "No API key found" | Missing credentials | Set NUDOCS_API_KEY or create config file |
| "DOCUMENT_LIMIT_REACHED" | Free tier limit (10 docs) | Delete old docs or upgrade to Pro |
| "Unauthorized" | Invalid API key | Regenerate key in Nudocs settings |
| "No ULID provided" | Missing document ID | Specify ULID or upload a doc first |
| 错误信息 | 原因 | 解决方案 |
|---|---|---|
| "No API key found" | 缺少凭证 | 设置NUDOCS_API_KEY环境变量或创建配置文件 |
| "DOCUMENT_LIMIT_REACHED" | 免费版额度上限(10个文档) | 删除旧文档或升级至Pro版 |
| "Unauthorized" | API密钥无效 | 在Nudocs设置中重新生成密钥 |
| "No ULID provided" | 缺少文档ID | 指定ULID或先上传文档 |
Links
相关链接
- CLI: https://github.com/PSPDFKit/nudocs-cli
- MCP Server: https://github.com/PSPDFKit/nudocs-mcp-server
- Nudocs: https://nudocs.ai