@khemsok/tunl 0.1.0
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.
- package/README.md +86 -0
- package/dist/cli.js +57110 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# tunl
|
|
2
|
+
|
|
3
|
+
Terminal focus timer that blocks distracting websites and progressively reveals animated ASCII art the longer you stay focused.
|
|
4
|
+
|
|
5
|
+
Enter the tunnel. Block everything out.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Requires [Bun](https://bun.sh).
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun add -g @khemsok/tunl
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then just run `tunl` from anywhere.
|
|
16
|
+
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
1. Blocks distracting websites (twitter, reddit, youtube, etc.) by modifying `/etc/hosts`
|
|
20
|
+
2. Starts a countdown timer
|
|
21
|
+
3. Progressively reveals animated ASCII art as you stay focused
|
|
22
|
+
4. Unblocks everything when the session ends
|
|
23
|
+
|
|
24
|
+
## Art Themes
|
|
25
|
+
|
|
26
|
+
Three animated themes that evolve in real-time:
|
|
27
|
+
|
|
28
|
+
- **City Skyline** — buildings rise, windows flicker on, moon glows, stars twinkle, shooting stars streak across, clouds drift
|
|
29
|
+
- **Forest** — trees grow from trunks to full canopy, sun rises with rays, birds fly, butterflies flutter, flowers bloom
|
|
30
|
+
- **Space** — stars fill the void, planet forms with rings, nebula swirls, rocket builds and launches with animated fire, comets streak past
|
|
31
|
+
|
|
32
|
+
The art is procedurally generated and animated every 800ms — stars twinkle, windows flicker, neon signs pulse. Nothing is static.
|
|
33
|
+
|
|
34
|
+
## Controls
|
|
35
|
+
|
|
36
|
+
| Key | Action |
|
|
37
|
+
|-----|--------|
|
|
38
|
+
| `space` | Start / pause / resume |
|
|
39
|
+
| `r` | Stop session (back to idle) |
|
|
40
|
+
| `q` | Quit app |
|
|
41
|
+
| `+/-` | Adjust time by 5 min (before starting) |
|
|
42
|
+
| `s` | Edit blocked sites |
|
|
43
|
+
| `t` | Change art theme |
|
|
44
|
+
| `Ctrl+C` | Quit from any screen |
|
|
45
|
+
|
|
46
|
+
## CLI Flags
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
tunl # start with saved preferences
|
|
50
|
+
tunl --duration 45 # 45 minute session
|
|
51
|
+
tunl --block "site.com" # add extra sites to block
|
|
52
|
+
tunl --sites "a.com,b.com" # set the full blocklist
|
|
53
|
+
tunl --noblock # timer + art only, no blocking
|
|
54
|
+
tunl --config # show saved config
|
|
55
|
+
tunl --reset # reset config, re-run onboarding
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## How blocking works
|
|
59
|
+
|
|
60
|
+
tunl appends entries to `/etc/hosts` mapping blocked domains to `127.0.0.1`. This requires sudo access — you'll be prompted before the timer starts.
|
|
61
|
+
|
|
62
|
+
Sites are unblocked when:
|
|
63
|
+
- The session completes
|
|
64
|
+
- You stop the session with `r`
|
|
65
|
+
- You quit with `q` or `Ctrl+C`
|
|
66
|
+
- If the process crashes, the next run detects stale entries and cleans up
|
|
67
|
+
|
|
68
|
+
**Note:** If your browser uses DNS-over-HTTPS (Chrome, Arc, Firefox), you need to disable it for blocking to work:
|
|
69
|
+
- **Chrome/Arc:** `chrome://settings/security` or `arc://settings/privacy` → turn off "Use secure DNS"
|
|
70
|
+
- **Firefox:** Settings → Privacy & Security → DNS over HTTPS → Off
|
|
71
|
+
- **Safari:** Works by default
|
|
72
|
+
|
|
73
|
+
## Config
|
|
74
|
+
|
|
75
|
+
Preferences are saved to `~/.tunl.json` after first run. Edit with `tunl --config` to view, `tunl --reset` to start fresh, or press `s`/`t` in the app.
|
|
76
|
+
|
|
77
|
+
## Tech Stack
|
|
78
|
+
|
|
79
|
+
- **Runtime:** Bun
|
|
80
|
+
- **Language:** TypeScript
|
|
81
|
+
- **TUI Framework:** @opentui/react
|
|
82
|
+
- **Art:** Procedurally generated, animated every 800ms
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|