Skip to main content
GitHub license GitHub tag Codacy Badge

PBinCLI

PBinCLI is a command line client for PrivateBin written in Python 3.

Installation

Installing globally using pip3:

pip3 install pbincli

Installing with virtualenv:

python3 -m virtualenv --python=python3 venv
. venv/bin/activate
pip install pbincli

Note: if you used virtualenv installation method, don’t forget to activate your virtual environment before running the tool: call . /path/to/venv/bin/activate in terminal

Configuration

By default PBinCLI is configured to use https://paste.i2pd.xyz/ for sending and receiving pastes. No proxy is used by default.

You can always create a config file to use different settings.

Configuration file is expected to be found in ~/.config/pbincli/pbincli.conf, %APPDATA%/pbincli/pbincli.conf (Windows) and ~/Library/Application Support/pbincli/pbincli.conf (MacOS)

Example of config file content

server=https://paste.i2pd.xyz/
proxy=http://127.0.0.1:3128

List of OPTIONS available

Option

Default

Possible value

server

https://paste.i2pd.xyz/

Domain ending with slash

random_server

None

Domains separated with comma, selected randomly

mirrors

None

Domains separated with comma, like http://privatebin.ygg/,http://privatebin.i2p/

proxy

None

Proxy address starting with scheme http:// or socks5://

expire

1day

5min / 10min / 1hour / 1day / 1week / 1month / 1year / never

burn

False

True / False

discus

False

True / False

format

plaintext

plaintext / syntaxhighlighting / markdown

short

False

True / False

short_api

None

tinyurl, clckru, isgd, vgd, cuttly, yourls, custom

short_url

None

Domain name of shortener service for yourls, or URL (with required parameters) for custom

short_user

None

Used only in yourls

short_pass

None

Used only in yourls

short_token

None

Used only in yourls

output

None

Path to the directory where the received data will be saved

no_check_certificate

False

True / False

no_insecure_warning

False

True / False

compression

zlib

zlib / none

auth

None

basic, custom

auth_user

None

Basic authorization username

auth_pass

None

Basic authorization password

auth_custom

None

Custom authorization headers in JSON format, like {'Authorization': 'Bearer token'}

json

False

Print sending result in JSON format

Usage

PBinCLI tool is started with pbincli command. Detailed help on command usage is provided with -h option:

pbincli {send|get|delete} -h

Sending

  • Sending text:

    pbincli send -t "Hello! This is a test paste!"
  • Using stdin input to read text into a paste:

    pbincli send - <<EOF
    Hello! This is a test paste!
    EOF
  • Sending a file with text attached into a paste:

    pbincli send -f info.pdf -t "I'm sending my document."
  • Sending a file only with no text attached:

    pbincli send -q -f info.pdf

Other options

It is also possible to set-up paste parameters such as “burn after reading”, expiritaion time, formatting, enabling discussions and changing compression algorithm. Please refer to pbincli send -h output for more information.

Receiving

To retrieve a paste from a server, you need to use get command with the paste info.

Paste info must be formated as pasteID#Passphrase or just use full URL to a paste. Example:

pbincli get "xxx#yyy"                        ### receive paste xxx from https://paste.i2pd.xyz/ by default
pbincli get "https://example.com/?xxx#yyy"   ### receive paste xxx from https://example.com/

Deletion

To delete a paste from a server, use delete command with paste info:

pbincli delete "pasteid=xxx&deletetoken=yyy"                        ### delete paste xxx from https://paste.i2pd.xyz/ by default
pbincli delete "https://example.com/?pasteid=xxx&deletetoken=yyy"   ### delete paste xxx from https://example.com/

If you need to delete a paste on different server than the configured one, use -s option together with the instance URL.

Additional examples

Here you can find additional examples.

Usage with I2P enabled services

Change settings to set server to http://privatebin.i2p/ and proxy to http://127.0.0.1:4444. Configuration file for this example is:

server=http://privatebin.i2p/
proxy=http://127.0.0.1:4444

Using aliases

Example of alias to send a paste from stdin direclty to I2P service:

alias pastei2p="echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -"

Call it by running pastei2p in terminal.

License

This project is licensed under the MIT license, which can be found in the file LICENSE in the root of the project source code.

Metadata

Release files for PBinCLI 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PBinCLI 0.3.7
File Size Uploaded
pbincli-0.3.7.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PBinCLI 0.3.7
File Interpreter ABI Platform
pbincli-0.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 33.8 kB

Release files / pbincli-0.3.7.tar.gz

Download URL pbincli-0.3.7.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fc9b5bfd52a148fbbe381521cf4e7154fee9cfa39f02dd6c8626033ea14cae87
BLAKE2b-256 checksum
How to use checksums
c620ba2c0ed9902e54acf04c8b827fbb508d8beaf7eeb23e67009c5cb9beb3d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / pbincli-0.3.7-py3-none-any.whl

Download URL pbincli-0.3.7-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dff9e97c54bea72dae293ba61397ec804cb7cec595101a1d5170713ed141abc0
BLAKE2b-256 checksum
How to use checksums
4840f315cd3a2f302cb89a01686ef3629deb03d0082370f950e36265ddde345f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

3 release files

0.2.1

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page