This provides a command line interface to the Shareit service. Shareit is a link shortner, file uploader and pastebin.
-
Download the executable (or click here):
wget https://github.com/pls-shareit/cli/releases/latest/download/shareit-linux -qO shareit
-
Make the file executable:
chmod +x shareit
-
Add the executable to your PATH, for example:
sudo mv shareit /usr/bin
-
Download the executable (or click here):
wget https://github.com/pls-shareit/cli/releases/latest/download/shareit-macos -qO shareit
-
Make the file executable:
chmod +x shareit
-
Add the executable to your PATH, for example:
sudo mv shareit /usr/bin
-
Download the executable with Power shell (or click here):
iwr -outf clique-collector.exe https://github.com/pls-shareit/cli/releases/latest/download/shareit.exe
-
Add the executable to your PATH, for example:
Move-Item -Path .\shareit.exe -Destination C:\Windows\system32
-
You may need to restart your shell or computer.
If you don't want to use a pre-compiled executable, you can compile one using Rust:
- Install Rust.
- Run
cargo install --git https://github.com/pls-shareit/cli
in the same directory as this README. - The binary should have been automatically added to your PATH as
shareit
.
First, you should configure the tool with the URL of the Shareit server you'll
be using. For example, to use https://share.example.com
, run:
shareit --config base_url https://share.example.com
If the instance is password protected, you can configure your password like so:
shareit --config password super-secret-password
Complete documentation on command behavior and every option is available by
running shareit --help
. You can get abbreviated help by running shareit -h
.
Here are some examples:
-
shareit --file ./image.png --name cool-img
Uploads the file
./image.png
with the namecool-img
and maximum expiry. Will output the URL to the file if successful. -
shareit --link https://example.com --to-clipboard
Create a shortlink with a random name to the URL
https://example.com
, with maximum expiry. Copies the shortened URL to your clipboard if successful. -
shareit --paste --from-clipboard --syntax python --expire-after 1day
Uploads the contents of your clipboard as a paste with a random name and python syntax highlighting. Sets the paste to expire after one day. Will output the URL to the paste if successful.
Use shareit --help
for more information on the above options, shorter
aliases for them, and other options.
Currently, the CLI does not support deleting, updating or fetching information on shares - only creating them.