diff --git a/README.md b/README.md index 18ce572..a4b7e26 100644 --- a/README.md +++ b/README.md @@ -8,66 +8,138 @@ PBinCLI PBinCLI is command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written on Python 3. Installing ------ +===== + +Installation inside `virtualenv`: ```bash -virtualenv --python=python3 venv +python3 -m virtualenv --python=python3 venv . venv/bin/activate pip install pbincli ``` -Usage ------ +Installation to system with pip3: +```bash +pip3 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* + +Configuration +===== + By default pbincli configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy used by default. -You can create config file with variables `server` and `proxy` in `~/.config/pbincli/pbincli.conf` to use different settings. +You can create config file to use different settings. -Example contents: +Configuration file is searched in `~/.config/pbincli/pbincli.conf`, `%APPDATA%/pbincli/pbincli.conf` (Windows) and `~/Library/Application Support/pbincli/pbincli.conf` (MacOS) + +Example contents +----- ```ini server=https://paste.i2pd.xyz/ proxy=http://127.0.0.1:3128 ``` -Run inside `venv` command: +All possible options for configuration file +----- + +| 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://` | +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 sortener 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 | + +Usage +===== +Tool available by command `pbincli`, help for every command can be called with `-h` option: ```bash -pbincli send --text "Hello!" +pbincli {send|get|delete} -h ``` -Or use stdin input to read text for paste: +Sending +----- +* Sending text: +```bash +pbincli send -t "Hello! This is test paste!" +``` + +* Use stdin input to read text for paste: ```bash pbincli send - <`_ written on Python 3. - -Installing ----------- - -.. code-block:: bash - - virtualenv --python=python3 venv - . venv/bin/activate - pip install pbincli - -Usage ------ - -By default pbincli configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy used by default. - -You can create config file with variables ``server`` and ``proxy`` in ``~/.config/pbincli/pbincli.conf`` to use different settings. - -Example contents: - -.. code-block:: ini - - server=https://paste.i2pd.xyz/ - proxy=http://127.0.0.1:3128 - -Run inside ``venv`` command: - -.. code-block:: bash - - pbincli send --text "Hello!" - -Or use stdin input to read text for paste: - -.. code-block:: bash - - pbincli send - <`_ in the root of the project source code. + + +.. 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 command line client for `PrivateBin `_ written on Python 3. + +Installing +========== + +Installation inside ``virtualenv``\ : + +.. code-block:: bash + + python3 -m virtualenv --python=python3 venv + . venv/bin/activate + pip install pbincli + +Installation to system with pip3: + +.. code-block:: bash + + pip3 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* + +Configuration +============= + +By default pbincli configured to use ``https://paste.i2pd.xyz/`` for sending and receiving pastes. No proxy used by default. + +You can create 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) + +Example contents +---------------- + +.. code-block:: ini + + server=https://paste.i2pd.xyz/ + proxy=http://127.0.0.1:3128 + +All possible options for configuration file +------------------------------------------- + +.. 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://`` | +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 sortener 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 | + +Usage +===== + +Tool available by command ``pbincli``\ , help for every command can be called with ``-h`` option: + +.. code-block:: bash + + pbincli {send|get|delete} -h + +Sending +------- + + +* + Sending text: + + .. code-block:: bash + + pbincli send -t "Hello! This is test paste!" + +* + Use stdin input to read text for paste: + + .. code-block:: bash + + pbincli send - <`_ in the root of the project source code. diff --git a/pbincli/cli.py b/pbincli/cli.py index 65fe9ef..0c9d7e8 100755 --- a/pbincli/cli.py +++ b/pbincli/cli.py @@ -107,6 +107,7 @@ def main(): 'server': 'https://paste.i2pd.xyz/', 'mirrors': None, # real example for paste.i2pd.xyz: 'http://privatebin.ygg/,http://privatebin.i2p/' 'proxy': None, + 'short': False, 'short_api': None, 'short_url': None, 'short_user': None,