Skip to main content

image-upload

scan a document's local image references and upload to ImgBB / Freeimage / UploadMe / ImgLink, replacing links in-place. Use when the user says "上传图片", "replace local image links", "全量转存", "mirror images", "scan and upload images", "图床化".

설치로 이동

소스 정보

저장소
jspi-fu/Aeson-skills
최근 소스 활동
2026년 9월 18일 00:33
감지된 SKILL.md 언어
중국어
스타
46
포크
2

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
16 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
image-upload
description
scan a document's local image references and upload to ImgBB / Freeimage / UploadMe / ImgLink, replacing links in-place. Use when the user says "上传图片", "replace local image links", "全量转存", "mirror images", "scan and upload images", "图床化".
# 图床化 Skill 扫描文档(Markdown / HTML)中的本地图片引用,上传至图床,将本地路径替换为远程 URL。 ## 执行步骤 ### Step 1 — 确定模式 根据用户意图选择模式: - **document 模式**:用户指定一篇文档 → 扫描其中的本地图片引用(`![](./...)` / `<img src="...">`) - **single 模式**:用户指定单张图片文件 → 直接上传,返回 URL - **mirror 模式**:用户要求"全量转存"/"把文档里所有图片(含网络图片)搬到我的图床" → 扫描本地 + 文档内已有的远程 URL 图片,一并转存 _完成标准:模式已确定,目标文件路径 / 图片路径已明确。_ ### Step 2 — 加载配置 运行 `node scripts/upload.mjs --help` 确认脚本可用,然后查找 `.env` 文件(搜索顺序:当前目录 → Skill 目录 → `~/.claude/` → `~/`)。 读取 `IMAGE_UPLOAD_PROVIDER`(默认 `imglink`)和对应的 API Key 环境变量。 **如果 API Key 缺失**(出现 `Missing *_API_KEY` 错误): 1. 展示对应图床的 API Key 获取链接(见 [`references/providers.md`](references/providers.md)) 2. 询问用户粘贴 Key 3. 将 Key 写入 `.env` 文件(优先写到项目目录;如不存在则写到 `~/.claude/.env`) 4. 静默重试上传 _完成标准:API Key 已就绪,provider 已确认;或用户明确放弃。_ ### Step 3 — 上传 根据模式调用脚本: ```bash # document 模式(仅打印映射表) node scripts/upload.mjs /path/to/document.md # document 模式(原地替换链接) node scripts/upload.mjs /path/to/document.md --replace # mirror 模式(含网络图片,原地替换) node scripts/upload.mjs /path/to/document.md --mirror --replace # single 模式 node scripts/upload.mjs /path/to/image.png ``` **SVG / AVIF / 大文件**:SVG、ICO 仅 ImgLink 支持,AVIF 仅 ImgLink 与 UploadMe 支持;超过当前 provider 单文件上限(ImgLink 50MB / ImgBB 32MB / Freeimage 64MB / UploadMe 64MB)时切换到支持的 provider(详见 [`references/providers.md`](references/providers.md))。四家都不支持时跳过该图并保留原链接。 **mirror 幂等**:若远程图片的 host 已是目标图床域名,跳过再次转存。 _完成标准:所有扫描到的图片都有上传结果(成功 URL 或明确的跳过理由),无遗漏。_ ### Step 4 — 输出结果 - **document 模式(无 `--replace`)**:输出映射表 `本地路径 → 远程直链 → Markdown 引用` - **document 模式(有 `--replace`)**:确认文档已写回,报告替换数量 - **single 模式**:返回 URL、`![name](url)`、`<img src="url">`、`[IMG]url[/IMG]` _完成标准:结果已展示给用户;替换模式下文档已实际写回磁盘。_
GitHub에서 보기