1LEI-Q(1) public-inbox user manual LEI-Q(1)
2
3
4
6 lei-q - search for messages matching terms
7
9 lei q [OPTIONS] TERM [TERM...]
10
11 lei q [OPTIONS] (--stdin|-)
12
14 Search for messages across the lei/store and externals.
15
17 --stdin
18 Read search terms from stdin.
19
20 --no-save
21 Do not save the search for lei-up(1).
22
23 --output=MFOLDER
24 -o MFOLDER
25 --mfolder=MFOLDER
26 Warning: this clobbers and overwrites the output destination unless
27 "--augment" is specified.
28
29 Destination for results (e.g., "/tmp/results-Maildir",
30 "imaps://user@mail.example.com/INBOX.test", or
31 "mboxcl2:/tmp/results-mboxcl2"). The prefix may be a supported
32 protocol: "imap://" or "imaps://". URLs requiring authentication
33 use git-credential(1) to fill in the username and password.
34
35 A prefix can specify the format of the output: "maildir", "mboxrd",
36 "mboxcl2", "mboxcl", "mboxo". For a description of mail formats,
37 see lei-mail-formats(5).
38
39 "maildir" is the default for an existing directory or non-existing
40 path.
41
42 Default: "-" (stdout)
43
44 --format=FORMAT
45 -f FORMAT
46 Format of results to stdout. This option exists as a convenient
47 way to specify the format for the default stdout destination.
48 "reply", "text", "json", "jsonl", or "concatjson" are all
49 supported, as are the various mbox variants described in
50 "--output".
51
52 When a format isn't specified, it's chosen based on the "--output"
53 destination or prefix. "json" is used for the default destination
54 (stdout).
55
56 Using a "format:" prefix with the "--output" destination is
57 preferred when not writing to stdout.
58
59 --no-color
60 Disable color (for "-f reply" and "-f text").
61
62 --pretty
63 Pretty print "json" or "concatjson" output. If stdout is opened to
64 a tty and used as the "--output" destination, "--pretty" is enabled
65 by default.
66
67 --mua=COMMAND
68 A command to run on "--output" Maildir or mbox (e.g., "mutt -f
69 %f"). For a subset of MUAs known to accept a mailbox via "-f",
70 COMMAND can be abbreviated to the name of the program: "mutt",
71 "mailx", "mail", or "neomutt".
72
73 --alert=COMMAND[,COMMAND...]
74 Run "COMMAND" after writing to output. ":WINCH" indicates to send
75 "SIGWINCH" to the "--mua" process. ":bell" indicates to print a
76 bell code. Any other value is interpreted as a command to execute
77 as is.
78
79 This option may be given multiple times.
80
81 Default: ":WINCH,:bell" when "--mua" is specified and "--output"
82 doesn't point to stdout, nothing otherwise.
83
84 --augment
85 -a Augment output destination instead of clobbering it.
86
87 --no-import-before
88 Do not import keywords before writing to an existing output
89 destination.
90
91 --threads
92 -t Return all messages in the same thread as the actual match(es).
93
94 Using this twice ("-tt") sets the "flagged" (AKA "important") on
95 messages which were actual matches. This is useful to distinguish
96 messages which were direct hits from messages which were merely
97 part of the same thread.
98
99 TODO: Warning: this flag may become persistent and saved in
100 lei/store unless an MUA unflags it! (Behavior undecided)
101
102 --dedupe=STRATEGY
103 -d STRATEGY
104 Strategy for deduplicating messages: "content", "oid", "mid", or
105 "none".
106
107 Default: "content"
108
109 --[no-]remote
110 Whether to include results requiring network access. When local
111 externals are configured, "--remote" must be explicitly passed to
112 enable reporting of results from remote externals.
113
114 --no-local
115 Limit operations to those requiring network access.
116
117 --no-external
118 Don't include results from externals.
119
120 --include=LOCATION
121 -I LOCATION
122 Include specified external in search. This option may be given
123 multiple times.
124
125 --exclude=LOCATION
126 Exclude specified external from search. This option may be given
127 multiple times.
128
129 --only=LOCATION
130 -O LOCATION
131 Use only the specified external for search. This option may be
132 given multiple times, in which case the search uses only the
133 specified set.
134
135 --globoff
136 -g Do not match locations using "*?" wildcards and "[]" ranges. This
137 option applies to "--include", "--exclude", and "--only".
138
139 --no-import-remote
140 Disable the default behavior of memoizing remote messages into the
141 local store.
142
143 --lock=METHOD
144 mbox(5) locking method(s) to use: "dotlock", "fcntl", "flock" or
145 "none".
146
147 Default: fcntl,dotlock
148
149 --limit=NUMBER
150 -NUMBER
151 -n NUMBER
152 Fuzzy limit the number of matches per-local external and lei/store.
153 Messages added by the --threads switch do not count towards this
154 limit, and there is no limit on remote externals.
155
156 Default: 10000
157
158 --offset=NUMBER
159 Shift start of search results.
160
161 Default: 0
162
163 --reverse
164 -r Reverse the results. Note that this applies before "--limit".
165
166 --sort=KEY
167 -s KEY
168 Order the results by KEY. Valid keys are "received", "relevance",
169 and "docid".
170
171 Default: "received"
172
173 --verbose
174 -v Provide more feedback on stderr.
175
176 --quiet
177 -q Suppress feedback messages.
178
179 --torsocks=auto|no|yes
180 --no-torsocks
181 Whether to wrap git(1) and curl(1) commands with torsocks(1).
182
183 Default: "auto"
184
185 --proxy=PROTOCOL://HOST[:PORT]
186
188 "lei q" supports the same search prefixes used by HTTP(S) public-inbox
189 instances:
190
191 s: match within Subject e.g. s:"a quick brown fox"
192 d: match date-time range, git "approxidate" formats supported
193 Open-ended ranges such as `d:last.week..' and
194 `d:..2.days.ago' are supported
195 b: match within message body, including text attachments
196 nq: match non-quoted text within message body
197 q: match quoted text within message body
198 n: match filename of attachment(s)
199 t: match within the To header
200 c: match within the Cc header
201 f: match within the From header
202 a: match within the To, Cc, and From headers
203 tc: match within the To and Cc headers
204 l: match contents of the List-Id header
205 bs: match within the Subject and body
206 dfn: match filename from diff
207 dfa: match diff removed (-) lines
208 dfb: match diff added (+) lines
209 dfhh: match diff hunk header context (usually a function name)
210 dfctx: match diff context lines
211 dfpre: match pre-image git blob ID
212 dfpost: match post-image git blob ID
213 dfblob: match either pre or post-image git blob ID
214 patchid: match `git patch-id --stable' output
215 rt: match received time, like `d:' if sender's clock was correct
216
217 Additional search prefixes which only affect the local lei/store:
218
219 L: match the given label
220 kw: match the given keywords
221
222 See lei-tag(1) for more info on labels and keywords.
223
224 Most prefixes are probabilistic, meaning they support stemming and
225 wildcards ("*"). Ranges (such as "d:") and boolean prefixes do not
226 support stemming or wildcards. The upstream Xapian query parser
227 documentation fully explains the query syntax:
228 <https://xapian.org/docs/queryparser.html>
229
231 "-f reply" is intended to aid in turning a cover letter into a reply
232 (since using "git format-patch --in-reply-to=..." is tedious).
233 Results (including "From " lines) should be edited and trimmed in your
234 favorite $EDITOR before sending.
235
237 Feedback welcome via plain-text mail to <mailto:meta@public-inbox.org>
238
239 The mail archives are hosted at <https://public-inbox.org/meta/> and
240 <http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
241
243 Copyright all contributors <mailto:meta@public-inbox.org>
244
245 License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
246
248 lei-add-external(1), lei-lcat(1), lei-up(1), Xapian::QueryParser Syntax
249 <https://xapian.org/docs/queryparser.html>
250
251
252
253public-inbox.git 1993-10-02 LEI-Q(1)