aboutsummaryrefslogtreecommitdiffstats
path: root/tp.1
blob: 7d8c6c116303893cca182f169a1263c7de964808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.\"
.\" Copyright (c) 2025 Murilo Ijanc <murilo@ijanc.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd March 25, 2025
.Dt TP 1
.Os
.Sh NAME
.Nm tp
.Nd tesseras-paste client
.Sh SYNOPSIS
.Nm
.Op Fl s Ar sock
.Op Fl v
.Ar command
.Op Ar args
.Sh DESCRIPTION
.Nm
is a command-line client for
.Xr tpd 1 ,
the tesseras-paste daemon.
It communicates over a Unix domain socket to store and retrieve
encrypted pastes on the tesseras-dht distributed hash table.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl s Ar sock
Path to the Unix domain socket.
The default is
.Pa /var/tesseras-paste/daemon.sock .
.It Fl v
Enable verbose output.
Shows the socket path, the request sent to the daemon,
and the raw response received.
.El
.Pp
The following commands are available:
.Bl -tag -width Ds
.It Cm put Oo Fl t Ar ttl Oc Oo Fl p Oc Op Fl l Ar label
Read standard input and store it as a paste.
On success, print the paste key to standard output.
.Pp
.Fl t Ar ttl
sets the time-to-live for the paste.
The value can be suffixed with
.Sq h
for hours,
.Sq m
for minutes, or
.Sq s
for seconds.
A bare number is interpreted as seconds.
The default is
.Dq 24h .
.Pp
.Fl p
stores the paste in public mode without encryption.
.Pp
The maximum input size is 1.44 MB.
Pastes larger than 8 KiB are automatically split into chunks
and reassembled transparently on retrieval.
.Pp
.Fl l Ar label
attaches a label to the paste for later identification.
Labels are stored locally in
.Pa ~/.config/tp/labels .
.It Cm get Ar key
Retrieve the paste identified by
.Ar key
and write its contents to standard output.
.It Cm del Ar key
Delete the paste identified by
.Ar key .
If the paste has a label, the label is also removed.
.It Cm pin Ar key
Pin the paste so it never expires.
.It Cm unpin Ar key
Remove the pin from a paste, allowing it to expire normally.
.It Cm list
List all labeled pastes.
Each line shows the paste key and its label, separated by a tab.
.It Cm label Ar key Ar text
Add or update the label for the paste identified by
.Ar key .
All remaining arguments are joined as the label text.
.It Cm status
Display the daemon status.
.El
.Sh FILES
.Bl -tag -width "/var/tesseras-paste/daemon.sock" -compact
.It Pa /var/tesseras-paste/daemon.sock
Default Unix domain socket.
.It Pa ~/.config/tp/labels
Local paste labels, one per line in
.Dq key\etlabel
format.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Store a paste with default TTL:
.Pp
.Dl $ echo \&"hello world\&" | tp put
.Pp
Retrieve a paste:
.Pp
.Dl $ tp get Ar key
.Pp
Store a paste with a label:
.Pp
.Dl $ echo \&"hello\&" | tp put -l \&"dmesg openbsd 7.9\&"
.Pp
Store a public paste with a 1-hour TTL:
.Pp
.Dl $ echo \&"public data\&" | tp put -t 1h -p
.Pp
List labeled pastes:
.Pp
.Dl $ tp list
.Pp
Label an existing paste:
.Pp
.Dl $ tp label Ar key my zine ep 1
.Sh SEE ALSO
.Xr tpd 1
.Sh AUTHORS
.An Murilo Ijanc Aq Mt murilo@ijanc.org