Skip to content

Commit 0e61d05

Browse files
committed
update documentation (closes #25, #26, #31)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
1 parent 05c1938 commit 0e61d05

File tree

3 files changed

+275
-112
lines changed

3 files changed

+275
-112
lines changed

README.md

Lines changed: 93 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,138 @@ PBinCLI
88
PBinCLI is command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written on Python 3.
99

1010
Installing
11-
-----
11+
=====
12+
13+
Installation inside `virtualenv`:
1214
```bash
13-
virtualenv --python=python3 venv
15+
python3 -m virtualenv --python=python3 venv
1416
. venv/bin/activate
1517
pip install pbincli
1618
```
1719

18-
Usage
19-
-----
20+
Installation to system with pip3:
21+
```bash
22+
pip3 install pbincli
23+
```
24+
25+
*Note: if you used installation with `virtualenv`, don't forget to activate it before usage: call `. /path/to/venv/bin/activate` in terminal*
26+
27+
Configuration
28+
=====
29+
2030
By default pbincli configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy used by default.
2131

22-
You can create config file with variables `server` and `proxy` in `~/.config/pbincli/pbincli.conf` to use different settings.
32+
You can create config file to use different settings.
2333

24-
Example contents:
34+
Configuration file is searched in `~/.config/pbincli/pbincli.conf`, `%APPDATA%/pbincli/pbincli.conf` (Windows) and `~/Library/Application Support/pbincli/pbincli.conf` (MacOS)
35+
36+
Example contents
37+
-----
2538

2639
```ini
2740
server=https://paste.i2pd.xyz/
2841
proxy=http://127.0.0.1:3128
2942
```
3043

31-
Run inside `venv` command:
44+
All possible options for configuration file
45+
-----
46+
47+
| Option | Default | Possible value |
48+
|--------|---------|---------|
49+
server | https://paste.i2pd.xyz/ | Domain ending with slash |
50+
mirrors | None | Domains separated with comma, like `http://privatebin.ygg/,http://privatebin.i2p/` |
51+
proxy | None | Proxy address starting with scheme `http://` or `socks5://` |
52+
short | False | True / False |
53+
short_api | None | `tinyurl`, `clckru`, `isgd`, `vgd`, `cuttly`, `yourls`, `custom` |
54+
short_url | None | Domain name of shortener service for `yourls`, or sortener URL (with required parameters) for `custom` |
55+
short_user | None | Used only in `yourls` |
56+
short_pass | None | Used only in `yourls` |
57+
short_token | None | Used only in `yourls` |
58+
no_check_certificate | False | True / False |
59+
no_insecure_warning | False | True / False |
60+
61+
Usage
62+
=====
3263

64+
Tool available by command `pbincli`, help for every command can be called with `-h` option:
3365
```bash
34-
pbincli send --text "Hello!"
66+
pbincli {send|get|delete} -h
3567
```
3668

37-
Or use stdin input to read text for paste:
69+
Sending
70+
-----
3871

72+
* Sending text:
73+
```bash
74+
pbincli send -t "Hello! This is test paste!"
75+
```
76+
77+
* Use stdin input to read text for paste:
3978
```bash
4079
pbincli send - <<EOF
4180
Hello! This is test paste!
4281
EOF
4382
```
4483

45-
It will send string `Hello! This is test paste!` to PrivateBin.
46-
47-
To send file use `--file` or `-f` with filename. Example:
84+
* Sending file with text in paste:
85+
```bash
86+
pbincli send -f info.pdf -t "I'm sending my document."
87+
```
4888

89+
* Sending only file without any text:
4990
```bash
50-
pbincli send -c "My document" -f info.pdf
91+
pbincli send -q -f info.pdf
5192
```
5293

94+
__*Note*__: 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.
95+
96+
Receiving
97+
-----
98+
5399
To retrieve paste from server, use `get` command with paste info.
54100

55-
It must be formated like `pasteID#passphrase`. Example:
101+
It must be formated like `pasteID#Passphrase` or use full URL to paste. Example:
102+
```bash
103+
pbincli get xxx#yyy ### receive paste xxx from https://paste.i2pd.xyz/ by default
104+
pbincli get https://example.com/?xxx#yyy ### receive paste xxx from https://example.com/
105+
```
106+
107+
Deletion
108+
-----
56109

110+
To delete paste from server, use `delete` command with required `-p` and `-t` options:
57111
```bash
58-
pbincli get 49eeb1326cfa9491#vfeortoVWaYeJlviDdhxQBtj5e0I2kArpynrtu/tnGs=
112+
pbincli delete -p xxx -t deletetoken
113+
```
114+
115+
If you need to delete paste on different server that configured, use `-s` option with instance URL.
116+
117+
Additional examples
118+
=====
119+
120+
Here you can find additional examples.
121+
122+
Usage with service available inside I2P
123+
-----
124+
125+
Change settings to use server `http://privatebin.i2p/` and proxy `http://127.0.0.1:4444`. Here's example for configuration file:
126+
```ini
127+
server=http://privatebin.i2p/
128+
proxy=http://127.0.0.1:4444
59129
```
60-
More info you can find by typing
61130

131+
Using tool with aliases
132+
-----
133+
134+
Example of alias to send paste from `stdin` direclty to I2P service:
62135
```bash
63-
pbincli [-h] {send, get, delete}
136+
alias pastei2p="echo 'paste the text to stdin' && pbincli send -s http://privatebin.i2p/ -x http://127.0.0.1:4444 -"
64137
```
65138

66-
TODO
67-
----
68-
Write a more complete usage documentation.
139+
Call it by running `pastei2p` in terminal.
69140

70141
License
71-
-------
142+
=====
143+
72144
This project is licensed under the MIT license, which can be found in the file
73145
[LICENSE](https://github.com/r4sas/PBinCLI/blob/master/LICENSE) in the root of the project source code.

0 commit comments

Comments
 (0)