nudocs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Nudocs

Nudocs

Upload documents to Nudocs.ai for rich editing, get shareable links, and pull back the results.
将文档上传至Nudocs.ai进行富文本编辑,获取可共享链接,并拉取编辑后的结果。

Setup

配置步骤

  1. Install the CLI:
bash
npm install -g @nutrient-sdk/nudocs-cli
  1. Get your API key from https://nudocs.ai (click "Integration" after signing in)
  2. Configure the key:
bash
undefined
  1. 安装CLI:
bash
npm install -g @nutrient-sdk/nudocs-cli
  1. 配置密钥:
bash
undefined

Option 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
undefined
mkdir -p ~/.config/nudocs echo "nudocs_your_key_here" > ~/.config/nudocs/api_key
undefined

Commands

命令

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 configuration
bash
nudocs upload <file>              # 上传文档并获取编辑链接
nudocs list                       # 列出所有文档
nudocs link [ulid]                # 获取编辑链接(未指定ULID则返回最后一次上传的文档链接)
nudocs pull [ulid] [--format fmt] # 下载文档(默认格式:docx)
nudocs delete <ulid>              # 删除文档
nudocs config                     # 查看配置信息

Workflow

工作流程

Upload Flow

上传流程

  1. Create/write document content
  2. Save as markdown (or other supported format)
  3. Run:
    nudocs upload <file>
  4. Share the returned edit link with user
  1. 创建/撰写文档内容
  2. 保存为markdown(或其他支持的格式)
  3. 运行:
    nudocs upload <file>
  4. 将返回的编辑链接分享给用户

Pull Flow

拉取流程

  1. User requests document back
  2. Run:
    nudocs pull [ulid] --format <fmt>
  3. Read and present the downloaded file
  1. 用户请求取回文档
  2. 运行:
    nudocs pull [ulid] --format <fmt>
  3. 读取并展示下载后的文件

Format Selection

格式选择

ScenarioRecommended Format
User edited with rich formatting
docx
(default)
Simple text/code content
md
Final delivery/sharing
pdf
See
references/formats.md
for full format support.
场景推荐格式
用户进行了富格式编辑
docx
(默认)
简单文本/代码内容
md
最终交付/分享
pdf
完整格式支持请查看
references/formats.md

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"
识别以下用户意图:
上传/发送:
  • "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
references/document-design.md
for templates and guidelines.
上传前,请确保文档结构规范:
  • 清晰的标题层级(H1 → H2 → H3)
  • 统一的间距
  • 合适的列表格式
  • 简洁的段落(3-5句话)
模板和指南请查看
references/document-design.md

Example 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

错误处理

ErrorCauseSolution
"No API key found"Missing credentialsSet 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 keyRegenerate key in Nudocs settings
"No ULID provided"Missing document IDSpecify 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

相关链接