news-tui 1.0.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 +115 -0
- package/dist/index.js +1068 -0
- package/news-tui.js +2 -0
- package/package.json +33 -0
- package/src/App.tsx +258 -0
- package/src/blessed.d.ts +37 -0
- package/src/components/ArticleList.tsx +51 -0
- package/src/components/BloombergView.tsx +132 -0
- package/src/components/CategoryTabs.tsx +26 -0
- package/src/components/HelpOverlay.tsx +57 -0
- package/src/components/PreviewPane.tsx +70 -0
- package/src/components/SourceSidebar.tsx +65 -0
- package/src/components/StatusBar.tsx +38 -0
- package/src/index.tsx +29 -0
- package/src/lib/bookmarks.ts +42 -0
- package/src/lib/feeds.ts +164 -0
- package/src/lib/image.ts +116 -0
- package/src/lib/theme.ts +121 -0
- package/src/vendor/react-tui.d.ts +5 -0
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# ๐ฐ News TUI
|
|
2
|
+
|
|
3
|
+
Interactive terminal news browser powered by React and neo-blessed.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
7
|
+
โ 1:ALL 2:NEWS 3:TECH 4:BLOGS 5:HN โ Ready โ
|
|
8
|
+
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
9
|
+
โ Sources โ Articles โ
|
|
10
|
+
โ โธ BBC โ 1. Breaking: Major Event Unfolds โ
|
|
11
|
+
โ TOI โ BBC ยท 2h ago โ
|
|
12
|
+
โ OpenAI โ 2. New AI Model Released โ
|
|
13
|
+
โ GitHub โ OpenAI ยท 5h ago โ
|
|
14
|
+
โ HN โ 3. Show HN: My Side Project โ
|
|
15
|
+
โ โ Hacker News ยท 1d ago โ
|
|
16
|
+
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
17
|
+
โ โ Preview โ
|
|
18
|
+
โ โ Article summary text appears here... โ
|
|
19
|
+
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
20
|
+
โ j/k:Nav Tab:Focus Enter:Open /:Search i:Image q:Quit โ
|
|
21
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## โจ Features
|
|
25
|
+
|
|
26
|
+
- **Multi-pane layout** โ sources sidebar, article list, scrollable preview pane
|
|
27
|
+
- **Bloomberg Terminal view** โ press `v` for dense 4-quadrant layout with scrolling ticker
|
|
28
|
+
- **4 color themes** โ Default, Bloomberg (orange/amber), Hacker (green), Dracula (purple) โ cycle with `t`
|
|
29
|
+
- **12 built-in feeds** across 4 categories (tech / news / blogs / hn)
|
|
30
|
+
- **Vim-style navigation** โ `j`/`k`, arrow keys, Tab cycles Articles โ Sources โ Preview
|
|
31
|
+
- **Live search** โ press `/` to filter articles in real-time
|
|
32
|
+
- **Bookmarks** โ `b` to save, persisted to `~/.newsbookmarks.json`
|
|
33
|
+
- **Inline image viewing** โ press `i` to view article images directly in terminal (iTerm2, Kitty, chafa, timg)
|
|
34
|
+
- **Open in browser** โ `Enter` or `o` to launch article URL
|
|
35
|
+
- **Auto-refresh** โ feeds refresh every 5 minutes, or press `r`
|
|
36
|
+
- **Sort cycling** โ press `s` to cycle between time / source / title
|
|
37
|
+
- **Color-coded sources** โ each source gets a distinct color
|
|
38
|
+
- **Relative timestamps** โ "2h ago", "1d ago" style dates
|
|
39
|
+
- **Focus indicators** โ `โ` shows which pane is active, highlighted borders
|
|
40
|
+
|
|
41
|
+
## ๐ Install
|
|
42
|
+
|
|
43
|
+
### One-liner (bunx โ no install needed)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
bunx news-tui
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Global install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
bun install -g news-tui
|
|
53
|
+
news-tui
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Clone & run locally
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/yashness/news-tui.git
|
|
60
|
+
cd news-tui
|
|
61
|
+
bun install
|
|
62
|
+
bun start
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## โจ๏ธ Keyboard Shortcuts
|
|
66
|
+
|
|
67
|
+
| Key | Action |
|
|
68
|
+
|-----|--------|
|
|
69
|
+
| `j` / `โ` | Next article |
|
|
70
|
+
| `k` / `โ` | Previous article |
|
|
71
|
+
| `Tab` | Cycle focus: Articles โ Sources โ Preview |
|
|
72
|
+
| `1`-`5` | Switch category (all/news/tech/blogs/hn) |
|
|
73
|
+
| `Enter` / `o` | Open article in browser |
|
|
74
|
+
| `c` | Open comments in browser (HN) |
|
|
75
|
+
| `/` | Search / filter articles |
|
|
76
|
+
| `Escape` | Clear search |
|
|
77
|
+
| `b` | Bookmark current article |
|
|
78
|
+
| `i` | View article image inline |
|
|
79
|
+
| `r` | Refresh feeds |
|
|
80
|
+
| `s` | Cycle sort (time โ source โ title) |
|
|
81
|
+
| `t` | Cycle theme (default โ bloomberg โ hacker โ dracula) |
|
|
82
|
+
| `v` | Toggle Bloomberg terminal view |
|
|
83
|
+
| `?` | Show help overlay |
|
|
84
|
+
| `q` / `Ctrl-C` | Quit |
|
|
85
|
+
|
|
86
|
+
## ๐ก Built-in Sources
|
|
87
|
+
|
|
88
|
+
| Category | Sources |
|
|
89
|
+
|----------|---------|
|
|
90
|
+
| **News** | BBC, Times of India |
|
|
91
|
+
| **Tech** | Facebook Eng, Google AI, Netflix, LinkedIn Eng, OpenAI, Spotify Eng, GitHub, Anthropic |
|
|
92
|
+
| **Blogs** | WoodFromEden |
|
|
93
|
+
| **HN** | Hacker News (with top comments from HN API) |
|
|
94
|
+
|
|
95
|
+
## โ Custom Sources
|
|
96
|
+
|
|
97
|
+
Add your own RSS feeds by creating `~/.newsources.json`:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
[
|
|
101
|
+
{ "name": "Ars Technica", "url": "https://feeds.arstechnica.com/arstechnica/index", "category": "tech" },
|
|
102
|
+
{ "name": "The Verge", "url": "https://www.theverge.com/rss/index.xml", "category": "news" }
|
|
103
|
+
]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Use any category name โ new categories auto-appear as tabs (6, 7, etc).
|
|
107
|
+
|
|
108
|
+
## ๐ ๏ธ Requirements
|
|
109
|
+
|
|
110
|
+
- **Bun** โฅ 1.0
|
|
111
|
+
- A terminal with Unicode support (iTerm2, Alacritty, Kitty, etc.)
|
|
112
|
+
|
|
113
|
+
## ๐ License
|
|
114
|
+
|
|
115
|
+
MIT
|