Debian Codegraph @

packaging/man/apprise.md

raw
1 apprise(1) -- Push Notifications that work with just about every platform!
2 ==========================================================================
3
4 ## SYNOPSIS
5
6 `apprise` [<options>...] <service-url>...<br>
7 `apprise` storage [<options>...] [<action>] [<url-or-uid>...]<br>
8
9 ## DESCRIPTION
10
11 **Apprise** allows you to send a notification to _almost all_ of the most
12 popular notification services available to us today such as: Discord,
13 Telegram, Pushbullet, Slack, Twitter, etc.
14
15 * One notification library to rule them all.
16 * A common and intuitive notification syntax.
17 * Supports the handling of images (to the notification services that will
18 accept them).
19 * It's incredibly lightweight.
20 * Amazing response times because all messages sent asynchronously.
21
22 ## OPTIONS
23
24 The Apprise options are as follows:
25
26 `-b`, `--body=`<VALUE>:
27 Specify the message body. If no body is specified then content is read from
28 <stdin>.
29
30 `-t`, `--title=`<VALUE>:
31 Specify the message title. This field is completely optional.
32
33 `-c`, `--config=`<CONFIG-URL>:
34 Specify one or more configuration locations.
35
36 `-a`, `--attach=`<ATTACH-URL>:
37 Specify one or more file attachment locations.
38
39 `-P`, `--plugin-path=`<PATH>:
40 Specify a path to scan for custom notification plugin support.
41 You can create your own notification by simply creating a Python file
42 that contains the `@notify("schema")` decorator.
43
44 You can optionally choose to specify more than one **--plugin-path** (**-P**)
45 to increase the modules included.
46
47 `-n`, `--notification-type=`<VALUE>:
48 Specify the message type (default=info). Possible values are "info",
49 "success", "failure", and "warning".
50
51 `-i`, `--input-format=`<VALUE>:
52 Specify the input message format (default=text). Possible values are "text",
53 "html", and "markdown".
54
55 `-T`, `--theme=`<VALUE>:
56 Specify the default theme.
57
58 `-tv`, `--template-var=`<NAME=VALUE>:
59 Supply a value used by a YAML configuration written with `${NAME}`.
60 Specify this option more than once to supply more than one value, but
61 name each one only once.
62 A value not provided here uses the default in the configuration's
63 `template:` section, then `APPRISE_TEMPLATE_<NAME>`. A URL that still has no value
64 available is not loaded.
65
66 `-g`, `--tag=`<VALUE>:
67 Specify one or more tags to filter which services to notify:
68
69 * `-g "tagA" -g "tagB"`: Match tagA **OR** tagB (Union).
70 * `-g "tagA,tagB"`: Match tagA **AND** tagB (Strict).
71 * `-g "all"`: Notify **ALL** services.
72 * `(Omitted)`: Notify **untagged** services only.
73
74 Tag values may include an optional priority prefix and/or retry suffix:
75
76 * `-g "2:tagA"`: Match **only** entries for tagA assigned priority 2.
77 * `-g "tagA:3"`: Match all tagA entries, retrying each up to 3 times.
78 * `-g "2:tagA:3"`: Priority-2 tagA entries only, with up to 3 retries.
79
80 `-Da`, `--disable-async`:
81 Send notifications synchronously (one after the other) instead of
82 all at once.
83
84 `-L`, `--limit=`<SECONDS>:
85 Give up on the whole run if it's taking too long, e.g. `-L 10` or
86 `-L 2.5`. By default (`0`) there's no limit; see `--service-limit`
87 below to cap each service on its own instead. If a service is truly
88 stuck, Apprise gives it a few extra seconds to wrap up, then exits
89 anyway with status **5**.
90
91 `-SL`, `--service-limit=`<SECONDS>:
92 Give up on any single service if it's taking too long, e.g. `-SL 10`
93 or `-SL 2.5`, or `0` to turn this off entirely. Leave it unset to use
94 Apprise's own default of 60 seconds.
95
96 `-R`, `--recursion-depth`<INTEGER>:
97 The number of recursive import entries that can be loaded from within
98 Apprise configuration. By default this is set to 1. If this is set to
99 zero, then import statements found in any configuration is ignored.
100
101 `-e`, `--interpret-escapes`
102 Enable interpretation of backslash escapes. For example, this would convert
103 sequences such as \n and \r to their respected ascii new-line and carriage
104 return characters prior to the delivery of the notification.
105
106 `-j`, `--interpret-emojis`
107 Enable interpretation of emoji strings. For example, this would convert
108 sequences such as :smile: or :grin: to their respected unicode emoji
109 character.
110
111 `-S`, `--storage-path=`<PATH>:
112 Specify the path to the persistent storage caching location
113
114 `-SM`, `--storage-mode=`<MODE>:
115 Specify the persistent storage operational mode. Possible values are "auto",
116 "flush", and "memory". The default is "auto" if not specified.
117
118 `-SPD`, `--storage-prune-days=`<INTEGER>:
119 Define the number of days the storage prune should run using.
120 Setting this to zero (0) will eliminate all accumulated content. By
121 default this value is 30 (days).
122
123 `-SUL`, `--storage-uid-length=`<INTEGER>:
124 Define the number of unique characters to store persistent cache in.
125 By default this value is 8 (characters).
126
127 `-d`, `--dry-run`:
128 Perform a trial run but only prints the notification services to-be
129 triggered to **stdout**. Notifications are never sent using this mode.
130
131 `-l`, `--details`
132 Prints details about the current services supported by Apprise.
133
134 `-v`, `--verbose`:
135 The more of these you specify, the more verbose the output is. e.g: -vvvv
136
137 `-D`, `--debug`:
138 A debug mode; useful for troubleshooting.
139
140 `-V`, `--version`:
141 Display the apprise version and exit.
142
143 `-h`, `--help`:
144 Show this message and exit.
145
146 ## PERSISTENT STORAGE
147
148 Persistent storage by default writes to the following location unless the environment variable `APPRISE_STORAGE_PATH` overrides it and/or `--storage-path` (`-SP`) is specified to override it:
149
150 ~/.local/share/apprise/cache
151
152 To utilize the [persistent storage][pstorage] element associated with Apprise, simply
153 specify the keyword **storage**
154
155 $ apprise storage
156
157 The **storage** action has the following sub actions:
158
159 `list`:
160 List all of the detected persistent storage elements and their state
161 (**stale**, **active**, or **unused**). This is the default action if
162 nothing further is identified. Results may be filtered by passing one
163 or more 8-character UID prefix strings, or by passing full Apprise
164 service URLs — each URL is resolved to its storage namespace
165 automatically, making it easy to look up a specific plugin's cache
166 entry without knowing the hash in advance.
167
168 `prune`:
169 Removes all persistent storage that has not been referenced for more than 30
170 days. You can optionally set the `--storage-prune-days` to alter this
171 default value.
172
173 `clean`:
174 Removes all persistent storage regardless of age.
175
176 ## EXIT STATUS
177
178 **apprise** exits with a status of:
179
180 * **0** if all of the notifications were sent successfully.
181 * **1** if every notification failed, or the notification could not start.
182 * **2** if there was an error specified on the command line such as not
183 providing a valid argument.
184 * **3** if one or more Apprise Service URLs were successfully loaded but
185 none could be notified due to user filtering (via tags).
186 * **4** if at least one notification was sent successfully and at least
187 one other was not (whether it failed outright or ran out of time).
188 * **5** if no notification was sent, and the only problem was that one or
189 more services ran out of time.
190
191 ## SERVICE URLS
192
193 There are too many service URL and combinations to list here. It's best to
194 visit the [Apprise GitHub page][serviceurls] and see what's available.
195 Also try out the [Apprise URL Builder][buildurls] to easily construct the URLS
196 this tool supports and works with.
197
198 [serviceurls]: https://appriseit.com/services/
199 [buildurls]: https://appriseit.com/tools/url-builder/
200
201 The **environment variable** of `APPRISE_URLS` (comma/space delimited) can be specified to
202 provide the default set of URLs you wish to notify if none are otherwise specified.
203
204 ## EXAMPLES
205
206 Send a notification to multiple services by chaining their URLs:
207
208 $ apprise -vv -t "my title" -b "my notification body" \
209 "mailto://myemail:[email protected]" \
210 "pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b"
211
212 If you don't specify a **--body** (**-b**) then stdin is used allowing you to
213 use the tool as part of your every day administration:
214
215 $ cat /proc/cpuinfo | apprise -vv -t "cpu info" \
216 "mailto://myemail:[email protected]"
217
218 Load in a configuration file which identifies all of your notification service
219 URLs and notify them all:
220
221 $ apprise -vv -t "my title" -b "my notification body" \
222 --config=~/apprise.yml
223
224 Load in a configuration file from a remote server that identifies all of your
225 notification service URLs and only notify the ones tagged as _devops_.
226
227 $ apprise -vv -t "my title" -b "my notification body" \
228 --config=https://localhost/my/apprise/config \
229 -t devops
230
231 **Tagging Logic Examples:**
232
233 Notify any service tagged with "devops" OR "admin" (Union):
234
235 $ apprise -vv -t "Union Test" \
236 --config=~/apprise.yml \
237 -g devops -g admin
238
239 Notify only services tagged with BOTH "devops" AND "critical" (Intersection):
240
241 $ apprise -vv -t "Intersection Test" \
242 --config=~/apprise.yml \
243 -g devops,critical
244
245 Notify only priority-2 "alerts" services (exclusive priority filter):
246
247 $ apprise -vv -t "High Alert" \
248 --config=~/apprise.yml \
249 -g "2:alerts"
250
251 Notify all "alerts" services and retry each up to 3 times on failure:
252
253 $ apprise -vv -t "Critical Event" \
254 --config=~/apprise.yml \
255 -g "alerts:3"
256
257 Include an attachment:
258
259 $ apprise -vv -t "School Assignment" -b "See attached" \
260 --attach=Documents/FinalReport.docx
261
262 List all of the notifications loaded:
263
264 $ apprise --dry-run --tag=all
265
266 List all of the details around the current persistent storage setup:
267
268 $ apprise storage list
269
270 Look up the storage namespace for a specific notification URL (shows the
271 UID even when no data has been written yet):
272
273 $ apprise storage list "mailtos://user:[email protected]"
274
275 Prune all persistent storage that has not been referenced for at least 10 days or more
276
277 $ apprise storage prune --storage-prune-days=10
278
279 ## CUSTOM PLUGIN/NOTIFICATIONS
280 Apprise can additionally allow you to define your own custom **schema://**
281 entries that you can trigger on and call services you've defined.
282
283 By default **apprise** looks in the following local locations for custom plugin
284 files and loads them:
285
286 ~/.apprise/plugins
287 ~/.config/apprise/plugins
288 /var/lib/apprise/plugins
289
290 The **environment variable** of `APPRISE_PLUGIN_PATH` can be specified to override
291 the list identified above with one of your own. use a semi-colon (`;`), line-feed (`\n`),
292 and/or carriage return (`\r`) to delimit multiple entries.
293
294 Simply create your own python file with the following bare minimum content in
295 it:
296
297 from apprise.decorators import notify
298
299 # This example assumes you want your function to trigger on foobar://
300 # references:
301 @notify(on="foobar", name="My Custom Notification")
302 def my_wrapper(body, title, notify_type, *args, **kwargs):
303
304 print("Define your custom code here")
305
306 # Returning True/False will relay your status back through Apprise
307 # Returning nothing (None by default) is always interpreted as True
308 return True
309
310 ## CONFIGURATION
311
312 An [Apprise configuration file][config] can be in the format of either **TEXT**
313 or **YAML** where TEXT is the easiest and most ideal solution for most users.
314 However YAML configuration files grants the user a bit more leverage and access
315 to some of the internal features of Apprise. Regardless of which format you choose,
316 both provide the users the ability to leverage **tagging** which adds a more rich and
317 powerful notification environment.
318
319 Configuration files can be directly referenced via **apprise** when referencing
320 the `--config=` (`-c`) CLI directive. You can identify as many as you like on the
321 command line and all of them will be loaded. You can also point your configuration to
322 a cloud location (by referencing `http://` or `https://`. By default **apprise** looks
323 in the following local locations for configuration files and loads them:
324
325 ~/.apprise.conf
326 ~/.apprise.yaml
327 ~/.config/apprise.conf
328 ~/.config/apprise.yaml
329
330 ~/.apprise/apprise.conf
331 ~/.apprise/apprise.yaml
332 ~/.config/apprise/apprise.conf
333 ~/.config/apprise/apprise.yaml
334
335 /etc/apprise.conf
336 /etc/apprise.yaml
337 /etc/apprise/apprise.conf
338 /etc/apprise/apprise.yaml
339
340 The **configuration files** specified above can also be identified with a `.yml`
341 extension or even just entirely removing the `.conf` extension altogether.
342
343 The **environment variable** of `APPRISE_CONFIG_PATH` can be specified to override
344 the list identified above with one of your own. use a semi-colon (`;`), line-feed (`\n`),
345 and/or carriage return (`\r`) to delimit multiple entries.
346
347 If a default configuration file is referenced in any way by the **apprise**
348 tool, you no longer need to provide it a Service URL. Usage of the **apprise**
349 tool simplifies to:
350
351 $ apprise -vv -t "my title" -b "my notification body"
352
353 If you leveraged [tagging][tagging], you can define all of Apprise Service URLs in your
354 configuration that you want and only specifically notify a subset of them:
355
356 $ apprise -vv --title "Will Be Late Getting Home" \
357 --body "Please go ahead and make dinner without me." \
358 --tag=family
359
360 ### TEMPLATE VARIABLES
361
362 A **YAML** configuration can leave a value out of a URL and have it filled in
363 later. Write `${NAME}` where the value belongs and declare every name you use
364 in a `template:` section:
365
366 template:
367 # A value written here is used when nothing else supplies one
368 smtp_host: smtp.example.com
369 # No value, so this one must always be supplied
370 api_key:
371
372 urls:
373 - sendgrid://${API_KEY}:[email protected]/[email protected]:
374 - tag: alerts
375
376 Values are looked for in this order, stopping at the first that answers:
377
378 * a value given with `--template-var` (`-tv`)
379 * the default written in the `template:` section
380 * the environment variable `APPRISE_TEMPLATE_<NAME>`
381
382 A URL with no value available is not loaded, and **apprise** exits with a
383 status of **4** if others were notified, or **1** if none were. Use
384 `--dry-run` to see which values a configuration is still waiting for.
385
386 `${NAME}` only means something when `NAME` appears in the `template:` section.
387 Anywhere else it is ordinary text and is sent exactly as written, so a password
388 containing `${...}` is never altered. Names ignore case, and a name may be
389 used as often as you like. Values may be up to 1,024 characters. Extra supplied
390 names are accepted and ignored; their names appear only in the local debug log,
391 never with their values.
392
393 The configuration author may place a variable directly in a URL or in a named
394 YAML setting below it. URL markers can change any field, including the
395 destination; whole-host markers also accept `user@host` and `user:pass@host`.
396 A named setting changes only its option, so prefer it for values supplied by
397 less-trusted callers.
398
399 A variable may not appear before `://`, may not be used for `tag:`/`tags:`, and
400 may not be used as a setting's name. The service and tags are selected before
401 values are filled in, so neither can be dynamic.
402
403 This applies to **YAML** configuration only; **TEXT** configuration is passed
404 through unchanged.
405
406 [config]: https://appriseit.com/getting-started/configuration/
407 [tagging]: https://appriseit.com/cli/usage/#tagging-and-filtering
408 [pstorage]: https://appriseit.com/cli/persistent-storage/
409
410 ## ENVIRONMENT VARIABLES
411 `APPRISE_URLS`:
412 Specify the default URLs to notify IF none are otherwise specified on the command line
413 explicitly. If the `--config` (`-c`) is specified, then this will override any
414 reference to this variable. Use white space and/or a comma (`,`) to delimit multiple entries.
415
416 `APPRISE_CONFIG_PATH`:
417 Explicitly specify the config search path to use (overriding the default).
418 Use a semi-colon (`;`), line-feed (`\n`), and/or carriage return (`\r`) to delimit multiple entries.
419
420 `APPRISE_PLUGIN_PATH`:
421 Explicitly specify the custom plugin search path to use (overriding the default).
422 Use a semi-colon (`;`), line-feed (`\n`), and/or carriage return (`\r`) to delimit multiple entries.
423
424 `APPRISE_STORAGE_PATH`:
425 Explicitly specify the persistent storage path to use (overriding the default).
426
427 `APPRISE_TEMPLATE_<NAME>`:
428 Supply a value for a `${NAME}` used by a YAML configuration. For example
429 `APPRISE_TEMPLATE_API_KEY` fills in `${API_KEY}`. A value supplied with
430 `--template-var` (`-tv`) and a configuration default both take priority.
431 Blank values are ignored.
432
433 `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`:
434 Standard proxy variables honored by the underlying `requests` library (not
435 Apprise-specific). Set `HTTP_PROXY`/`HTTPS_PROXY` to route outbound
436 notifications through a proxy, and `NO_PROXY` to exempt specific hosts.
437 SOCKS proxies (`socks5h://...`) additionally require the optional
438 `PySocks` package (`pip install pysocks`) to be installed.
439
440 ## BUGS
441
442 If you find any bugs, please make them known at:
443 <https://github.com/caronc/apprise/issues>
444
445 ## DONATIONS
446 If you found Apprise useful at all, [please consider sponsoring][sponsorship] or [donating][donating]!
447
448 [sponsorship]: https://github.com/sponsors/caronc
449 [donating]: https://www.paypal.com/donate/?hosted_button_id=CR6YF7KLQWQ5E
450
451 ## COPYRIGHT
452
453 Apprise is Copyright (C) 2026 Chris Caron <[email protected]>