Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

picgo

PicGo3.1kMIT1.5.9TypeScript support: included

A tool for picture uploading

picture, upload, util

readme

PicGo-Core

standard GitHub Build Status npm PicGo Convention node

picgo-core

A tool for picture uploading. Both CLI & api supports. It also supports plugin system, please check Awesome-PicGo to find powerful plugins.

Typora supports PicGo-Core natively. If you like PicGo-Core and have time, welcome to help me translate the documentation of PicGo-Core into English.

Installation

PicGo should be installed with node.js >= 12 (v1.5.0-alpha.4 and small) & node.js >= 16 (since v1.5.0-alpha.5).

Global install

npm install picgo -g

# or

yarn global add picgo

Local install

npm install picgo -D

# or

yarn add picgo -D

Usage

Use in CLI

PicGo uses SM.MS as the default upload pic-bed.

Show help:

$ picgo -h

  Usage: picgo [options] [command]

  Options:

    -v, --version                 output the version number
    -d, --debug                   debug mode
    -s, --silent                  silent mode
    -c, --config <path>           set config path
    -h, --help                    output usage information

  Commands:

    install|add <plugins...>             install picgo plugin
    uninstall|rm <plugins...>            uninstall picgo plugin
    update <plugins...>                  update picgo plugin
    set|config <module> [name]           configure config of picgo modules
    upload|u [input...]                  upload, go go go
    use [module]                         use modules of picgo
    init [options] <template> [project]  create picgo plugin\'s development templates

Upload a picture from path

picgo upload /xxx/xx/xx.jpg

Upload a picture from clipboard

picture from clipboard will be converted to png

picgo upload

Thanks to vs-picgo && Spades-S for providing the method to upload picture from clipboard.

Use in node project

Common JS

const { PicGo } = require('picgo')

ES Module

import { PicGo } from 'picgo'

API usage example

const picgo = new PicGo()

// upload a picture from path
picgo.upload(['/xxx/xxx.jpg'])

// upload a picture from clipboard
picgo.upload()

Documentation

For more details, you can checkout documentation.

changelog

:tada: 1.5.9 (2025-06-08)

:bug: Bug Fixes

  • encoded url fileName unreadable (9df7893)
  • unable to use clip in wayland (7cc047b)
  • wayland copy image upload bug (ab3f03e)

:tada: 1.5.8 (2024-11-25)

:sparkles: Features

  • add millisecond for file name (6e4c488)

:tada: 1.5.7 (2024-07-16)

:bug: Bug Fixes

  • tencent cos url encode bug (8572c1c)

:tada: 1.5.6 (2023-09-06)

:bug: Bug Fixes

:tada: 1.5.5 (2023-08-26)

:sparkles: Features

:tada: 1.5.4 (2023-07-08)

:sparkles: Features

  • change proxy\registry -> npmProxy (9bedce3)

:tada: 1.5.3 (2023-05-07)

:sparkles: Features

  • update encodeOutputURL behavior (82347ff)

:tada: 1.5.2 (2023-05-07)

:bug: Bug Fixes

:tada: 1.5.1 (2023-04-09)

:sparkles: Features

  • add mime-types for some uploaders (fb59681)
  • add settings.encodeOutputURL options for URL encode (2b9c791)

:bug: Bug Fixes

  • smms error message is an object (527d19e)
  • tencent cos UA bug (cb64d84)

:tada: 1.5.0 (2022-11-13)

:tada: 1.5.0-alpha.17 (2022-11-13)

:sparkles: Features

:bug: Bug Fixes

  • some case will cause proxy not work (6272303)

:tada: 1.5.0-alpha.16 (2022-11-09)

:bug: Bug Fixes

  • upyun url-options is not required (9736a11)

:tada: 1.5.0-alpha.15 (2022-10-24)

:bug: Bug Fixes

  • tencent cos url encode bug (eafb70f)

