Skip to content

Get Started

ShareX CLI

PyPI Version TOML Python Version PyPI Downloads Pepy Total Downloads Codecov GitHub Last Commit GitHub Issues GitHub Discussions GitHub Forks GitHub Repo Stars GitHub Org Stars Discord Ko-fi

Command Line Interface to Upload Files to a ShareX Server using a ShareX Custom Uploader .sxcu configuration file.

Upload any file, multiple files, directories, use globs, create archives and much more...

pip install sharex-cli
uv tool install sharex-cli

See the Quick Start section to get started...

There are detailed Install, Configure and Upload guides available.

If you run into any issues or have any questions, support is available.

Features
Quick Start
Support

Features

  • Use a ShareX Custom Uploader *.sxcu config.
  • Upload a file or multiple files.
  • Specify a custom file name.
  • Upload files in a directory with optional glob.
  • Upload a directory as an archive.
  • Automatically open the URL in browser.
  • Automatically copy the URL to the clipboard.
  • Display confirmation before uploading multiple files.
  • Override all options with flags or env vars.

Quick Start

First, install from PyPI or GitHub .

pip install sharex-cli
uv tool install sharex-cli

See the Install guide for more options.

Next, download your server's ShareX Custom Uploader *.sxcu configuration.

Using the --config option you can enter a file path or open a text editor.

sharex --config

See the Configure guide for more details.

Finally, upload a file, multiple files, or a directory.

sharex screenshot.jpg

See the Upload guide for more examples.

View Uploading Guide

 

Additionally, you can import the module into your Python project.

from pathlib import Path
from sharex import api

config = api.get_config(Path("path/to/config.file"))  # (1)!
with open("filename", "rb") as f:
    url = api.upload_file(config, "filename", f)
print(f"{url=}")
  1. ShareX Custom Uploader Config JSON.

View the Module Documentation for more details.

Server Support

Supports the following ShareX Custom Uploader *.sxcu configurations.

Response Type Support:

  • json

Upload Type Support:

  • MultipartFormData

Partial Configuration Example.

{
  "URL": "{json:files[0].url}", // (1)!
  "Body": "MultipartFormData" // (2)!
}
  1. Should include json: in the URL.
  2. Should be MultipartFormData.

Server Support Request

If your server is not supported, please submit Server Support feature request.

 

Features Issues Discussions Discord

Question

If you need help getting started or run into any issues, support is available!