tmail-cli 0.1.0__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.
- tmail_cli-0.1.0/.gitattributes +18 -0
- tmail_cli-0.1.0/.gitignore +25 -0
- tmail_cli-0.1.0/CODE_OF_CONDUCT.md +54 -0
- tmail_cli-0.1.0/CONTRIBUTING.md +29 -0
- tmail_cli-0.1.0/LICENSE +21 -0
- tmail_cli-0.1.0/PKG-INFO +66 -0
- tmail_cli-0.1.0/README.md +53 -0
- tmail_cli-0.1.0/SECURITY.md +7 -0
- tmail_cli-0.1.0/docs/development.md +208 -0
- tmail_cli-0.1.0/docs/guide.md +169 -0
- tmail_cli-0.1.0/pyproject.toml +23 -0
- tmail_cli-0.1.0/requirements.txt +1 -0
- tmail_cli-0.1.0/src/tmail/__init__.py +0 -0
- tmail_cli-0.1.0/src/tmail/__main__.py +3 -0
- tmail_cli-0.1.0/src/tmail/api.py +36 -0
- tmail_cli-0.1.0/src/tmail/cli.py +546 -0
- tmail_cli-0.1.0/src/tmail/storage.py +149 -0
- tmail_cli-0.1.0/src/tmail/ui.py +193 -0
- tmail_cli-0.1.0/tests/__init__.py +0 -0
- tmail_cli-0.1.0/uv.lock +230 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Runtime data
|
|
2
|
+
.tmail_data/
|
|
3
|
+
|
|
4
|
+
# Python
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*.egg-info/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.egg
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
env/
|
|
14
|
+
|
|
15
|
+
# Agent / plan files
|
|
16
|
+
AGENTS.md
|
|
17
|
+
PLAN.md
|
|
18
|
+
|
|
19
|
+
# IDE
|
|
20
|
+
.vscode/
|
|
21
|
+
.idea/
|
|
22
|
+
*.swp
|
|
23
|
+
*.swo
|
|
24
|
+
*~
|
|
25
|
+
.DS_Store
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders of the tmail community pledge to
|
|
6
|
+
make participation in our project a harassment-free experience for everyone,
|
|
7
|
+
regardless of age, body size, visible or invisible disability, ethnicity, sex
|
|
8
|
+
characteristics, gender identity and expression, level of experience,
|
|
9
|
+
education, socio-economic status, nationality, personal appearance, race,
|
|
10
|
+
religion, or sexual identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment:
|
|
18
|
+
|
|
19
|
+
* Demonstrating empathy and kindness toward other people
|
|
20
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
+
* Giving and gracefully accepting constructive feedback
|
|
22
|
+
* Accepting responsibility and apologizing to those affected by our mistakes
|
|
23
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
24
|
+
|
|
25
|
+
Examples of unacceptable behavior:
|
|
26
|
+
|
|
27
|
+
* The use of sexualized language or imagery, and sexual attention or advances
|
|
28
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
29
|
+
* Public or private harassment
|
|
30
|
+
* Publishing others' private information without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
32
|
+
|
|
33
|
+
## Enforcement Responsibilities
|
|
34
|
+
|
|
35
|
+
Project maintainers are responsible for clarifying and enforcing our standards.
|
|
36
|
+
|
|
37
|
+
## Scope
|
|
38
|
+
|
|
39
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
40
|
+
an individual is officially representing the community in public spaces.
|
|
41
|
+
|
|
42
|
+
## Enforcement
|
|
43
|
+
|
|
44
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
45
|
+
reported to the project maintainer. All complaints will be reviewed and
|
|
46
|
+
investigated promptly and fairly.
|
|
47
|
+
|
|
48
|
+
## Attribution
|
|
49
|
+
|
|
50
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
51
|
+
version 2.1, available at
|
|
52
|
+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
|
|
53
|
+
|
|
54
|
+
[homepage]: https://www.contributor-covenant.org
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to tmail.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/rkriad585/tmail.git
|
|
9
|
+
cd tmail
|
|
10
|
+
pip install uv
|
|
11
|
+
uv sync
|
|
12
|
+
tmail
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
See the [Development Guide](docs/development.md) for architecture, code
|
|
18
|
+
examples, and guidance on adding features.
|
|
19
|
+
|
|
20
|
+
## Guidelines
|
|
21
|
+
|
|
22
|
+
- Follow the existing code style in the module you're editing.
|
|
23
|
+
- No test framework is configured yet — test manually with `uv run tmail`.
|
|
24
|
+
- Update docs if adding or changing user-facing features.
|
|
25
|
+
|
|
26
|
+
## Pull requests
|
|
27
|
+
|
|
28
|
+
- Open an issue first to discuss significant changes.
|
|
29
|
+
- Keep PRs focused on a single concern.
|
tmail_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 rkriad585
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tmail_cli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tmail-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI tool for generating temporary email addresses and viewing inboxes
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: pyfiglet
|
|
9
|
+
Requires-Dist: pyperclip
|
|
10
|
+
Requires-Dist: requests
|
|
11
|
+
Requires-Dist: rich
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<img src="https://img.shields.io/badge/tmail-v0.1.0-blue" alt="version">
|
|
16
|
+
<img src="https://img.shields.io/badge/python-%3E%3D3.10-green" alt="python">
|
|
17
|
+
<img src="https://img.shields.io/badge/license-MIT-yellow" alt="license">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<h1 align="center">📧 tmail</h1>
|
|
21
|
+
<p align="center"><em>Disposable email addresses, right from your terminal.</em></p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
tmail is a lightweight CLI tool that generates temporary email addresses
|
|
26
|
+
and live-polls their inbox. Built with Python and [Rich](https://github.com/Textualize/rich).
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install uv
|
|
32
|
+
uv tool install tmail
|
|
33
|
+
tmail # interactive TUI
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## CLI flags
|
|
37
|
+
|
|
38
|
+
| Command | Description |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `tmail` | Open the interactive TUI menu |
|
|
41
|
+
| `tmail -g` | Generate a new email, print it, copy to clipboard |
|
|
42
|
+
| `tmail -g -w` | Generate and immediately watch the new inbox |
|
|
43
|
+
| `tmail -g -i` | Generate and fetch inbox once (one-shot) |
|
|
44
|
+
| `tmail -l` | List saved emails with unread counts |
|
|
45
|
+
| `tmail -i <email>` | Fetch inbox once (plain text, good for scripts) |
|
|
46
|
+
| `tmail -w <email>` | Live-poll inbox (plain text, Ctrl+C to stop) |
|
|
47
|
+
| `tmail -d <email>` | Delete an email from history |
|
|
48
|
+
| `tmail -n <seconds>` | Set poll interval |
|
|
49
|
+
| `tmail -c` | Clear all stored data |
|
|
50
|
+
| `tmail -V` | Show version |
|
|
51
|
+
| `tmail -h` | Show help |
|
|
52
|
+
|
|
53
|
+
## Documentation
|
|
54
|
+
|
|
55
|
+
| Doc | What's inside |
|
|
56
|
+
|---|---|
|
|
57
|
+
| [User Guide](docs/guide.md) | Full feature walkthrough, menu reference, settings, clipboard, attachments |
|
|
58
|
+
| [Development Guide](docs/development.md) | Architecture, module breakdown, code examples, adding features |
|
|
59
|
+
|
|
60
|
+
## Data
|
|
61
|
+
|
|
62
|
+
All data is stored in `.tmail_data/` as JSON files — no database required.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/badge/tmail-v0.1.0-blue" alt="version">
|
|
3
|
+
<img src="https://img.shields.io/badge/python-%3E%3D3.10-green" alt="python">
|
|
4
|
+
<img src="https://img.shields.io/badge/license-MIT-yellow" alt="license">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<h1 align="center">📧 tmail</h1>
|
|
8
|
+
<p align="center"><em>Disposable email addresses, right from your terminal.</em></p>
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
tmail is a lightweight CLI tool that generates temporary email addresses
|
|
13
|
+
and live-polls their inbox. Built with Python and [Rich](https://github.com/Textualize/rich).
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install uv
|
|
19
|
+
uv tool install tmail
|
|
20
|
+
tmail # interactive TUI
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## CLI flags
|
|
24
|
+
|
|
25
|
+
| Command | Description |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `tmail` | Open the interactive TUI menu |
|
|
28
|
+
| `tmail -g` | Generate a new email, print it, copy to clipboard |
|
|
29
|
+
| `tmail -g -w` | Generate and immediately watch the new inbox |
|
|
30
|
+
| `tmail -g -i` | Generate and fetch inbox once (one-shot) |
|
|
31
|
+
| `tmail -l` | List saved emails with unread counts |
|
|
32
|
+
| `tmail -i <email>` | Fetch inbox once (plain text, good for scripts) |
|
|
33
|
+
| `tmail -w <email>` | Live-poll inbox (plain text, Ctrl+C to stop) |
|
|
34
|
+
| `tmail -d <email>` | Delete an email from history |
|
|
35
|
+
| `tmail -n <seconds>` | Set poll interval |
|
|
36
|
+
| `tmail -c` | Clear all stored data |
|
|
37
|
+
| `tmail -V` | Show version |
|
|
38
|
+
| `tmail -h` | Show help |
|
|
39
|
+
|
|
40
|
+
## Documentation
|
|
41
|
+
|
|
42
|
+
| Doc | What's inside |
|
|
43
|
+
|---|---|
|
|
44
|
+
| [User Guide](docs/guide.md) | Full feature walkthrough, menu reference, settings, clipboard, attachments |
|
|
45
|
+
| [Development Guide](docs/development.md) | Architecture, module breakdown, code examples, adding features |
|
|
46
|
+
|
|
47
|
+
## Data
|
|
48
|
+
|
|
49
|
+
All data is stored in `.tmail_data/` as JSON files — no database required.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# tmail Development Guide
|
|
2
|
+
|
|
3
|
+
## Project structure
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
src/tmail/
|
|
7
|
+
├── __init__.py # Package marker (empty)
|
|
8
|
+
├── __main__.py # python -m tmail support
|
|
9
|
+
├── api.py # HTTP client for temp-mail.io
|
|
10
|
+
├── cli.py # Entry point, menu loop, orchestration
|
|
11
|
+
├── storage.py # JSON file persistence
|
|
12
|
+
└── ui.py # Rich TUI components
|
|
13
|
+
tests/
|
|
14
|
+
└── __init__.py
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Module responsibilities
|
|
18
|
+
|
|
19
|
+
### api.py — HTTP client
|
|
20
|
+
|
|
21
|
+
Pure functions that call the temp-mail.io API. No UI, no state.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from tmail.api import get_random_email, fetch_messages, download_attachment
|
|
25
|
+
|
|
26
|
+
email = get_random_email()
|
|
27
|
+
messages = fetch_messages(email)
|
|
28
|
+
download_attachment("att_id", Path("/tmp/file.pdf"))
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Endpoints:
|
|
32
|
+
|
|
33
|
+
| Function | Method | Endpoint |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `get_random_email()` | POST | `/api/v3/email/new` |
|
|
36
|
+
| `fetch_messages(email)` | GET | `/api/v3/email/{email}/messages` |
|
|
37
|
+
| `get_attachment_url(id)` | — | returns URL string |
|
|
38
|
+
| `download_attachment(id, path)` | GET (stream) | `/api/v3/attachment/{id}?download=1` |
|
|
39
|
+
|
|
40
|
+
### storage.py — persistence
|
|
41
|
+
|
|
42
|
+
Read/write JSON files in `.tmail_data/`. Every function is self-contained
|
|
43
|
+
(calls `DATA_DIR.mkdir` when needed).
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from tmail.storage import save_email, get_old_emails, delete_email
|
|
47
|
+
|
|
48
|
+
save_email("foo@example.com")
|
|
49
|
+
emails = get_old_emails()
|
|
50
|
+
deleted = delete_email("foo@example.com")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Config:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from tmail.storage import load_config, save_config
|
|
57
|
+
|
|
58
|
+
cfg = load_config() # {"poll_interval": 5}
|
|
59
|
+
save_config({"poll_interval": 3})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Unread tracking:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from tmail.storage import save_unread_count, get_unread_counts, clear_unread_count
|
|
66
|
+
|
|
67
|
+
save_unread_count("foo@example.com", 3)
|
|
68
|
+
counts = get_unread_counts() # {"foo@example.com": 3}
|
|
69
|
+
clear_unread_count("foo@example.com")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### ui.py — rendering
|
|
73
|
+
|
|
74
|
+
Thin wrappers around Rich that format output. No logic, no API calls.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from tmail.ui import console, show_logo, show_success, show_error, build_inbox_table
|
|
78
|
+
|
|
79
|
+
show_logo()
|
|
80
|
+
show_success("Email created")
|
|
81
|
+
table, has_new, count = build_inbox_table(messages, seen_ids, get_attachment_url)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Key components:
|
|
85
|
+
|
|
86
|
+
- `show_logo()` — pyfiglet banner + welcome panel
|
|
87
|
+
- `build_inbox_table()` — returns `(Table, has_new, new_count)`
|
|
88
|
+
- `show_full_message(msg)` — Panel with full body text
|
|
89
|
+
- `show_messages_selection(messages)` — indexed table for picking a message
|
|
90
|
+
- `get_email_actions_panel(email)` — returns the action submenu Panel
|
|
91
|
+
- `get_main_menu_panel()` — returns the main menu Panel
|
|
92
|
+
- `get_settings_panel(interval)` — returns the settings Panel
|
|
93
|
+
|
|
94
|
+
### cli.py — orchestration
|
|
95
|
+
|
|
96
|
+
Wires api/storage/ui together. Contains the main loop, inbox poller, all
|
|
97
|
+
submenus, and CLI flag handling via `argparse`. This is the entry point
|
|
98
|
+
(`tmail.cli:main`).
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from tmail.cli import main
|
|
102
|
+
|
|
103
|
+
main() # parses sys.argv, dispatches flags or starts TUI
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Flow:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
main() → argparse → --generate / --list / --inbox / --watch / ...
|
|
110
|
+
↘ main_menu() → email actions → display_inbox()
|
|
111
|
+
↘ settings_menu()
|
|
112
|
+
↘ delete_email_saved()
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
CLI flags are defined in `main()` using `argparse.ArgumentParser`. Each
|
|
116
|
+
flag calls the same core functions from api/storage/ui but uses plain
|
|
117
|
+
`print()` instead of Rich widgets so output works in pipes and scripts.
|
|
118
|
+
|
|
119
|
+
Non-interactive helpers:
|
|
120
|
+
|
|
121
|
+
| Function | Used by |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `_print_messages_plain(messages)` | `--inbox`, `--watch` |
|
|
124
|
+
| `_copy_silent(text)` | `--generate` |
|
|
125
|
+
| (inline handlers) | `--list`, `--delete`, `--interval`, `--clear`, `--version` |
|
|
126
|
+
|
|
127
|
+
## Adding a new menu option
|
|
128
|
+
|
|
129
|
+
1. Add the label to `get_main_menu_panel()` in `ui.py`
|
|
130
|
+
2. Add a handler function in `cli.py`
|
|
131
|
+
3. Wire the choice in `main_menu()` switch
|
|
132
|
+
|
|
133
|
+
Example — adding a "Show Version" option:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
# ui.py — add to panel
|
|
137
|
+
"[5] Show Version\n"
|
|
138
|
+
"[6] Remove All Old Mail's Data\n"
|
|
139
|
+
"[7] Settings\n"
|
|
140
|
+
"[8] Exit",
|
|
141
|
+
|
|
142
|
+
# cli.py — add handler
|
|
143
|
+
def show_version():
|
|
144
|
+
console.print("[bold]tmail v0.1.0[/bold]")
|
|
145
|
+
wait_for_enter()
|
|
146
|
+
|
|
147
|
+
# cli.py — wire in main_menu
|
|
148
|
+
elif choice == "5":
|
|
149
|
+
show_version()
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Adding a new email action
|
|
153
|
+
|
|
154
|
+
1. Add the label to `get_email_actions_panel()` in `ui.py`
|
|
155
|
+
2. Add a handler in `cli.py`
|
|
156
|
+
3. Wire the choice in `email_actions_menu()`
|
|
157
|
+
|
|
158
|
+
## Testing
|
|
159
|
+
|
|
160
|
+
No test framework is configured. To test manually:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
uv run tmail
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Or import and call individual modules:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
uv run python -c "
|
|
170
|
+
from tmail.api import get_random_email
|
|
171
|
+
print(get_random_email())
|
|
172
|
+
"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Dependencies
|
|
176
|
+
|
|
177
|
+
| Package | Purpose |
|
|
178
|
+
|---|---|
|
|
179
|
+
| `requests` | HTTP client for temp-mail.io API |
|
|
180
|
+
| `rich` | Terminal UI (tables, panels, live view, prompts) |
|
|
181
|
+
| `pyfiglet` | ASCII art banner |
|
|
182
|
+
| `pyperclip` | Clipboard copy (cross-platform) |
|
|
183
|
+
|
|
184
|
+
## Data format reference
|
|
185
|
+
|
|
186
|
+
### old_mails.json
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
["abc@tempmail.com", "def@tempmail.com"]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### seen_mails.json
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
["msg-uuid-1", "msg-uuid-2"]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### config.json
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{"poll_interval": 5}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### unread.json
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{"abc@tempmail.com": 3}
|
|
208
|
+
```
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# tmail User Guide
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install uv
|
|
7
|
+
uv tool install tmail
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Or from source:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git clone https://github.com/rkriad585/tmail.git
|
|
14
|
+
cd tmail
|
|
15
|
+
pip install uv
|
|
16
|
+
uv sync
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
tmail # interactive TUI
|
|
23
|
+
tmail -g # generate email, print, copy to clipboard
|
|
24
|
+
tmail -i foo@example.com # one-shot inbox check
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Press **1** from the TUI to generate a new random email and watch mail
|
|
28
|
+
arrive in real time. Press **Ctrl+C** to return to the email action menu.
|
|
29
|
+
|
|
30
|
+
## CLI flags
|
|
31
|
+
|
|
32
|
+
tmail supports non-interative flags for scripting and quick operations:
|
|
33
|
+
|
|
34
|
+
| Command | Description |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `tmail -g` | Generate a new email, print it, copy to clipboard, exit |
|
|
37
|
+
| `tmail -g -w` | Generate and immediately watch the inbox (plain text) |
|
|
38
|
+
| `tmail -g -i` | Generate and fetch inbox once (one-shot) |
|
|
39
|
+
| `tmail -l` | List all saved emails with unread counts, exit |
|
|
40
|
+
| `tmail -i EMAIL` | Fetch inbox once, print messages as plain text, exit |
|
|
41
|
+
| `tmail -w EMAIL` | Live-poll inbox in plain-text mode, Ctrl+C to stop |
|
|
42
|
+
| `tmail -d EMAIL` | Delete a specific email from history, exit |
|
|
43
|
+
| `tmail -n SECONDS` | Set the poll interval in seconds, exit |
|
|
44
|
+
| `tmail -c` | Clear all stored data, exit |
|
|
45
|
+
| `tmail -V` | Show version and exit |
|
|
46
|
+
| `tmail -h` | Show help message and exit |
|
|
47
|
+
|
|
48
|
+
The `-i` and `-w` flags accept an optional EMAIL argument. When used
|
|
49
|
+
without an argument together with `-g`, they use the newly generated
|
|
50
|
+
address automatically.
|
|
51
|
+
|
|
52
|
+
### --inbox example
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
tmail -i abc123@tempmail.com
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Output:
|
|
59
|
+
```
|
|
60
|
+
--- Message 1 ---
|
|
61
|
+
From: sender@example.com
|
|
62
|
+
To: abc123@tempmail.com
|
|
63
|
+
Subject: Welcome!
|
|
64
|
+
Body: Thank you for signing up...
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### --watch example
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
tmail -w abc123@tempmail.com
|
|
71
|
+
Watching abc123@tempmail.com (poll every 5s, Ctrl+C to stop)...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
New messages are printed as they arrive. Useful for tail-like monitoring
|
|
75
|
+
without the Rich TUI.
|
|
76
|
+
|
|
77
|
+
## Main menu
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
╭───────────────────────────── Choose Your Option ─────────────────────────────╮
|
|
81
|
+
│ [1] Generate Random Mail │
|
|
82
|
+
│ [2] See Mails You Created │
|
|
83
|
+
│ [3] Log In To Old Mails │
|
|
84
|
+
│ [4] Delete Email From History │
|
|
85
|
+
│ [5] Remove All Old Mail's Data │
|
|
86
|
+
│ [6] Settings │
|
|
87
|
+
│ [7] Exit │
|
|
88
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| Option | Description |
|
|
92
|
+
|---|---|
|
|
93
|
+
| **1** | Generate a new disposable email address and open its inbox |
|
|
94
|
+
| **2** | List every address you have generated (shows unread counts) |
|
|
95
|
+
| **3** | Re-open the inbox of a previously created address |
|
|
96
|
+
| **4** | Select and delete a specific email from history |
|
|
97
|
+
| **5** | Wipe all stored data (history, seen IDs, config, unread counts) |
|
|
98
|
+
| **6** | Change the inbox polling interval |
|
|
99
|
+
| **7** | Exit |
|
|
100
|
+
|
|
101
|
+
## Email action submenu
|
|
102
|
+
|
|
103
|
+
After exiting an inbox (Ctrl+C), you return to this submenu:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
╭───────────────────────────── Email: xxxxx@xxxxx.xx ──────────────────────────╮
|
|
107
|
+
│ [1] View Inbox (live) │
|
|
108
|
+
│ [2] View Full Message │
|
|
109
|
+
│ [3] Download Attachments │
|
|
110
|
+
│ [4] Copy Email Address │
|
|
111
|
+
│ [5] Delete This Email │
|
|
112
|
+
│ [6] Back to Main Menu │
|
|
113
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| Option | Description |
|
|
117
|
+
|---|---|
|
|
118
|
+
| **1** | Re-enter the live inbox poller |
|
|
119
|
+
| **2** | List messages by index, pick one to read the full body |
|
|
120
|
+
| **3** | List messages with attachments, pick one to download all files |
|
|
121
|
+
| **4** | Copy the email address to your clipboard |
|
|
122
|
+
| **5** | Remove this email from history |
|
|
123
|
+
| **6** | Return to the main menu |
|
|
124
|
+
|
|
125
|
+
## Inbox polling
|
|
126
|
+
|
|
127
|
+
The inbox refreshes every N seconds (default 5). Only new messages trigger a
|
|
128
|
+
screen update — the terminal stays quiet between polls. Configure the interval
|
|
129
|
+
in **Settings** (option 6).
|
|
130
|
+
|
|
131
|
+
## Settings
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
╭────────────────────────────────── Settings ──────────────────────────────────╮
|
|
135
|
+
│ Poll interval: 5s │
|
|
136
|
+
│ │
|
|
137
|
+
│ [1] Change Poll Interval │
|
|
138
|
+
│ [2] Back to Main Menu │
|
|
139
|
+
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Choose **1** to enter a new interval in seconds (minimum 1).
|
|
143
|
+
|
|
144
|
+
## Clipboard
|
|
145
|
+
|
|
146
|
+
Option **4** in the email action submenu copies the email address to your
|
|
147
|
+
clipboard. On Linux, one of these must be installed:
|
|
148
|
+
|
|
149
|
+
- **X11:** `sudo apt install xclip` or `xsel`
|
|
150
|
+
- **Wayland:** `sudo apt install wl-clipboard`
|
|
151
|
+
|
|
152
|
+
Windows and macOS work out of the box.
|
|
153
|
+
|
|
154
|
+
## Attachments
|
|
155
|
+
|
|
156
|
+
Option **3** in the email action submenu lists messages that have attachments.
|
|
157
|
+
Pick one and all its files are downloaded to `.tmail_data/attachments/<email>/`.
|
|
158
|
+
|
|
159
|
+
## Data files
|
|
160
|
+
|
|
161
|
+
All data is stored in `.tmail_data/`:
|
|
162
|
+
|
|
163
|
+
| File | Purpose |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `old_mails.json` | List of generated email addresses |
|
|
166
|
+
| `seen_mails.json` | IDs of messages already displayed |
|
|
167
|
+
| `config.json` | User settings (poll interval) |
|
|
168
|
+
| `unread.json` | Per-email unread message counts |
|
|
169
|
+
| `attachments/` | Downloaded attachment files |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tmail-cli"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "CLI tool for generating temporary email addresses and viewing inboxes"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = { text = "MIT" }
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"requests",
|
|
10
|
+
"rich",
|
|
11
|
+
"pyfiglet",
|
|
12
|
+
"pyperclip",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[project.scripts]
|
|
16
|
+
tmail = "tmail.cli:main"
|
|
17
|
+
|
|
18
|
+
[tool.hatch.build.targets.wheel]
|
|
19
|
+
packages = ["src/tmail"]
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["hatchling"]
|
|
23
|
+
build-backend = "hatchling.build"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.
|
|
File without changes
|