:tada: 1.5.0-alpha.14 (2022-10-24)

:bug: Bug Fixes

:tada: 1.5.0-alpha.13 (2022-10-19)

:bug: Bug Fixes

:package: Chore

  • create oldRequest types (749359a)

:tada: 1.5.0-alpha.12 (2022-10-14)

:bug: Bug Fixes

:tada: 1.5.0-alpha.11 (2022-10-13)

:tada: 1.5.0-alpha.10 (2022-09-25)

:sparkles: Features

:bug: Bug Fixes

  • some texts in zh-TW (#136) (907e6c9)
  • url image download bug & tencent cos url encode bug (53d54f8)

:tada: 1.5.0-alpha.9 (2022-09-03)

:sparkles: Features

  • finish request -> axios (b89cf1e)

:bug: Bug Fixes

  • qiniu error msg can't show (0e4661b)
  • sm.ms backupDomain message text (45424d1)
  • when request-options resolveWithFullResponse is false bug (eb8217a)

:tada: 1.5.0-alpha.8 (2022-08-27)

:sparkles: Features

  • add backupDomain for sm.ms (c6d54f1)
  • add debug logger type (4342268)
  • add picgo.use for easily using plugin (c0107f1)

:bug: Bug Fixes

  • sometime tencent-cloud error message is empty (6355e1b)

:tada: 1.5.0-alpha.7 (2022-08-20)

:sparkles: Features

:bug: Bug Fixes

  • aliyun content-type -> Content-Type (a649fcc)

:tada: 1.5.0-alpha.6 (2022-08-17)

:bug: Bug Fixes

  • tencent cos upload error (61df53a)

:tada: 1.5.0-alpha.5 (2022-07-31)

:sparkles: Features

  • add log file size limit (158be01)
  • change inner db to @picgo/store (0e90af3)

:bug: Bug Fixes

:tada: 1.5.0-alpha.4 (2022-05-26)

:sparkles: Features

  • add userAgent for tencent cloud COS (acac59a)

:tada: 1.5.0-alpha.3 (2022-04-04)

:bug: Bug Fixes

  • picgo-gui clipboard image uploading error (1302f76)

:tada: 1.5.0-alpha.2 (2022-04-03)

:sparkles: Features

:bug: Bug Fixes

:tada: 1.5.0-alpha.1 (2022-03-08)

:sparkles: Features

:bug: Bug Fixes

:package: Chore

  • add alpha branch for alpha version (6882022), closes #106

:tada: 1.5.0-alpha.0 (2021-10-26)

:package: Chore

  • build: migrate to esbuild and change export assignment to esm export (#102) (2a6cd18)

:tada: 1.4.26 (2021-08-23)

:bug: Bug Fixes

  • engine bug in package.json (1c65144)

:tada: 1.4.25 (2021-08-21)

:bug: Bug Fixes

  • handle clipboard file path error (ff4ec86), closes #97
  • error: throw error when transform failed (#96) (57fce75)
  • clipboard path contains space (#95) (d2b73c1)

:tada: 1.4.24 (2021-08-01)

:sparkles: Features

  • uploaded now can be modified since picgo will not use this value (b6a8b58)

:tada: 1.4.23 (2021-07-27)

:bug: Bug Fixes

  • cases when clipboard of wsl contain image file (#91) (adfc55e)

:package: Chore

  • add github actions for publishing (caae80e)

:tada: 1.4.22 (2021-07-27)

:sparkles: Features

  • smms: smms now supports image without token (#89) (456b81c)
  • add support for clipboard in wsl (#87) (3e230de)

:tada: 1.4.21 (2021-05-09)

:bug: Bug Fixes

  • output empty after uploading when using isolate context (79c228b)

:tada: 1.4.20 (2021-05-09)

:sparkles: Features

  • add createContext for each upload process (ecde023)

:package: Chore

:tada: 1.4.19 (2021-04-04)

:sparkles: Features

  • add current uploader && transformer log (67b2bb1)
  • limit some of config's capabilities (f901505)

:tada: 1.4.18 (2021-03-06)

:bug: Bug Fixes

  • unregister plugin delete pluginMap (85228d8)

:tada: 1.4.17 (2021-02-09)

:bug: Bug Fixes

  • type: type error in index.d.ts (f617658), closes #69

:tada: 1.4.16 (2021-02-08)

:sparkles: Features

  • add proxy & registry options for pluginHandler (b10b963)
  • dynamic proxy getter with ctx.Request.request (687805f), closes #64
  • supporting install specific version of plugin (35e15b0)

:tada: 1.4.15 (2021-01-24)

:sparkles: Features

  • add local plugin install/uninstall/update support & imporve plugin name handler (f8ec464)

:tada: 1.4.14 (2020-12-19)

:bug: Bug Fixes

:tada: 1.4.13 (2020-12-19)

:sparkles: Features

  • new addPlugin api for node projects (5a18432)

:bug: Bug Fixes

  • type: some type error (233a6ca)
  • pluginLoader can't get the full plugin list (83535b9), closes #60

:tada: 1.4.12 (2020-11-04)

:bug: Bug Fixes

  • let tcyun error info more detail (ddf645f)
  • not encode before uploading an image with url (c0aee32)
  • qiniu error handler (de94212)

:tada: 1.4.11 (2020-07-12)

:bug: Bug Fixes

  • initailize db function error (df7d526)

:tada: 1.4.10 (2020-06-28)

:bug: Bug Fixes

:tada: 1.4.9 (2020-06-27)

:sparkles: Features

  • add plugin running && error logs (6adc070)
  • transformer: add fallback to support more image formats such as HEIC (0f5d2a9), closes #13

:bug: Bug Fixes

  • multiline logs format (444a42f)
  • the issue of lost logs (daa7508)
  • the order of the uploaded list may not be the same as the order entered (2bf1ed9), closes #40
  • unregisterPlugin's bug (966bfd8)

:package: Chore

  • add vscode workspace settings & migrate tslint to eslint (50a4842)

:tada: 1.4.8 (2020-04-04)

:bug: Bug Fixes

  • encode url before finishing (7a6b39c)
  • return true if decodeURI throw error to avoid crash (d09d77a)
  • win10 cmd crash bug when "picgo upload" (#35) (deec252)

:tada: 1.4.7 (2020-03-07)

:sparkles: Features

:pencil: Documentation

:tada: 1.4.6 (2020-02-23)

:bug: Bug Fixes

  • auto generate a local png bug (c54ac67)

:tada: 1.4.5 (2020-02-23)

:sparkles: Features

  • add upload image from URL support (0d87342)

:package: Chore

  • travis-ci deploy option (a2a89cd)

:tada: 1.4.4 (2019-12-30)

:bug: Bug Fixes

:tada: 1.4.3 (2019-12-27)

:sparkles: Features

  • add aliyun optionUrl option (0a3bdea)

:tada: 1.4.2 (2019-12-26)

:bug: Bug Fixes

:tada: 1.4.1 (2019-12-26)

:tada: 1.4.0 (2019-12-26)

:sparkles: Features

  • add config methods && pluginHandler to ctx (f9bb9fb)
  • plugin: passing environment variables (50467c7)

:bug: Bug Fixes

:package: Chore

  • types: added typings field to export type inform… (#23) (8bb16e7)

:tada: 1.3.7 (2019-05-12)

:bug: Bug Fixes

  • clipboard: clipboard image getter error in macOS (8314604)

:tada: 1.3.6 (2019-04-20)

:bug: Bug Fixes

  • clipboard image upload under win10 (48b72ed)

:tada: 1.3.5 (2019-04-15)

:bug: Bug Fixes

  • writing log sometimes disappeared (d36c0ae)

:package: Chore