telert 0.2.7__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {telert-0.2.7/telert.egg-info → telert-0.2.9}/PKG-INFO +27 -5
- {telert-0.2.7 → telert-0.2.9}/README.md +24 -2
- {telert-0.2.7 → telert-0.2.9}/pyproject.toml +3 -3
- {telert-0.2.7 → telert-0.2.9}/telert/__init__.py +1 -1
- {telert-0.2.7 → telert-0.2.9}/telert/cli.py +99 -4
- {telert-0.2.7 → telert-0.2.9}/telert/messaging.py +46 -1
- {telert-0.2.7 → telert-0.2.9/telert.egg-info}/PKG-INFO +27 -5
- {telert-0.2.7 → telert-0.2.9}/telert.egg-info/requires.txt +2 -2
- {telert-0.2.7 → telert-0.2.9}/LICENSE +0 -0
- {telert-0.2.7 → telert-0.2.9}/MANIFEST.in +0 -0
- {telert-0.2.7 → telert-0.2.9}/setup.cfg +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/api.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/data/notification-icon.png +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/data/notification.mp3 +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/__init__.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/activity_logs.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/base.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/cli.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/cli_logs.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/debug_logs.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/log.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/network.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert/monitoring/process.py +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert.egg-info/SOURCES.txt +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert.egg-info/dependency_links.txt +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert.egg-info/entry_points.txt +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert.egg-info/top_level.txt +0 -0
- {telert-0.2.7 → telert-0.2.9}/telert.png +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: telert
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks.
|
|
5
5
|
Author-email: Mihir Khandekar <mihirkhandekar@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -38,10 +38,10 @@ Requires-Dist: build; extra == "dev"
|
|
|
38
38
|
Requires-Dist: twine; extra == "dev"
|
|
39
39
|
Requires-Dist: pytest; extra == "dev"
|
|
40
40
|
Provides-Extra: audio
|
|
41
|
-
Requires-Dist: playsound; extra == "audio"
|
|
41
|
+
Requires-Dist: playsound==1.2.2; extra == "audio"
|
|
42
42
|
Provides-Extra: desktop
|
|
43
43
|
Provides-Extra: all
|
|
44
|
-
Requires-Dist: playsound; extra == "all"
|
|
44
|
+
Requires-Dist: playsound==1.2.2; extra == "all"
|
|
45
45
|
Requires-Dist: psutil; extra == "all"
|
|
46
46
|
Requires-Dist: ping3; extra == "all"
|
|
47
47
|
Dynamic: license-file
|
|
@@ -54,7 +54,7 @@ Dynamic: license-file
|
|
|
54
54
|
<img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
|
|
55
55
|
</p>
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
\*\*Version 0.2.9\*\*
|
|
58
58
|
|
|
59
59
|
[](https://pepy.tech/projects/telert)
|
|
60
60
|
[](https://github.com/navig-me/telert/stargazers)
|
|
@@ -402,7 +402,7 @@ Configuration is stored in `~/.config/telert/config.json` and can be overridden
|
|
|
402
402
|
|----------------|--------------|---------|
|
|
403
403
|
| **Run** | Wraps a command, times it, sends notification with exit code. | `telert run --label "RSYNC" rsync -a /src /dst` |
|
|
404
404
|
| **Filter** | Reads from stdin so you can pipe command output. | `long_job \| telert "compile done"` |
|
|
405
|
-
| **Hook** | Generates a Bash snippet so **every** command > *N* seconds notifies automatically. | `eval "$(telert hook -l 30)"` |
|
|
405
|
+
| **Hook** | Generates a Bash/Zsh snippet so **every** command > *N* seconds notifies automatically. Supports wildcard filters to silence specific commands. | `eval "$(telert hook -l 30)"` |
|
|
406
406
|
| **Monitor** | Watches processes, log files, and network endpoints. | `telert monitor process --name "nginx" --notify-on stop` |
|
|
407
407
|
| **Send** | Low-level "send arbitrary text" helper. | `telert send --provider slack "Build complete"` |
|
|
408
408
|
| **Python API** | Use directly in Python code with context managers and decorators. | `from telert import telert, send, notify` |
|
|
@@ -593,6 +593,28 @@ echo 'eval "$(telert hook -l 30)"' >> ~/.bashrc
|
|
|
593
593
|
echo 'eval "$(telert hook -l 30)"' >> ~/.zshrc
|
|
594
594
|
```
|
|
595
595
|
|
|
596
|
+
**Filtering hook messages:**
|
|
597
|
+
|
|
598
|
+
You can silence notifications for specific commands using wildcard patterns:
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
# Add filters to silence common commands
|
|
602
|
+
telert hook-filter add "cd *" # Silence all cd commands with arguments
|
|
603
|
+
telert hook-filter add "ls*" # Silence ls, lsof, lsblk, etc.
|
|
604
|
+
telert hook-filter add "git status" # Silence exact command
|
|
605
|
+
|
|
606
|
+
# List configured filters
|
|
607
|
+
telert hook-filter list
|
|
608
|
+
|
|
609
|
+
# Remove a filter
|
|
610
|
+
telert hook-filter remove "ls*"
|
|
611
|
+
|
|
612
|
+
# Clear all filters
|
|
613
|
+
telert hook-filter clear
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
Filters use shell-style wildcards: `*` matches any sequence, `?` matches any single character, `[seq]` matches any character in seq.
|
|
617
|
+
|
|
596
618
|
#### CLI Help
|
|
597
619
|
```bash
|
|
598
620
|
# View all available commands
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
\*\*Version 0.2.9\*\*
|
|
10
10
|
|
|
11
11
|
[](https://pepy.tech/projects/telert)
|
|
12
12
|
[](https://github.com/navig-me/telert/stargazers)
|
|
@@ -354,7 +354,7 @@ Configuration is stored in `~/.config/telert/config.json` and can be overridden
|
|
|
354
354
|
|----------------|--------------|---------|
|
|
355
355
|
| **Run** | Wraps a command, times it, sends notification with exit code. | `telert run --label "RSYNC" rsync -a /src /dst` |
|
|
356
356
|
| **Filter** | Reads from stdin so you can pipe command output. | `long_job \| telert "compile done"` |
|
|
357
|
-
| **Hook** | Generates a Bash snippet so **every** command > *N* seconds notifies automatically. | `eval "$(telert hook -l 30)"` |
|
|
357
|
+
| **Hook** | Generates a Bash/Zsh snippet so **every** command > *N* seconds notifies automatically. Supports wildcard filters to silence specific commands. | `eval "$(telert hook -l 30)"` |
|
|
358
358
|
| **Monitor** | Watches processes, log files, and network endpoints. | `telert monitor process --name "nginx" --notify-on stop` |
|
|
359
359
|
| **Send** | Low-level "send arbitrary text" helper. | `telert send --provider slack "Build complete"` |
|
|
360
360
|
| **Python API** | Use directly in Python code with context managers and decorators. | `from telert import telert, send, notify` |
|
|
@@ -545,6 +545,28 @@ echo 'eval "$(telert hook -l 30)"' >> ~/.bashrc
|
|
|
545
545
|
echo 'eval "$(telert hook -l 30)"' >> ~/.zshrc
|
|
546
546
|
```
|
|
547
547
|
|
|
548
|
+
**Filtering hook messages:**
|
|
549
|
+
|
|
550
|
+
You can silence notifications for specific commands using wildcard patterns:
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
# Add filters to silence common commands
|
|
554
|
+
telert hook-filter add "cd *" # Silence all cd commands with arguments
|
|
555
|
+
telert hook-filter add "ls*" # Silence ls, lsof, lsblk, etc.
|
|
556
|
+
telert hook-filter add "git status" # Silence exact command
|
|
557
|
+
|
|
558
|
+
# List configured filters
|
|
559
|
+
telert hook-filter list
|
|
560
|
+
|
|
561
|
+
# Remove a filter
|
|
562
|
+
telert hook-filter remove "ls*"
|
|
563
|
+
|
|
564
|
+
# Clear all filters
|
|
565
|
+
telert hook-filter clear
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
Filters use shell-style wildcards: `*` matches any sequence, `?` matches any single character, `[seq]` matches any character in seq.
|
|
569
|
+
|
|
548
570
|
#### CLI Help
|
|
549
571
|
```bash
|
|
550
572
|
# View all available commands
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "telert"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.9"
|
|
4
4
|
description = "Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks."
|
|
5
5
|
authors = [{ name = "Mihir Khandekar", email = "mihirkhandekar@gmail.com" }]
|
|
6
6
|
license = "MIT"
|
|
@@ -62,9 +62,9 @@ telert = "telert.cli:main"
|
|
|
62
62
|
|
|
63
63
|
[project.optional-dependencies]
|
|
64
64
|
dev = ["build", "twine", "pytest"]
|
|
65
|
-
audio = ["playsound"]
|
|
65
|
+
audio = ["playsound==1.2.2"]
|
|
66
66
|
desktop = []
|
|
67
|
-
all = ["playsound", "psutil", "ping3"]
|
|
67
|
+
all = ["playsound==1.2.2", "psutil", "ping3"]
|
|
68
68
|
|
|
69
69
|
[tool.setuptools]
|
|
70
70
|
packages = ["telert", "telert.data", "telert.monitoring"]
|
|
@@ -13,6 +13,7 @@ from __future__ import annotations
|
|
|
13
13
|
|
|
14
14
|
import traceback
|
|
15
15
|
import argparse
|
|
16
|
+
import fnmatch
|
|
16
17
|
import os
|
|
17
18
|
import subprocess
|
|
18
19
|
import sys
|
|
@@ -32,6 +33,23 @@ from telert.monitoring.cli import setup_monitor_cli, handle_monitor_commands
|
|
|
32
33
|
CFG_DIR = CONFIG_DIR
|
|
33
34
|
CFG_FILE = CFG_DIR / "config.json"
|
|
34
35
|
|
|
36
|
+
# Top-level subcommands recognized by the argparse CLI. Used to distinguish a
|
|
37
|
+
# genuine CLI invocation (e.g. `telert config ...`, `telert --help`) from
|
|
38
|
+
# piped-mode usage (`some_command | telert "message"`) when stdin isn't a
|
|
39
|
+
# TTY — which is the default for `docker run image <command>` without `-it`.
|
|
40
|
+
KNOWN_COMMANDS = {
|
|
41
|
+
"monitor",
|
|
42
|
+
"config",
|
|
43
|
+
"status",
|
|
44
|
+
"hook",
|
|
45
|
+
"hook-filter",
|
|
46
|
+
"hook-check-filter",
|
|
47
|
+
"send",
|
|
48
|
+
"run",
|
|
49
|
+
"help",
|
|
50
|
+
"init",
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
# ───────────────────────────────── helpers ──────────────────────────────────
|
|
36
54
|
|
|
37
55
|
|
|
@@ -622,6 +640,55 @@ def do_status(a):
|
|
|
622
640
|
sys.exit(f"❌ Failed to send message: {str(e)}")
|
|
623
641
|
|
|
624
642
|
|
|
643
|
+
def do_hook_filter(a):
|
|
644
|
+
"""Manage hook message filters."""
|
|
645
|
+
config = MessagingConfig()
|
|
646
|
+
|
|
647
|
+
if a.action == "add":
|
|
648
|
+
if not a.pattern:
|
|
649
|
+
sys.exit("❌ You must specify a pattern to add")
|
|
650
|
+
if config.add_hook_filter(a.pattern):
|
|
651
|
+
print(f"✔ Filter added: {a.pattern}")
|
|
652
|
+
else:
|
|
653
|
+
print(f"Filter already exists: {a.pattern}")
|
|
654
|
+
|
|
655
|
+
elif a.action == "remove":
|
|
656
|
+
if not a.pattern:
|
|
657
|
+
sys.exit("❌ You must specify a pattern to remove")
|
|
658
|
+
if config.remove_hook_filter(a.pattern):
|
|
659
|
+
print(f"✔ Filter removed: {a.pattern}")
|
|
660
|
+
else:
|
|
661
|
+
sys.exit(f"❌ Filter not found: {a.pattern}")
|
|
662
|
+
|
|
663
|
+
elif a.action == "list":
|
|
664
|
+
filters = config.get_hook_filters()
|
|
665
|
+
if not filters:
|
|
666
|
+
print("No hook filters configured.")
|
|
667
|
+
else:
|
|
668
|
+
print("Hook filters:")
|
|
669
|
+
for f in filters:
|
|
670
|
+
print(f" {f}")
|
|
671
|
+
|
|
672
|
+
elif a.action == "clear":
|
|
673
|
+
config.clear_hook_filters()
|
|
674
|
+
print("✔ All hook filters cleared.")
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def do_hook_check_filter(a):
|
|
678
|
+
"""Check if a command matches any hook filter (for shell hook use)."""
|
|
679
|
+
config = MessagingConfig()
|
|
680
|
+
filters = config.get_hook_filters()
|
|
681
|
+
command = a.command
|
|
682
|
+
|
|
683
|
+
for pattern in filters:
|
|
684
|
+
if fnmatch.fnmatch(command, pattern):
|
|
685
|
+
# Match found - exit with 1 (filtered, suppress notification)
|
|
686
|
+
sys.exit(1)
|
|
687
|
+
|
|
688
|
+
# No match - exit with 0 (not filtered, allow notification)
|
|
689
|
+
sys.exit(0)
|
|
690
|
+
|
|
691
|
+
|
|
625
692
|
def do_hook(a):
|
|
626
693
|
"""Generate a shell hook for command notifications."""
|
|
627
694
|
shell = a.shell or os.path.basename(os.environ.get("SHELL", "bash"))
|
|
@@ -645,7 +712,10 @@ def do_hook(a):
|
|
|
645
712
|
local end=$EPOCHSECONDS
|
|
646
713
|
local duration=$((end - __TELERT_START__))
|
|
647
714
|
if (( duration >= {threshold} )); then
|
|
648
|
-
|
|
715
|
+
# Check if command matches any filter
|
|
716
|
+
if telert hook-check-filter "$__TELERT_CMD__" 2>/dev/null; then
|
|
717
|
+
telert send "$__TELERT_CMD__ exited with $st in $(printf '%dm%02ds' $((duration/60)) $((duration%60)))"
|
|
718
|
+
fi
|
|
649
719
|
fi
|
|
650
720
|
unset __TELERT_START__
|
|
651
721
|
fi
|
|
@@ -681,7 +751,10 @@ def do_hook(a):
|
|
|
681
751
|
local end=$EPOCHSECONDS
|
|
682
752
|
local duration=$((end - __TELERT_START__))
|
|
683
753
|
if (( duration >= {threshold} )); then
|
|
684
|
-
|
|
754
|
+
# Check if command matches any filter
|
|
755
|
+
if telert hook-check-filter "$__TELERT_CMD__" 2>/dev/null; then
|
|
756
|
+
telert send "$__TELERT_CMD__ exited with $st in $(printf '%dm%02ds' $((duration/60)) $((duration%60)))"
|
|
757
|
+
fi
|
|
685
758
|
fi
|
|
686
759
|
unset __TELERT_START__
|
|
687
760
|
unset __TELERT_CMD__
|
|
@@ -694,7 +767,7 @@ def do_hook(a):
|
|
|
694
767
|
else: # Default to bash
|
|
695
768
|
hook_script = textwrap.dedent(f"""
|
|
696
769
|
telert_preexec() {{{{ export __TELERT_CMD__="$BASH_COMMAND"; export TELERT_START=$EPOCHSECONDS; }}}}
|
|
697
|
-
telert_precmd() {{{{ local st=$?; if [[ -n "$TELERT_START" ]]; then local d=$((EPOCHSECONDS-TELERT_START)); if (( d >= {threshold} )); then telert send "$__TELERT_CMD__ exited with $st in $(printf '%dm%02ds' $((d/60)) $((d%60)))"; fi; unset TELERT_START; fi; }}}}
|
|
770
|
+
telert_precmd() {{{{ local st=$?; if [[ -n "$TELERT_START" ]]; then local d=$((EPOCHSECONDS-TELERT_START)); if (( d >= {threshold} )) && telert hook-check-filter "$__TELERT_CMD__" 2>/dev/null; then telert send "$__TELERT_CMD__ exited with $st in $(printf '%dm%02ds' $((d/60)) $((d%60)))"; fi; unset TELERT_START; fi; }}}}
|
|
698
771
|
trap 'telert_preexec' DEBUG
|
|
699
772
|
PROMPT_COMMAND="telert_precmd${{{{PROMPT_COMMAND:+;}}}}$PROMPT_COMMAND"
|
|
700
773
|
""").strip()
|
|
@@ -1508,7 +1581,10 @@ def main():
|
|
|
1508
1581
|
if len(sys.argv) >= 2 and sys.argv[1] == "--version":
|
|
1509
1582
|
print(f"telert {__version__}")
|
|
1510
1583
|
return
|
|
1511
|
-
|
|
1584
|
+
is_known_invocation = len(sys.argv) >= 2 and (
|
|
1585
|
+
sys.argv[1] in KNOWN_COMMANDS or sys.argv[1] in ("--help", "-h")
|
|
1586
|
+
)
|
|
1587
|
+
if not is_known_invocation and not sys.stdin.isatty():
|
|
1512
1588
|
piped_mode()
|
|
1513
1589
|
return
|
|
1514
1590
|
p = argparse.ArgumentParser(
|
|
@@ -1769,6 +1845,25 @@ def main():
|
|
|
1769
1845
|
)
|
|
1770
1846
|
hk.set_defaults(func=do_hook)
|
|
1771
1847
|
|
|
1848
|
+
# hook-filter
|
|
1849
|
+
hf = sp.add_parser("hook-filter", help="manage hook message filters (wildcard patterns)")
|
|
1850
|
+
hf.add_argument(
|
|
1851
|
+
"action",
|
|
1852
|
+
choices=["add", "remove", "list", "clear"],
|
|
1853
|
+
help="action to perform",
|
|
1854
|
+
)
|
|
1855
|
+
hf.add_argument(
|
|
1856
|
+
"pattern",
|
|
1857
|
+
nargs="?",
|
|
1858
|
+
help="wildcard pattern to filter (e.g., 'cd *', 'ls*', 'git status')",
|
|
1859
|
+
)
|
|
1860
|
+
hf.set_defaults(func=do_hook_filter)
|
|
1861
|
+
|
|
1862
|
+
# hook-check-filter (internal command for shell hook use)
|
|
1863
|
+
hcf = sp.add_parser("hook-check-filter", help="check if command matches a filter (internal)")
|
|
1864
|
+
hcf.add_argument("command", help="command to check against filters")
|
|
1865
|
+
hcf.set_defaults(func=do_hook_check_filter)
|
|
1866
|
+
|
|
1772
1867
|
# send
|
|
1773
1868
|
sd = sp.add_parser("send", help="send arbitrary text")
|
|
1774
1869
|
sd.add_argument("text", help="message to send")
|
|
@@ -326,6 +326,51 @@ class MessagingConfig:
|
|
|
326
326
|
self.set_default_providers([provider])
|
|
327
327
|
self.save()
|
|
328
328
|
|
|
329
|
+
def get_hook_filters(self) -> List[str]:
|
|
330
|
+
"""Get the list of hook message filters (wildcard patterns)."""
|
|
331
|
+
return self._config.get("hook_filters", [])
|
|
332
|
+
|
|
333
|
+
def add_hook_filter(self, pattern: str) -> bool:
|
|
334
|
+
"""Add a hook message filter pattern.
|
|
335
|
+
|
|
336
|
+
Args:
|
|
337
|
+
pattern: Wildcard pattern to filter messages (e.g., "cd *", "ls*")
|
|
338
|
+
|
|
339
|
+
Returns:
|
|
340
|
+
True if added, False if already exists
|
|
341
|
+
"""
|
|
342
|
+
if not pattern or not pattern.strip():
|
|
343
|
+
return False
|
|
344
|
+
filters = self.get_hook_filters()
|
|
345
|
+
if pattern in filters:
|
|
346
|
+
return False
|
|
347
|
+
filters.append(pattern)
|
|
348
|
+
self._config["hook_filters"] = filters
|
|
349
|
+
self.save()
|
|
350
|
+
return True
|
|
351
|
+
|
|
352
|
+
def remove_hook_filter(self, pattern: str) -> bool:
|
|
353
|
+
"""Remove a hook message filter pattern.
|
|
354
|
+
|
|
355
|
+
Args:
|
|
356
|
+
pattern: The exact pattern to remove
|
|
357
|
+
|
|
358
|
+
Returns:
|
|
359
|
+
True if removed, False if not found
|
|
360
|
+
"""
|
|
361
|
+
filters = self.get_hook_filters()
|
|
362
|
+
if pattern not in filters:
|
|
363
|
+
return False
|
|
364
|
+
filters.remove(pattern)
|
|
365
|
+
self._config["hook_filters"] = filters
|
|
366
|
+
self.save()
|
|
367
|
+
return True
|
|
368
|
+
|
|
369
|
+
def clear_hook_filters(self):
|
|
370
|
+
"""Remove all hook message filters."""
|
|
371
|
+
self._config["hook_filters"] = []
|
|
372
|
+
self.save()
|
|
373
|
+
|
|
329
374
|
|
|
330
375
|
def prepare_telegram_html(message: str) -> str:
|
|
331
376
|
"""
|
|
@@ -382,7 +427,7 @@ def prepare_telegram_html(message: str) -> str:
|
|
|
382
427
|
|
|
383
428
|
|
|
384
429
|
def prepare_telegram_plain_text(message: str) -> str:
|
|
385
|
-
"""
|
|
430
|
+
r"""
|
|
386
431
|
Return the message unchanged for plain-text Telegram delivery.
|
|
387
432
|
|
|
388
433
|
When *no* ``parse_mode`` is supplied the Telegram Bot API treats the text as
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: telert
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks.
|
|
5
5
|
Author-email: Mihir Khandekar <mihirkhandekar@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -38,10 +38,10 @@ Requires-Dist: build; extra == "dev"
|
|
|
38
38
|
Requires-Dist: twine; extra == "dev"
|
|
39
39
|
Requires-Dist: pytest; extra == "dev"
|
|
40
40
|
Provides-Extra: audio
|
|
41
|
-
Requires-Dist: playsound; extra == "audio"
|
|
41
|
+
Requires-Dist: playsound==1.2.2; extra == "audio"
|
|
42
42
|
Provides-Extra: desktop
|
|
43
43
|
Provides-Extra: all
|
|
44
|
-
Requires-Dist: playsound; extra == "all"
|
|
44
|
+
Requires-Dist: playsound==1.2.2; extra == "all"
|
|
45
45
|
Requires-Dist: psutil; extra == "all"
|
|
46
46
|
Requires-Dist: ping3; extra == "all"
|
|
47
47
|
Dynamic: license-file
|
|
@@ -54,7 +54,7 @@ Dynamic: license-file
|
|
|
54
54
|
<img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
|
|
55
55
|
</p>
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
\*\*Version 0.2.9\*\*
|
|
58
58
|
|
|
59
59
|
[](https://pepy.tech/projects/telert)
|
|
60
60
|
[](https://github.com/navig-me/telert/stargazers)
|
|
@@ -402,7 +402,7 @@ Configuration is stored in `~/.config/telert/config.json` and can be overridden
|
|
|
402
402
|
|----------------|--------------|---------|
|
|
403
403
|
| **Run** | Wraps a command, times it, sends notification with exit code. | `telert run --label "RSYNC" rsync -a /src /dst` |
|
|
404
404
|
| **Filter** | Reads from stdin so you can pipe command output. | `long_job \| telert "compile done"` |
|
|
405
|
-
| **Hook** | Generates a Bash snippet so **every** command > *N* seconds notifies automatically. | `eval "$(telert hook -l 30)"` |
|
|
405
|
+
| **Hook** | Generates a Bash/Zsh snippet so **every** command > *N* seconds notifies automatically. Supports wildcard filters to silence specific commands. | `eval "$(telert hook -l 30)"` |
|
|
406
406
|
| **Monitor** | Watches processes, log files, and network endpoints. | `telert monitor process --name "nginx" --notify-on stop` |
|
|
407
407
|
| **Send** | Low-level "send arbitrary text" helper. | `telert send --provider slack "Build complete"` |
|
|
408
408
|
| **Python API** | Use directly in Python code with context managers and decorators. | `from telert import telert, send, notify` |
|
|
@@ -593,6 +593,28 @@ echo 'eval "$(telert hook -l 30)"' >> ~/.bashrc
|
|
|
593
593
|
echo 'eval "$(telert hook -l 30)"' >> ~/.zshrc
|
|
594
594
|
```
|
|
595
595
|
|
|
596
|
+
**Filtering hook messages:**
|
|
597
|
+
|
|
598
|
+
You can silence notifications for specific commands using wildcard patterns:
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
# Add filters to silence common commands
|
|
602
|
+
telert hook-filter add "cd *" # Silence all cd commands with arguments
|
|
603
|
+
telert hook-filter add "ls*" # Silence ls, lsof, lsblk, etc.
|
|
604
|
+
telert hook-filter add "git status" # Silence exact command
|
|
605
|
+
|
|
606
|
+
# List configured filters
|
|
607
|
+
telert hook-filter list
|
|
608
|
+
|
|
609
|
+
# Remove a filter
|
|
610
|
+
telert hook-filter remove "ls*"
|
|
611
|
+
|
|
612
|
+
# Clear all filters
|
|
613
|
+
telert hook-filter clear
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
Filters use shell-style wildcards: `*` matches any sequence, `?` matches any single character, `[seq]` matches any character in seq.
|
|
617
|
+
|
|
596
618
|
#### CLI Help
|
|
597
619
|
```bash
|
|
598
620
|
# View all available commands
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|