.. image:: https://img.shields.io/github/license/r4sas/PBinCLI.svg
:target: https://github.com/r4sas/PBinCLI/blob/master/LICENSE
:alt: GitHub license
.. image:: https://img.shields.io/github/tag/r4sas/PBinCLI.svg
:target: https://github.com/r4sas/PBinCLI/tags/
:alt: GitHub tag
.. image:: https://app.codacy.com/project/badge/Grade/4f24f43356a84621bbd9078c4b3f1b70
:target: https://www.codacy.com/gh/r4sas/PBinCLI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=r4sas/PBinCLI&utm_campaign=Badge_Grade
:alt: Codacy Badge
PBinCLI
=======
PBinCLI is a command line client for `PrivateBin <https://github.com/PrivateBin/PrivateBin/>`_ written in Python 3.
Installation
============
Installing globally using pip3:
.. code-block:: bash
pip3 install pbincli
Installing with ``virtualenv``\ :
.. code-block:: bash
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
------------------------------
.. code-block:: ini
server=https://paste.i2pd.xyz/
proxy=http://127.0.0.1:3128
List of OPTIONS available
-------------------------
.. list-table::
:header-rows: 1
* - Option
- Default
- Possible value
* - server
- https://paste.i2pd.xyz/
- Domain ending with slash
* - 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``
* - no_check_certificate
- False
- True / False
* - no_insecure_warning
- False
- True / False
* - compression
- zlib
- zlib / none
Usage
=====
PBinCLI tool is started with ``pbincli`` command. Detailed help on command usage is provided with ``-h`` option:
.. code-block:: bash
pbincli {send|get|delete} -h
Sending
-------
*
Sending text:
.. code-block:: bash
pbincli send -t "Hello! This is a test paste!"
*
Using stdin input to read text into a paste:
.. code-block:: bash
pbincli send - <<EOF
Hello! This is a test paste!
EOF
*
Sending a file with text attached into a paste:
.. code-block:: bash
pbincli send -f info.pdf -t "I'm sending my document."
*
Sending a file only with no text attached:
.. code-block:: bash
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:
.. code-block:: bash
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:
.. code-block:: bash
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:
.. code-block:: ini
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:
.. code-block:: bash
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 <https://github.com/r4sas/PBinCLI/blob/master/LICENSE>`_ in the root of the project source code.
Raw data
{
"_id": null,
"home_page": "https://github.com/r4sas/PBinCLI/",
"name": "PBinCLI",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "",
"keywords": "privatebin cryptography security",
"author": "R4SAS",
"author_email": "r4sas@i2pmail.org",
"download_url": "https://files.pythonhosted.org/packages/cc/5a/792e2213ae84b761dabff40c79eaa11ebbb20147ab6396036170ed450b5a/PBinCLI-0.3.4.tar.gz",
"platform": null,
"description": "\r\n\r\n.. image:: https://img.shields.io/github/license/r4sas/PBinCLI.svg\r\n :target: https://github.com/r4sas/PBinCLI/blob/master/LICENSE\r\n :alt: GitHub license\r\n\r\n\r\n.. image:: https://img.shields.io/github/tag/r4sas/PBinCLI.svg\r\n :target: https://github.com/r4sas/PBinCLI/tags/\r\n :alt: GitHub tag\r\n\r\n\r\n.. image:: https://app.codacy.com/project/badge/Grade/4f24f43356a84621bbd9078c4b3f1b70\r\n :target: https://www.codacy.com/gh/r4sas/PBinCLI/dashboard?utm_source=github.com&utm_medium=referral&utm_content=r4sas/PBinCLI&utm_campaign=Badge_Grade\r\n :alt: Codacy Badge\r\n\r\n\r\nPBinCLI\r\n=======\r\n\r\nPBinCLI is a command line client for `PrivateBin <https://github.com/PrivateBin/PrivateBin/>`_ written in Python 3.\r\n\r\nInstallation\r\n============\r\n\r\nInstalling globally using pip3:\r\n\r\n.. code-block:: bash\r\n\r\n pip3 install pbincli\r\n\r\nInstalling with ``virtualenv``\\ :\r\n\r\n.. code-block:: bash\r\n\r\n python3 -m virtualenv --python=python3 venv\r\n . venv/bin/activate\r\n pip install pbincli\r\n\r\n*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\r\n\r\nConfiguration\r\n=============\r\n\r\nBy default PBinCLI is configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy is used by default.\r\n\r\nYou can always create a config file to use different settings.\r\n\r\nConfiguration file is expected to be found in ``~/.config/pbincli/pbincli.conf``\\ , ``%APPDATA%/pbincli/pbincli.conf`` (Windows) and ``~/Library/Application Support/pbincli/pbincli.conf`` (MacOS)\r\n\r\nExample of config file content\r\n------------------------------\r\n\r\n.. code-block:: ini\r\n\r\n server=https://paste.i2pd.xyz/\r\n proxy=http://127.0.0.1:3128\r\n\r\nList of OPTIONS available\r\n-------------------------\r\n\r\n.. list-table::\r\n :header-rows: 1\r\n\r\n * - Option\r\n - Default\r\n - Possible value\r\n * - server\r\n - https://paste.i2pd.xyz/\r\n - Domain ending with slash\r\n * - mirrors\r\n - None\r\n - Domains separated with comma, like ``http://privatebin.ygg/,http://privatebin.i2p/``\r\n * - proxy\r\n - None\r\n - Proxy address starting with scheme ``http://`` or ``socks5://``\r\n * - expire\r\n - 1day\r\n - 5min / 10min / 1hour / 1day / 1week / 1month / 1year / never\r\n * - burn\r\n - False\r\n - True / False\r\n * - discus\r\n - False\r\n - True / False\r\n * - format\r\n - plaintext\r\n - plaintext / syntaxhighlighting / markdown\r\n * - short\r\n - False\r\n - True / False\r\n * - short_api\r\n - None\r\n - ``tinyurl``\\ , ``clckru``\\ , ``isgd``\\ , ``vgd``\\ , ``cuttly``\\ , ``yourls``\\ , ``custom``\r\n * - short_url\r\n - None\r\n - Domain name of shortener service for ``yourls``\\ , or URL (with required parameters) for ``custom``\r\n * - short_user\r\n - None\r\n - Used only in ``yourls``\r\n * - short_pass\r\n - None\r\n - Used only in ``yourls``\r\n * - short_token\r\n - None\r\n - Used only in ``yourls``\r\n * - no_check_certificate\r\n - False\r\n - True / False\r\n * - no_insecure_warning\r\n - False\r\n - True / False\r\n * - compression\r\n - zlib\r\n - zlib / none\r\n\r\n\r\nUsage\r\n=====\r\n\r\nPBinCLI tool is started with ``pbincli`` command. Detailed help on command usage is provided with ``-h`` option:\r\n\r\n.. code-block:: bash\r\n\r\n pbincli {send|get|delete} -h\r\n\r\nSending\r\n-------\r\n\r\n\r\n* \r\n Sending text:\r\n\r\n .. code-block:: bash\r\n\r\n pbincli send -t \"Hello! This is a test paste!\"\r\n\r\n* \r\n Using stdin input to read text into a paste:\r\n\r\n .. code-block:: bash\r\n\r\n pbincli send - <<EOF\r\n Hello! This is a test paste!\r\n EOF\r\n\r\n* \r\n Sending a file with text attached into a paste:\r\n\r\n .. code-block:: bash\r\n\r\n pbincli send -f info.pdf -t \"I'm sending my document.\"\r\n\r\n* \r\n Sending a file only with no text attached:\r\n\r\n .. code-block:: bash\r\n\r\n pbincli send -q -f info.pdf\r\n\r\nOther options\r\n^^^^^^^^^^^^^\r\n\r\nIt 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.\r\n\r\nReceiving\r\n---------\r\n\r\nTo retrieve a paste from a server, you need to use ``get`` command with the paste info.\r\n\r\nPaste info must be formated as ``pasteID#Passphrase`` or just use full URL to a paste. Example:\r\n\r\n.. code-block:: bash\r\n\r\n pbincli get \"xxx#yyy\" ### receive paste xxx from https://paste.i2pd.xyz/ by default\r\n pbincli get \"https://example.com/?xxx#yyy\" ### receive paste xxx from https://example.com/\r\n\r\nDeletion\r\n--------\r\n\r\nTo delete a paste from a server, use ``delete`` command with paste info:\r\n\r\n.. code-block:: bash\r\n\r\n pbincli delete \"pasteid=xxx&deletetoken=yyy\" ### delete paste xxx from https://paste.i2pd.xyz/ by default\r\n pbincli delete \"https://example.com/?pasteid=xxx&deletetoken=yyy\" ### delete paste xxx from https://example.com/\r\n\r\nIf you need to delete a paste on different server than the configured one, use ``-s`` option together with the instance URL.\r\n\r\nAdditional examples\r\n===================\r\n\r\nHere you can find additional examples.\r\n\r\nUsage with I2P enabled services\r\n-------------------------------\r\n\r\nChange settings to set server to ``http://privatebin.i2p/`` and proxy to ``http://127.0.0.1:4444``. Configuration file for this example is:\r\n\r\n.. code-block:: ini\r\n\r\n server=http://privatebin.i2p/\r\n proxy=http://127.0.0.1:4444\r\n\r\nUsing aliases\r\n-------------\r\n\r\nExample of alias to send a paste from ``stdin`` direclty to I2P service:\r\n\r\n.. code-block:: bash\r\n\r\n alias pastei2p=\"echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -\"\r\n\r\nCall it by running ``pastei2p`` in terminal.\r\n\r\nLicense\r\n=======\r\n\r\nThis project is licensed under the MIT license, which can be found in the file `LICENSE <https://github.com/r4sas/PBinCLI/blob/master/LICENSE>`_ in the root of the project source code.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "PrivateBin client for command line",
"version": "0.3.4",
"split_keywords": [
"privatebin",
"cryptography",
"security"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "d71e19f596669e10a5b51a0d9cdbece3",
"sha256": "d5f9f05b64bf32537f24fc7d195925e12d2249bb0afff9900115cd5807abc490"
},
"downloads": -1,
"filename": "PBinCLI-0.3.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d71e19f596669e10a5b51a0d9cdbece3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 15825,
"upload_time": "2022-12-11T18:19:56",
"upload_time_iso_8601": "2022-12-11T18:19:56.336696Z",
"url": "https://files.pythonhosted.org/packages/7b/53/f77709691dc21d80f77ce4825542c44b27bcd984761629018fce8ae8c46c/PBinCLI-0.3.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "6b7c3a5f0f61bcf4edeea8e839586b0b",
"sha256": "78f066a4f8ea6e3739beb13b8d94712f3fd289933e213ccafbd48023f4b05128"
},
"downloads": -1,
"filename": "PBinCLI-0.3.4.tar.gz",
"has_sig": false,
"md5_digest": "6b7c3a5f0f61bcf4edeea8e839586b0b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 14458,
"upload_time": "2022-12-11T18:19:59",
"upload_time_iso_8601": "2022-12-11T18:19:59.204104Z",
"url": "https://files.pythonhosted.org/packages/cc/5a/792e2213ae84b761dabff40c79eaa11ebbb20147ab6396036170ed450b5a/PBinCLI-0.3.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-11 18:19:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "r4sas",
"github_project": "PBinCLI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pycryptodome",
"specs": []
},
{
"name": "sjcl",
"specs": []
},
{
"name": "base58",
"specs": []
},
{
"name": "requests",
"specs": []
}
],
"lcname": "pbincli"
}