A tool for image uploading. Both CLI & api supports. It also supports plugin system, please check Awesome-PicGo to find powerful plugins.
More details please see the Homepage of PicGo.
Typora supports PicGo-Core natively.
PicGo requires Node.js >= 20.19.0 or >= 22.12.0. For older PicGo versions (<= v1.5.x), Node.js >= 16 is sufficient. Cause we need the stability of ES Module support.
npm install picgo -g
# or
yarn global add picgonpm install picgo -D
# or
yarn add picgo -DPicGo uses
SM.MS(S.EE)as the default upload image host.
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
-p, --proxy <url> set proxy for uploading
-h, --help display help for command
Commands:
install|add [options] <plugins...> install picgo plugin
uninstall|rm <plugins...> uninstall picgo plugin
update [options] <plugins...> update picgo plugin
set <module> [name] [configName] configure config of picgo modules (uploader/transformer/plugin)
upload|u [input...] upload, go go go
use [module] [name] [configName] use module (uploader/transformer/plugin) of picgo
get get current picgo module config (uploader/transformer/plugins)
i18n [lang] change picgo language
uploader manage uploader configurations
server [options] run PicGo as a standalone server
login [token] login to cloud.picgo.app
logout logout from cloud.picgo.app
cloud manage PicGo Cloud
help [command] display help for commandpicgo upload /xxx/xx/xx.jpgpicture from clipboard will be converted to
png
picgo uploadThanks to vs-picgo && Spades-S for providing the method to upload picture from clipboard.
picgo server -p 36677 -h 127.0.0.1Login to PicGo Cloud
picgo login
# or
picgo login <token>Logout from PicGo Cloud
picgo logoutUse picgo cloud auth status to inspect the current PicGo Cloud login state without triggering an interactive login. The check is non-blocking: when there is no local token it returns immediately without any network request.
picgo cloud auth status
# machine-readable output
picgo cloud auth status --format jsonThe command sets a process exit code so it can be used in scripts:
| Status | Meaning | Exit code |
|---|---|---|
logged_in |
Token is valid | 0 |
logged_out |
No local token | 1 |
invalid |
Token exists but is rejected by the server (401) | 2 |
error |
Probe failed (network / server error) | 3 |
The --format json output is a single line, e.g.:
{"status":"logged_in","loggedIn":true,"user":"someone","plan":1}Use picgo get to read the currently selected picgo modules. Each subcommand supports --format pretty|json (defaults to pretty).
# current uploader type (resolved as picBed.uploader -> picBed.current -> picgo-cloud)
picgo get uploader
# current transformer (defaults to path)
picgo get transformer
# installed plugins with enabled/disabled state
picgo get plugins
# machine-readable output
picgo get uploader --format json
picgo get plugins --format jsonIn json mode each command prints a single parseable line, e.g.:
{"uploader":"github"}
{"transformer":"path"}
{"plugins":[{"name":"picgo-plugin-xxx","enabled":true}]}Since v1.8.0, PicGo-Core supports multiple configurations per uploader. Just like the configuration of the Electron version of PicGo.
You can use picgo set uploader <type> [configName] to configure different uploader configurations.
And you can use picgo use uploader <type> [configName] to switch between different uploader configurations.
For example:
picgo set uploader github Test
picgo use uploader github TestFor more details, you can use picgo uploader -h to check the help of uploader management:
Usage: picgo uploader [options] [command]
Options:
-h, --help display help for command
Commands:
list [type] list uploader configurations
rename <type> <oldName> <newName> rename a config
copy <type> <configName> <newConfigName> copy a config (does not switch current uploader)
rm <type> <configName> remove a configNote: the plugin's template initializer has moved to the standalone picgo-init package.
You can use the following command to init a picgo plugin template:
npx picgo-init plugin <your-plugin-folder>const { PicGo } = require('picgo')import { PicGo } from 'picgo'const picgo = new PicGo()
// upload a picture from path
picgo.upload(['/xxx/xxx.jpg'])
// upload a picture from clipboard
picgo.upload()For more details, you can checkout documentation.
