LinuxCommandLibrary

picgo

Upload images to image hosting services

TLDR

Interactively select a hosting service

$ picgo set uploader
copy

Upload the image in current clipboard
$ picgo upload
copy

Upload an image from a specific path
$ picgo upload [path/to/image]
copy

SYNOPSIS

picgo <command> [options] [arguments]
picgo <subcommand> [options]

PARAMETERS

command: upload [files...]
    Uploads specified image files or images from the clipboard.

option for upload: -o, --output <dir>
    Specifies the output directory for uploaded image URLs.

option for upload: -b, --baseDir <dir>
    Sets the base directory for relative paths in uploaded URLs.

option for upload: -d, --dir <dir>
    Uploads images into a specific directory on the host.

option for upload: --clip
    Uploads the current image content from the clipboard.

command: install <plugin>
    Installs a PicGo plugin from npm.

command: uninstall <plugin>
    Uninstalls a previously installed PicGo plugin.

command: use <plugin/uploader/transformer>
    Switches to use a specific plugin, uploader, or transformer.

command: set <config-key>
    Configures settings for PicGo or a specific uploader.

command: init
    Initializes the PicGo configuration file.

command: config
    Shows the path to the PicGo configuration file.

command: plugin list
    Lists all currently installed PicGo plugins.

command: update
    Updates the PicGo CLI itself to the latest version.

command: help [<command>]
    Displays help information for the main command or a specific subcommand.

command: version
    Displays the current version of PicGo CLI.

Global Option: --config <path>
    Specifies an alternative path to the PicGo configuration file.

Global Option: --help
    Displays help information for the invoked command.

Global Option: --version
    Displays the version of PicGo CLI.

DESCRIPTION

The picgo command-line tool provides a powerful and flexible way to automate image uploading to a multitude of cloud storage services and image hosting platforms. Originally known for its desktop GUI application, picgo-cli extends its functionality to the terminal, allowing users to integrate image uploads into scripts, build processes, and other automated workflows. It supports a wide array of popular services including GitHub, Imgur, Amazon S3, Alibaba Cloud OSS, Tencent Cloud COS, and many more, often via a rich plugin ecosystem. Users can easily configure different uploaders, manage clipboard uploads, and specify output formats, making it an invaluable tool for bloggers, developers, and anyone needing to quickly host images from the command line without manual intervention.

CAVEATS

PicGo CLI requires Node.js and npm to be installed on the system. Its functionality heavily relies on a correctly configured ~/.picgo/config.json file, which can sometimes be intricate, especially when dealing with various third-party image hosting services that require API keys or complex authentication. While powerful, its setup might present a learning curve for new users unfamiliar with Node.js environments or API configurations.

CONFIGURATION FILE

PicGo stores its configuration, including uploader settings and plugin configurations, in a JSON file typically located at ~/.picgo/config.json (on Linux and macOS). This file is crucial for defining how images are uploaded and where they are hosted.

PLUGIN ECOSYSTEM

A significant strength of PicGo is its robust plugin system. Users can install third-party plugins to add support for new image hosts, implement custom processing steps (e.g., compression, watermarking), or integrate with other tools. Plugins are managed via npm and can greatly extend the CLI's capabilities.

HISTORY

PicGo originated as a popular desktop application for macOS and Windows, designed to simplify the process of uploading images and obtaining their URLs. The command-line interface, picgo-cli, was introduced later to cater to developers and users who needed to integrate image uploading capabilities into automated scripts, CI/CD pipelines, or other non-GUI workflows. This evolution transformed PicGo from a pure desktop utility into a versatile tool available across different environments, leveraging Node.js for its cross-platform compatibility and extensive plugin system.

SEE ALSO

curl(1), wget(1), scp(1)

Copied to clipboard