You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set|config <module> [name] configure config of picgo modules
23
+
set|config <module> [name] [configName] configure config of picgo modules
24
24
upload|u [input...] upload, go go go
25
-
use [module] use modules of picgo
25
+
use [module] [name] [configName] use modules of picgo
26
+
uploader [command] manage uploader configurations
26
27
i18n [lang] change picgo language
27
28
help [command] display helpforcommand
28
29
```
@@ -46,9 +47,9 @@ The CLI is built with [commander.js](https://github.com/tj/commander.js/) and [i
46
47
```bash
47
48
$ picgo use -h
48
49
49
-
Usage: use [module]
50
+
Usage: use [module] [name] [configName]
50
51
51
-
use modules of picgo
52
+
use a module (uploader/transformer/plugin) of picgo
52
53
```
53
54
54
55
PicGo ships with the following built-ins:
@@ -84,28 +85,60 @@ $ picgo use
84
85
(Move up and down to reveal more choices)
85
86
```
86
87
88
+
Starting from PicGo-Core `v1.8.0`, uploaders support multiple named configs. If an uploader has multiple configs, the interactive flow will ask you to choose one. You can also specify it directly:
89
+
90
+
```bash
91
+
picgo use uploader <type><configName>
92
+
```
93
+
94
+
`configName` is matched case-insensitively.
95
+
87
96
After you choose, PicGo will upload using the selected module. Some modules need configuration before you can use them (for example, tokens/keys for an image host). In that case, use `set|config` (described below) to configure the module.
88
97
89
-
## config|set
98
+
## uploader <Badgetext="1.8.0+" />
99
+
100
+
Manage uploader configurations (multi-config).
101
+
102
+
-`picgo uploader` opens an interactive prompt (list/rename/copy/delete).
103
+
-`picgo uploader list [type]` lists configs (marks current uploader and default config).
-`picgo uploader copy <type> <configName> <newConfigName>` (does not switch current uploader)
106
+
-`picgo uploader rm <type> <configName>`
107
+
108
+
Config names are matched case-insensitively.
109
+
110
+
Examples:
111
+
112
+
```bash
113
+
picgo uploader list
114
+
picgo uploader list github
115
+
picgo uploader rename github Work Personal
116
+
picgo uploader copy github Work Staging
117
+
picgo uploader rm github Staging
118
+
```
119
+
120
+
## set
90
121
91
122
> Configure module settings. There are three kinds of modules: 1) transformer 2) uploader 3) plugins
92
123
93
124
```bash
94
125
$ picgo set -h
95
126
96
-
Usage: set|config [options] <module> [name]
127
+
Usage: set [options] <module> [name] [configName]
97
128
98
-
configure config of picgo modules
129
+
configure config of picgo modules (uploader/transformer/plugin)
99
130
100
131
Options:
101
132
102
133
-h, --help output usage information
103
134
```
104
135
105
136
::: tip Tip
106
-
Most of the time you only need to configure an Uploader. You can run `picgo set uploader` (or `picgo set uploader weibo|tcyun|...`) to jump straight into the interactive prompt.
137
+
Most of the time you only need to configure an uploader. You can run `picgo set uploader` (or `picgo set uploader <type> [configName]`) to jump straight into the interactive prompt.
107
138
:::
108
139
140
+
Starting from PicGo-Core `v1.8.0`, `set uploader` works with uploader multi-config: you can choose an existing config (by name) or create a new one, and the saved config becomes the active config for that uploader.
141
+
109
142
For the detailed configuration fields of built-in uploaders (image hosts), refer to PicGo’s configuration [wiki](https://github.com/Molunerfinn/PicGo/wiki/%E8%AF%A6%E7%BB%86%E7%AA%97%E5%8F%A3%E7%9A%84%E4%BD%BF%E7%94%A8)。
110
143
111
144
If an uploader/transformer/plugin has no configurable options, PicGo will still report success—this is expected.
To manage or switch configs, see [CLI Commands](/guide/commands) (`picgo use uploader ...`, `picgo uploader ...`) or use the Node.js API (`ctx.uploaderConfig`).
237
+
193
238
## picgoPlugins
194
239
195
240
This section stores all plugin names and is mainly used to determine whether a plugin is enabled or disabled. **It is generated by PicGo automatically—you don’t need to edit it.**
@@ -203,6 +248,159 @@ Example:
203
248
}
204
249
```
205
250
251
+
## settings
252
+
253
+
General settings not tied to a specific uploader/transformer/plugin.
`match` is a JavaScript regular expression source. For advanced patterns you may need to escape backslashes in JSON strings, e.g. `\\.` for a literal dot.
If your `match` uses parentheses to capture parts of the URL, you can reference them in `replace` (e.g. `$1` for the first group, `$2` for the second).
365
+
In this example, `$1` is the captured `images`, and `$2` is the rest of the path (`2026/1.png`):
366
+
367
+
```json
368
+
{
369
+
"settings": {
370
+
"urlRewrite": {
371
+
"rules": [
372
+
{
373
+
"match": "^https://example\\.com/(images)/(.*)$",
374
+
"replace": "https://cdn.example.com/blog-$1/$2"
375
+
}
376
+
]
377
+
}
378
+
}
379
+
}
380
+
```
381
+
382
+
Advanced example (rewrite GitHub raw URLs to jsDelivr):
0 commit comments