Nudocs
Upload documents to Nudocs.ai for rich editing, get shareable links, and pull back the results.
Setup
- 1. Install the CLI:
CODEBLOCK0
- 2. Get your API key from https://nudocs.ai (click "Integration" after signing in)
- 3. Configure the key:
CODEBLOCK1
Commands
CODEBLOCK2
Workflow
Upload Flow
- 1. Create/write document content
- Save as markdown (or other supported format)
- Run: INLINECODE0
- Share the returned edit link with user
Pull Flow
- 1. User requests document back
- Run: INLINECODE1
- Read and present the downloaded file
Format Selection
| Scenario | Recommended Format |
|---|
| User edited with rich formatting | INLINECODE2 (default) |
| Simple text/code content |
md |
| Final delivery/sharing |
pdf |
See references/formats.md for full format support.
Natural 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"
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 references/document-design.md for templates and guidelines.
Example Session
CODEBLOCK3
Error Handling
| Error | Cause | Solution |
|---|
| "No API key found" | Missing credentials | Set NUDOCSAPIKEY or create config file |
| "DOCUMENTLIMITREACHED" |
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 |
Links
- - CLI: https://github.com/PSPDFKit/nudocs-cli (
@nutrient-sdk/nudocs-cli on npm) - MCP Server: https://github.com/PSPDFKit/nudocs-mcp-server
- Nudocs: https://nudocs.ai
Nudocs
将文档上传至 Nudocs.ai 进行富文本编辑,获取可分享的链接,并拉取编辑结果。
设置
- 1. 安装 CLI:
bash
npm install -g @nutrient-sdk/nudocs-cli
- 2. 从 https://nudocs.ai 获取 API 密钥(登录后点击集成)
- 3. 配置密钥:
bash
方式 1:环境变量
export NUDOCS
APIKEY=nudocs
yourkey_here
方式 2:配置文件
mkdir -p ~/.config/nudocs
echo nudocs
yourkey
here > ~/.config/nudocs/apikey
命令
bash
nudocs upload # 上传并获取编辑链接
nudocs list # 列出所有文档
nudocs link [ulid] # 获取编辑链接(未指定 ULID 则使用上次上传的文档)
nudocs pull [ulid] [--format fmt] # 下载文档(默认格式:docx)
nudocs delete # 删除文档
nudocs config # 显示配置信息
工作流程
上传流程
- 1. 创建/编写文档内容
- 保存为 markdown(或其他支持的格式)
- 运行:nudocs upload
- 将返回的编辑链接分享给用户
拉取流程
- 1. 用户请求取回文档
- 运行:nudocs pull [ulid] --format
- 读取并展示下载的文件
格式选择
| 场景 | 推荐格式 |
|---|
| 用户进行了富文本编辑 | docx(默认) |
| 纯文本/代码内容 |
md |
| 最终交付/分享 | pdf |
完整格式支持请参见 references/formats.md。
自然语言触发
识别以下用户意图:
上传/发送:
- - 发送到 nudocs
- 上传到 nudocs
- 在 nudocs 中打开
- 在 nudocs 中编辑
- 让我在 nudocs 中编辑
- 把这个放到 nudocs
拉取/获取:
- - 拉取回来
- 从 nudocs 拉取
- 获取那个文档
- 从 nudocs 获取
- 从 nudocs 下载
- 获取更新版本
- 我改了什么
- 获取我的编辑内容
链接:
- - 获取 nudocs 链接
- 分享链接
- 那个文档在哪
- nudocs 网址
列表:
- - 显示我的 nudocs
- 列出我的文档
- 我有哪些文档
- 我的 nudocs 文档
文档最佳实践
上传前,确保结构良好:
- - 清晰的标题层级(H1 → H2 → H3)
- 一致的间距
- 合适的列表格式
- 简洁的段落(3-5 句)
模板和指南请参见 references/document-design.md。
示例会话
用户:帮我写一篇关于远程工作的博客文章,并发送到 Nudocs
助手:
- 1. 编写结构良好的 blog-remote-work.md
- 运行:nudocs upload blog-remote-work.md
- 返回:这是您的 Nudocs 链接:https://nudocs.ai/file/01ABC...
用户:在 Nudocs 中编辑,添加格式和图片
用户:拉取回来
助手:
- 1. 运行:nudocs pull --format docx
- 读取下载的文件
- 返回:已获取更新后的文档!以下是更改内容...
错误处理
| 错误 | 原因 | 解决方案 |
|---|
| 未找到 API 密钥 | 缺少凭据 | 设置 NUDOCSAPIKEY 或创建配置文件 |
| 文档数量已达上限 |
免费版限制(10 个文档) | 删除旧文档或升级到 Pro 版 |
| 未授权 | API 密钥无效 | 在 Nudocs 设置中重新生成密钥 |
| 未提供 ULID | 缺少文档 ID | 指定 ULID 或先上传文档 |
链接
- - CLI:https://github.com/PSPDFKit/nudocs-cli(npm 上的 @nutrient-sdk/nudocs-cli)
- MCP 服务器:https://github.com/PSPDFKit/nudocs-mcp-server
- Nudocs:https://nudocs.ai