npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

picgo-plugin-atomgit

v1.0.1

Published

PicGo uploader for AtomGit (atomgit.com) image hosting

Readme

PicGo-Plugin-AtomGit

一个基于 AtomGit 的 PicGo 图床插件,让您的图片管理更简单高效

📖 简介

这是一个 PicGo 的插件,支持将图片上传到 AtomGit 平台,并作为图床使用。AtomGit 是由开放原子开源基金会携手 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持"开放、中立、公益"的核心理念,打破传统代码托管边界,将代码托管、模型共享、数据集托管、智能体开发与算力服务深度整合,为全球开发者提供从开发、训练到部署的全链路一站式体验。

本插件由 picgo-plugin-gitcode 迁移而来,针对 AtomGit 平台域名与默认分支差异做了完整适配,并增强了可配置性与错误处理。

✨ 主要功能

  • 🚀 将图片上传到您的 AtomGit 仓库
  • 🔗 自动生成图片访问链接(raw 域名 / 自定义 CDN)
  • 🗑️ 支持图片删除功能(同步删除仓库文件)
  • 📝 支持自定义提交信息
  • 📂 支持自定义存储路径
  • 🔒 安全的令牌管理(Authorization 头,不暴露在 URL 中)
  • 🌿 自动检测仓库默认分支(兼容 main / master)
  • ⚙️ 支持自定义 API 域名与文件域名(私有部署 / 代理 / 多实例)

🤔 开发背景

在使用 Markdown 写作时,图片管理一直是一个痛点。虽然已经有了很多图床服务,但是:

  1. 第三方图床可能存在稳定性问题
  2. 免费图床可能有带宽限制
  3. 付费图床成本较高
  4. 对图片资源缺乏控制权

基于以上原因,我们开发了这个 AtomGit 图床插件。选择 AtomGit 的原因是:

  • 免费且稳定的存储服务
  • 完整的版本控制
  • 支持大文件存储
  • 提供 CDN 加速
  • 可以完全控制自己的图片资源
  • 国内访问速度快、无需额外代理

📥 安装

方式一:图形界面安装(推荐)

  1. 打开 PicGo 客户端
  2. 进入「插件设置」
  3. 搜索 picgo-plugin-atomgit
  4. 点击「安装」按钮

方式二:命令行安装

# 全局安装 PicGo-Core
npm install picgo -g

# 安装 AtomGit 插件
picgo install picgo-plugin-atomgit

# 或者使用 npm 直接安装
npm install picgo-plugin-atomgit -g

⚙️ 配置说明

必要参数

插件需要配置以下参数:

| 参数名 | 说明 | 是否必填 | 示例 | |-------|------|---------|------| | owner | AtomGit 仓库所有者用户名 | 是 | your-username | | repo | 仓库名称 | 是 | your-repo | | branch | 分支名(不填自动检测,默认 main) | 否 | main | | path | 图片存储路径 | 否 | images | | token | AtomGit 的访问令牌 | 是 | your-token | | message | 提交信息 | 否 | Upload by PicGo | | apiUrl | API 域名(默认 https://atomgit.com) | 否 | https://atomgit.com | | fileDomain | 文件域名(默认 https://raw.atomgit.com) | 否 | https://raw.atomgit.com | | customUrl | 自定义 CDN 前缀(可选) | 否 | https://your-cdn.com/picgo |

💡 apiUrl / fileDomain / customUrl 一般无需修改,默认值已适配 AtomGit 官方服务。仅在您使用代理、私有部署或自建 CDN 时才需要配置。

获取 Token 步骤

  1. 登录 AtomGit 账号
  2. 进入「设置」→「私人令牌」(或直接访问 https://atomgit.com/setting/token-classic )
  3. 点击「生成新令牌」(需要勾选 repo 权限)
  4. 复制并保存生成的令牌(注意:令牌只显示一次!)

配置示例

在 PicGo 客户端中配置,或在配置文件中:

{
  "picBed": {
    "current": "atomgit",
    "atomgit": {
      "owner": "your-username",
      "repo": "your-repo",
      "branch": "main",
      "path": "images",
      "token": "your-token",
      "message": "Upload by PicGo"
    }
  }
}

🚀 使用方法

  1. 完成插件配置
  2. 在 PicGo 中选择「AtomGit图床」作为默认图床
  3. 上传图片即可自动同步到 AtomGit 仓库

上传方式

  • 拖拽上传:直接将图片拖拽到 PicGo 上传区
  • 剪贴板上传:截图后使用快捷键上传
  • 文件选择:点击上传区选择图片文件

删除图片

在 PicGo 相册中,右键点击图片,选择「删除图片」,插件会同时删除 AtomGit 仓库中的对应图片。

🔄 从 picgo-plugin-gitcode 迁移

如果您正在使用 picgo-plugin-gitcode,迁移非常简单:

  1. 在 PicGo 中安装 picgo-plugin-atomgit
  2. 重新填写配置(owner / repo / token 保持一致即可)
  3. 将「默认图床」切换为 atomgit
  4. 分支字段留空,插件会自动检测仓库默认分支(GitCode 仓库多为 master,AtomGit 新建仓库默认为 main)

两个插件共享同一套 Gitee v5 风格 API,接口完全兼容,只是目标平台域名不同。

⚠️ 注意事项

  • 确保仓库为公开仓库,否则图片无法正常访问
  • token 请妥善保管,不要泄露
  • 建议设置专门的图床仓库
  • 首次使用时,如果仓库中不存在配置的路径,插件会自动创建

🔧 常见问题

上传失败

  • 检查网络连接:确保能够正常访问 AtomGit
  • 检查 Token:确认 Token 有效且具有 repo 权限
  • 检查仓库设置:确认仓库名称和路径正确
  • 提示 Token 无效或权限不足(401/403):请重新生成 Token,并在生成时勾选 repo 权限

图片无法显示

  • 检查仓库可见性:确保仓库为公开仓库
  • 检查分支名:确认分支与仓库实际默认分支一致(本插件已支持自动检测)
  • CDN 缓存:新上传的图片可能需要几分钟时间更新 CDN 缓存

上传遇到速率限制

AtomGit API 默认限制为 50 次/分钟,插件已内置智能速率控制(自动等待与重试),批量上传时请耐心等待。

📚 进阶使用

与 Typora 集成

  1. 在 Typora 中,进入「文件」→「偏好设置」→「图像」
  2. 选择「上传图片」并选择 PicGo 路径
  3. 点击「验证图片上传选项」测试配置

自定义 CDN

如果您有自己的 CDN 或反代,可以在配置中添加 customUrl 字段:

{
  "customUrl": "https://your-cdn.com/picgo"
}

配置后图片预览地址将使用该前缀,同时删除功能仍会通过 API 同步删除仓库文件。

🛠️ 开发相关

本地开发

# 克隆仓库
git clone https://atomgit.com/nutpi/picgo-plugin-atomgit.git

# 安装依赖
cd picgo-plugin-atomgit
npm install

# 链接到全局
npm link

# 在 PicGo 中启用开发中的插件
picgo use picgo-plugin-atomgit

贡献代码

  1. Fork 本仓库
  2. 创建您的特性分支 (git checkout -b feature/amazing-feature)
  3. 提交您的更改 (git commit -s -m 'feat: add some amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 打开一个 Pull Request

📝 参考文档

📄 许可证

MIT License © 坚果派