You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+93-21Lines changed: 93 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,66 +8,138 @@ PBinCLI
8
8
PBinCLI is command line client for [PrivateBin](https://github.com/PrivateBin/PrivateBin/) written on Python 3.
9
9
10
10
Installing
11
-
-----
11
+
=====
12
+
13
+
Installation inside `virtualenv`:
12
14
```bash
13
-
virtualenv --python=python3 venv
15
+
python3 -m virtualenv --python=python3 venv
14
16
. venv/bin/activate
15
17
pip install pbincli
16
18
```
17
19
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
+
20
30
By default pbincli configured to use `https://paste.i2pd.xyz/` for sending and receiving pastes. No proxy used by default.
21
31
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.
23
33
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
+
-----
25
38
26
39
```ini
27
40
server=https://paste.i2pd.xyz/
28
41
proxy=http://127.0.0.1:3128
29
42
```
30
43
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://` |
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
+
=====
32
63
64
+
Tool available by command `pbincli`, help for every command can be called with `-h` option:
33
65
```bash
34
-
pbincli send --text "Hello!"
66
+
pbincli {send|get|delete} -h
35
67
```
36
68
37
-
Or use stdin input to read text for paste:
69
+
Sending
70
+
-----
38
71
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:
39
78
```bash
40
79
pbincli send - <<EOF
41
80
Hello! This is test paste!
42
81
EOF
43
82
```
44
83
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
+
```
48
88
89
+
* Sending only file without any text:
49
90
```bash
50
-
pbincli send -c "My document" -f info.pdf
91
+
pbincli send -q -f info.pdf
51
92
```
52
93
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
+
53
99
To retrieve paste from server, use `get` command with paste info.
54
100
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
+
-----
56
109
110
+
To delete paste from server, use `delete` command with required `-p` and `-t` options:
57
111
```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
59
129
```
60
-
More info you can find by typing
61
130
131
+
Using tool with aliases
132
+
-----
133
+
134
+
Example of alias to send paste from `stdin` direclty to I2P service:
62
135
```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 -"
64
137
```
65
138
66
-
TODO
67
-
----
68
-
Write a more complete usage documentation.
139
+
Call it by running `pastei2p` in terminal.
69
140
70
141
License
71
-
-------
142
+
=====
143
+
72
144
This project is licensed under the MIT license, which can be found in the file
73
145
[LICENSE](https://github.com/r4sas/PBinCLI/blob/master/LICENSE) in the root of the project source code.
0 commit comments