PBinCLI is command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written on Python 3.
PBinCLI is a command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written in Python 3.
# Installing
# Installation
Installation inside `virtualenv`:
Installing globally using pip3:
```bash
```bash
python3 -m virtualenv --python=python3 venv
pip3 install pbincli
. venv/bin/activate
pip install pbincli
```
```
Installation to system with pip3:
Installing with `virtualenv`:
```bash
```bash
pip3 install pbincli
python3 -m virtualenv --python=python3 venv
. venv/bin/activate
pip install pbincli
```
```
*Note*: if you used installation with `virtualenv`, don't forget to activate it before usage: call `. /path/to/venv/bin/activate` in terminal
*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
# Configuration
By default pbincli configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy used by default.
By default PBinCLI is configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy is used by default.
You can create config file to use different settings.
You can always create a config file to use different settings.
Configuration file is searched in `~/.config/pbincli/pbincli.conf`, `%APPDATA%/pbincli/pbincli.conf` (Windows) and `~/Library/Application Support/pbincli/pbincli.conf` (MacOS)
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)
Tool available by command `pbincli`, help for every command can be called with `-h` option:
PBinCLI tool is started with `pbincli` command. Detailed help on command usage is provided with `-h` option:
```bash
```bash
pbincli {send|get|delete} -h
pbincli {send|get|delete} -h
```
```
@ -69,35 +69,35 @@ pbincli {send|get|delete} -h
* Sending text:
* Sending text:
```bash
```bash
pbincli send -t "Hello! This is test paste!"
pbincli send -t "Hello! This is a test paste!"
```
```
* Use stdin input to read text for paste:
* Using stdin input to read text into a paste:
```bash
```bash
pbincli send - <<EOF
pbincli send - <<EOF
Hello! This is test paste!
Hello! This is a test paste!
EOF
EOF
```
```
* Sending file with text in paste:
* Sending a file with text attached into a paste:
```bash
```bash
pbincli send -f info.pdf -t "I'm sending my document."
pbincli send -f info.pdf -t "I'm sending my document."
```
```
* Sending only file without any text:
* Sending a file only with no text attached:
```bash
```bash
pbincli send -q -f info.pdf
pbincli send -q -f info.pdf
```
```
### Other options
### Other options
It is possible to set-up paste parameters such as burning after reading, expiritaion time, formatting, enabling discussions, and changing compression algorithm. Please refer to `pbincli send -h` output for more information.
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
## Receiving
To retrieve paste from server, use `get` command with paste info.
To retrieve a paste from a server, you need to use `get` command with the paste info.
It must be formated like `pasteID#Passphrase` or use full URL to paste. Example:
Paste info must be formated as `pasteID#Passphrase` or just use full URL to a paste. Example:
```bash
```bash
pbincli get xxx#yyy ### receive paste xxx from https://paste.i2pd.xyz/ by default
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/
pbincli get https://example.com/?xxx#yyy ### receive paste xxx from https://example.com/
@ -105,28 +105,28 @@ pbincli get https://example.com/?xxx#yyy ### receive paste xxx from https://ex
## Deletion
## Deletion
To delete paste from server, use `delete` command with required `-p` and `-t` options:
To delete a paste from a server, use `delete` command with required `-p` and `-t` options:
```bash
```bash
pbincli delete -p xxx -t deletetoken
pbincli delete -p xxx -t deletetoken
```
```
If you need to delete paste on different server that configured, use `-s` option with instance URL.
If you need to delete a paste on different server than the configured one, use `-s` option together with the instance URL.
# Additional examples
# Additional examples
Here you can find additional examples.
Here you can find additional examples.
## Usage with service available inside I2P
## Usage with I2P enabled services
Change settings to use server `http://privatebin.i2p/` and proxy `http://127.0.0.1:4444`. Here's example for configuration file:
Change settings to set server to`http://privatebin.i2p/` and proxy to `http://127.0.0.1:4444`. Configuration file for this example is:
```ini
```ini
server=http://privatebin.i2p/
server=http://privatebin.i2p/
proxy=http://127.0.0.1:4444
proxy=http://127.0.0.1:4444
```
```
## Using tool with aliases
## Using aliases
Example of alias to send paste from `stdin` direclty to I2P service:
Example of alias to send a paste from `stdin` direclty to I2P service:
```bash
```bash
alias pastei2p="echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -"
alias pastei2p="echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -"
PBinCLI is command line client for `PrivateBin <https://github.com/PrivateBin/PrivateBin/>`_ written on Python 3.
PBinCLI is a command line client for `PrivateBin <https://github.com/PrivateBin/PrivateBin/>`_ written in Python 3.
Installing
Installation
==========
============
Installation inside ``virtualenv``\ :
Installing globally using pip3:
..code-block:: bash
..code-block:: bash
python3 -m virtualenv --python=python3 venv
pip3 install pbincli
. venv/bin/activate
pip install pbincli
Installation to system with pip3:
Installing with ``virtualenv``\ :
..code-block:: bash
..code-block:: bash
pip3 install pbincli
python3 -m virtualenv --python=python3 venv
. venv/bin/activate
pip install pbincli
*Note*\ : if you used installation with ``virtualenv``\ , don't forget to activate it before usage: call ``. /path/to/venv/bin/activate`` in terminal
*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
Configuration
=============
=============
By default pbincli configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy used by default.
By default PBinCLI is configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy is used by default.
You can create config file to use different settings.
You can always create a config file to use different settings.
Configuration file is searched in ``~/.config/pbincli/pbincli.conf``\ , ``%APPDATA%/pbincli/pbincli.conf`` (Windows) and ``~/Library/Application Support/pbincli/pbincli.conf`` (MacOS)
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 contents
Example of config file content
----------------
------------------------------
..code-block:: ini
..code-block:: ini
server=https://paste.i2pd.xyz/
server=https://paste.i2pd.xyz/
proxy=http://127.0.0.1:3128
proxy=http://127.0.0.1:3128
All possible options for configuration file
List of OPTIONS available
-------------------------------------------
-------------------------
..list-table::
..list-table::
:header-rows:1
:header-rows:1
@ -118,7 +118,7 @@ All possible options for configuration file
Usage
Usage
=====
=====
Tool available by command ``pbincli``\ , help for every command can be called with ``-h`` option:
PBinCLI tool is started with ``pbincli`` command. Detailed help on command usage is provided with ``-h`` option:
..code-block:: bash
..code-block:: bash
@ -133,26 +133,26 @@ Sending
..code-block:: bash
..code-block:: bash
pbincli send -t "Hello! This is test paste!"
pbincli send -t "Hello! This is a test paste!"
*
*
Use stdin input to read text for paste:
Using stdin input to read text into a paste:
..code-block:: bash
..code-block:: bash
pbincli send - <<EOF
pbincli send - <<EOF
Hello! This is test paste!
Hello! This is a test paste!
EOF
EOF
*
*
Sending file with text in paste:
Sending a file with text attached into a paste:
..code-block:: bash
..code-block:: bash
pbincli send -f info.pdf -t "I'm sending my document."
pbincli send -f info.pdf -t "I'm sending my document."
*
*
Sending only file without any text:
Sending a file only with no text attached:
..code-block:: bash
..code-block:: bash
@ -161,14 +161,14 @@ Sending
Other options
Other options
^^^^^^^^^^^^^
^^^^^^^^^^^^^
It is possible to set-up paste parameters such as burning after reading, expiritaion time, formatting, enabling discussions, and changing compression algorithm. Please refer to ``pbincli send -h`` output for more information.
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
Receiving
---------
---------
To retrieve paste from server, use ``get`` command with paste info.
To retrieve a paste from a server, you need to use ``get`` command with the paste info.
It must be formated like``pasteID#Passphrase`` or use full URL to paste. Example:
Paste info must be formated as``pasteID#Passphrase`` or just use full URL to a paste. Example:
..code-block:: bash
..code-block:: bash
@ -178,33 +178,33 @@ It must be formated like ``pasteID#Passphrase`` or use full URL to paste. Exampl
Deletion
Deletion
--------
--------
To delete paste from server, use ``delete`` command with required ``-p`` and ``-t`` options:
To delete a paste from a server, use ``delete`` command with required ``-p`` and ``-t`` options:
..code-block:: bash
..code-block:: bash
pbincli delete -p xxx -t deletetoken
pbincli delete -p xxx -t deletetoken
If you need to delete paste on different server that configured, use ``-s`` option with instance URL.
If you need to delete a paste on different server than the configured one, use ``-s`` option together with the instance URL.
Additional examples
Additional examples
===================
===================
Here you can find additional examples.
Here you can find additional examples.
Usage with service available inside I2P
Usage with I2P enabled services
---------------------------------------
-------------------------------
Change settings to use server ``http://privatebin.i2p/`` and proxy ``http://127.0.0.1:4444``. Here's example for configuration file:
Change settings to set server to``http://privatebin.i2p/`` and proxy to ``http://127.0.0.1:4444``. Configuration file for this example is:
..code-block:: ini
..code-block:: ini
server=http://privatebin.i2p/
server=http://privatebin.i2p/
proxy=http://127.0.0.1:4444
proxy=http://127.0.0.1:4444
Using tool with aliases
Using aliases
-----------------------
-------------
Example of alias to send paste from ``stdin`` direclty to I2P service:
Example of alias to send a paste from ``stdin`` direclty to I2P service: