Convert an attached Word document, presentation, spreadsheet, OpenDocument file, RTF, EPUB, CSV, or text-based PDF into local Markdown. Use when a message suppl
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-convert-documents-to-markdown-10365922c86b ,按照其中的说明把「convert-documents-to-markdown」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use the installed Firecrawl AnyDoc CLI (MIT). Conversion is local to the agent container.
Use the exact local attachment path supplied in the message. Current Chat SDK attachments normally use /workspace/inbox/<message-id>/<file>. Encode the path as a single-quoted shell literal, replacing each apostrophe with '"'"'. Never paste an untrusted path inside double quotes because command substitutions still execute there. Quote generated paths, put options before --, and put the input after it:
input_path='/workspace/inbox/<message-id>/<document>'
mkdir -p "/workspace/agent/converted"
output_dir="$(mktemp -d "/workspace/agent/converted/anydoc.XXXXXX")"
output_path="$output_dir/document.md"
timeout 60s anydoc -o "$output_path" -- "$input_path"
printf 'Converted document: %s\n' "$output_path"
For example, this assigns a filename containing both shell syntax and an apostrophe without executing it:
input_path='/workspace/inbox/msg/report $(echo unsafe) '"'"'Q3'"'"'.docx'
The -- prevents a filename beginning with - from becoming an option. If timeout is unavailable, run the same anydoc command without the wrapper.
For CSV read from stdin, name the format explicitly:
anydoc - --format csv < "$input_path"
Prefer -o except for tiny inputs. Read only the relevant sections of large Markdown files instead of placing the complete output in model context.