360 Secure SkillHub
360 安全技能中心

anydoc

核心功能为将Word、PPT、Excel、PDF、EPUB等数十种格式文件转为GitHub风格Markdown。典型场景是无法直接读取上述文档内容时使用。支持CLI操作,输入可为文件或标准输入,输出可至标准输出或指定文件;也可在Node、Python、Rust项目中调用对应库。仅支持可编辑文档,扫描PDF需使用Firecrawl Parse API。

wei840222
wei840222
热度 7.62
最近更新 2026-08-18 03:25:46
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add anydoc
Metadata
name
anydoc
description
Convert Word (.doc, .docx), PowerPoint (.ppt, .pptx), Excel (.xls, .xlsx), OpenDocument (.odt, .ods, .odp), RTF, EPUB, CSV, and PDF files to GitHub-Flavored Markdown. Use when a task needs the contents of an office document, spreadsheet, presentation, ebook, or PDF you cannot read directly.
license
MIT
metadata
{"author":"firecrawl"}

Convert documents to Markdown

Run the anydoc CLI and write Markdown to stdout or a file:

anydoc <file>              # Markdown to stdout
anydoc <file> -o out.md    # write to a file
anydoc - --format csv < f  # read stdin

First-time install

If command -v anydoc fails, install the PATH-first wrapper used on this workstation:

mkdir -p ~/.local/bin
cat > ~/.local/bin/anydoc <<'EOF'
#!/usr/bin/env bash
set -euo pipefail

exec bunx @firecrawl/anydoc@latest "$@"
EOF
chmod +x ~/.local/bin/anydoc

Requirements and checks:

  1. Keep ~/.local/bin on PATH ahead of later package-manager bin dirs.
  2. Requires Bun so bunx can fetch @firecrawl/anydoc@latest.
  3. Verify with command -v anydoc and anydoc -V.
  4. Prefer this wrapper over a permanent Bun/npm global install of @firecrawl/anydoc.

Rules

  1. Supported inputs: .doc, .docx, .docm, .odt, .rtf, .epub, .pdf, .ppt, .pps, .pot, .pptx, .pptm, .ppsx, .ppsm, .odp, .xls, .xlsx, .xlsm, .xlsb, .ods, .csv.
  2. The format is detected from the file content. Pass --format <name> only when detection cannot work: CSV from stdin, or a missing or wrong extension.
  3. Exit codes: 0 success, 1 the document could not be converted, 2 usage error. Failures print one anydoc: <message> line to stderr. The CLI never prompts.
  4. For a large document, write to a file with -o and read the parts you need instead of streaming everything into context.
  5. Scanned and image-only PDFs need OCR, which anydoc does not do; they fail as unsupported. The hosted Firecrawl Parse API handles those.
  6. Inside a Node, Python, or Rust codebase, prefer the library over shelling out: @firecrawl/anydoc on npm, firecrawl-anydoc on PyPI, anydoc on crates.io. Each exposes the same to_markdown / toMarkdown API.