readshell 0.1.0 → 0.2.1
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 +76 -64
- package/dist/index.js +349 -53
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,128 +1,140 @@
|
|
|
1
|
+
[English](README.md) | [中文](README_zh.md)
|
|
2
|
+
|
|
1
3
|
# ReadShell
|
|
2
4
|
|
|
3
|
-
>
|
|
5
|
+
> CLI Light Reading Tool for Developers
|
|
4
6
|
|
|
5
7
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
6
8
|
[](https://nodejs.org)
|
|
7
9
|
|
|
8
10
|
---
|
|
9
11
|
|
|
10
|
-
## 🎯
|
|
12
|
+
## 🎯 Why ReadShell?
|
|
11
13
|
|
|
12
|
-
ReadShell
|
|
14
|
+
ReadShell is not designed for "when you have no screens to read on", but rather:
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
**During coding breaks, you need a quick reading escape that won't drag you out of your workflow.**
|
|
15
17
|
|
|
16
|
-
|
|
|
18
|
+
| Alternatives | The Problem |
|
|
17
19
|
|---|---|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
| **ReadShell** |
|
|
20
|
+
| Scrolling Social Media | Hard to stop; 10 minutes turns into 40 minutes. |
|
|
21
|
+
| Web Browsing | Information overload hijacked by algorithms; hard to get back to work. |
|
|
22
|
+
| Desktop Apps / Kindle | Requires switching context, devices, or windows, breaking your flow. |
|
|
23
|
+
| **ReadShell** | **Rest where you are, recover your flow, never leave the terminal.** |
|
|
24
|
+
|
|
25
|
+
## 📈 Current MVP Progress (v0.1.0)
|
|
26
|
+
|
|
27
|
+
Our initial MVP goals are fully realized:
|
|
28
|
+
- **Core Format Support**: Native parsing for `.txt` plain text and `.epub` ebooks. Features intelligent pagination, dialogue highlighting, and smooth scrolling.
|
|
29
|
+
- **Immersion & Boss Key**: Original `Boss Key` (`b`/`Esc`) instantly disguises the reader as a standard terminal error log, saving your progress seamlessly.
|
|
30
|
+
- **Local Lightning-Fast Library**: A zero-dependency local data center built entirely on SQLite. Accurately remembers byte-offsets and silently saves your progress upon exiting.
|
|
31
|
+
- **Deep Flow Reading**: Features rapid bookmarks (`m` key) and localized Kindle-style "Time Left" estimations based on your reading speed.
|
|
32
|
+
- **Batch Folder Import**: Recursively scan and import entire folders of books at once.
|
|
33
|
+
- **I18n Support**: Native support for English and Chinese.
|
|
22
34
|
|
|
23
|
-
##
|
|
35
|
+
## 💡 The Philosophy (Developer's Monologue)
|
|
24
36
|
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- **沉浸与反侦查系统**:独创的 `Boss Key` (老板键 `b`/`Esc`),一键秒速伪装成标准的终端报错日志,深藏功与名。
|
|
28
|
-
- **本地极速书房**:基于 SQLite 构建的零依赖本地数据中心。能够精准记忆任何一本书的字节读取偏移量,并在你退出时默默保存进度。
|
|
29
|
-
- **深度时间流体验**:新增随时截取金句的快捷书签(`m` 键)以及基于你的本地 Buffer 实时演算的类 Kindle 阅读剩余时间预估。
|
|
37
|
+
### Why build a reader in the terminal?
|
|
38
|
+
As developers, the IDE and Terminal are our natural habitats. When we are waiting for a build, a pipeline to finish, or just experiencing a 5-10 minute mental block, we need a "spiritual refuge" that is easy to slip into and easy to drop out of.
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
Web browsers easily hijack your attention, and phones completely shatter your flow state. But the terminal—a pure, text-only monochrome environment—naturally carries a restrained sense of isolation.
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
作为一个开发者,IDE 和 Terminal 是我们日常最常驻的舒适区。当我们在编译等待、等待流水线构建或者单纯思维枯竭的 5 到 10 分钟里,常常需要一个能够**迅速切入又迅速抽离**的“精神避难所”。
|
|
35
|
-
刷网页容易被算法劫持,看手机更是会彻底打断心流进程。而终端——这个只有黑底白字、极度纯粹的环境,天生就带有一种克制的隔离感。
|
|
36
|
-
**ReadShell** 试图在这个极度克制的环境里,以最低的启动摩擦力给你提供一处可以随时下潜和浮出的文字世界。它不需要全屏的臃肿软件,不需要花哨的 UI,在你同事的眼里,它就像一个正在执行的本地构建任务,静默而高效。
|
|
42
|
+
**ReadShell** attempts to provide a text-based sanctuary with the lowest friction possible within this highly restrained environment. No bloated UI, no distractions. To your coworkers, it just looks like another local build task running silently and efficiently.
|
|
37
43
|
|
|
38
|
-
###
|
|
39
|
-
|
|
40
|
-
- **`Ink`
|
|
41
|
-
-
|
|
42
|
-
-
|
|
44
|
+
### The Romance of Tech Choices
|
|
45
|
+
To achieve ultimate speed and minimal resource overhead, we abandoned Electron and GUI frameworks:
|
|
46
|
+
- **`Ink` TUI Aesthetics**: Drawing an old-school, geeky CLI using Modern React reactive principles. Flexbox and Hooks give CLI apps smooth boundary feedback.
|
|
47
|
+
- **Absolute Local Sovereignty (`SQLite`)**: Rejecting cloud lock-in and redundant network requests. Your reading memories, chapter skeletons, and bookmarks exist cleanly in a lightning-fast read-only ledger on your SSD.
|
|
48
|
+
- **Philosophy of Simplification**: Whether it’s a massive raw TXT or a complex HTML-embedded EPUB, they are streamed, parsed, and cleansed into structured terminal rows, arriving right before your eyes at the press of a key.
|
|
43
49
|
|
|
44
|
-
## ⚡
|
|
50
|
+
## ⚡ Quick Start
|
|
45
51
|
|
|
46
|
-
###
|
|
52
|
+
### Installation
|
|
47
53
|
|
|
48
54
|
```bash
|
|
49
55
|
npm install -g readshell
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
###
|
|
58
|
+
### Basic Usage
|
|
53
59
|
|
|
54
60
|
```bash
|
|
55
|
-
#
|
|
56
|
-
novel
|
|
61
|
+
# Set Language (en / zh)
|
|
62
|
+
novel lang en
|
|
57
63
|
|
|
58
|
-
#
|
|
64
|
+
# Import a single book or batch import a folder (.txt and .epub)
|
|
65
|
+
novel import ~/books/
|
|
66
|
+
|
|
67
|
+
# Resume last read (Zero-friction entry)
|
|
59
68
|
novel resume
|
|
60
69
|
|
|
61
|
-
#
|
|
70
|
+
# Open a specific book
|
|
62
71
|
novel open <book-id>
|
|
63
72
|
|
|
64
|
-
#
|
|
73
|
+
# View library
|
|
65
74
|
novel library
|
|
66
75
|
|
|
67
|
-
#
|
|
76
|
+
# Remove a book and its records
|
|
68
77
|
novel remove <book-id>
|
|
78
|
+
|
|
79
|
+
# Check and update to the latest version
|
|
80
|
+
novel update
|
|
69
81
|
```
|
|
70
82
|
|
|
71
|
-
###
|
|
83
|
+
### Reader Shortcuts
|
|
72
84
|
|
|
73
|
-
|
|
|
85
|
+
| Key | Action |
|
|
74
86
|
|---|---|
|
|
75
|
-
|
|
|
76
|
-
| `k` / `↑` |
|
|
77
|
-
| `c` |
|
|
78
|
-
| `Tab` |
|
|
79
|
-
| `m` / `M` |
|
|
80
|
-
| `b` / `Esc` | Boss Key (
|
|
81
|
-
| `q` |
|
|
82
|
-
| `?` |
|
|
87
|
+
| `Space` / `j` / `↓` | Next Page |
|
|
88
|
+
| `k` / `↑` | Previous Page |
|
|
89
|
+
| `c` | Open Chapters and Bookmarks list |
|
|
90
|
+
| `Tab` | Switch between Chapters/Bookmarks in menu |
|
|
91
|
+
| `m` / `M` | Add Bookmark at the current page |
|
|
92
|
+
| `b` / `Esc` | Boss Key (disguise terminal as error and save) |
|
|
93
|
+
| `q` | Quit and save progress |
|
|
94
|
+
| `?` | Help |
|
|
83
95
|
|
|
84
|
-
## 🏗️
|
|
96
|
+
## 🏗️ Tech Stack
|
|
85
97
|
|
|
86
98
|
- **TypeScript** + **Node.js** (≥ 18)
|
|
87
|
-
- **Ink** — React
|
|
88
|
-
- **SQLite** (`better-sqlite3`) —
|
|
89
|
-
- **Vitest** —
|
|
99
|
+
- **Ink** — React-based Terminal UI framework
|
|
100
|
+
- **SQLite** (`better-sqlite3`) — Zero-dependency local DB
|
|
101
|
+
- **Vitest** — Testing Framework
|
|
90
102
|
|
|
91
|
-
## 📁
|
|
103
|
+
## 📁 Project Structure
|
|
92
104
|
|
|
93
105
|
```
|
|
94
106
|
src/
|
|
95
|
-
├── cli/ #
|
|
96
|
-
├── ui/ # TUI
|
|
97
|
-
├── services/ #
|
|
98
|
-
├── parsers/ #
|
|
99
|
-
├── db/ #
|
|
100
|
-
├── config/ #
|
|
101
|
-
└── utils/ #
|
|
107
|
+
├── cli/ # CLI layer: args parsing, command dispatch
|
|
108
|
+
├── ui/ # TUI layer (Ink components)
|
|
109
|
+
├── services/ # Business logic
|
|
110
|
+
├── parsers/ # Format parsers (txt/epub)
|
|
111
|
+
├── db/ # Database layer (SQLite)
|
|
112
|
+
├── config/ # Configuration management
|
|
113
|
+
└── utils/ # Utilities
|
|
102
114
|
```
|
|
103
115
|
|
|
104
|
-
## 🛠️
|
|
116
|
+
## 🛠️ Development
|
|
105
117
|
|
|
106
118
|
```bash
|
|
107
|
-
#
|
|
119
|
+
# Install dependencies
|
|
108
120
|
npm install
|
|
109
121
|
|
|
110
|
-
#
|
|
122
|
+
# Dev mode
|
|
111
123
|
npm run dev
|
|
112
124
|
|
|
113
|
-
#
|
|
125
|
+
# Run tests
|
|
114
126
|
npm test
|
|
115
127
|
|
|
116
|
-
#
|
|
128
|
+
# Build
|
|
117
129
|
npm run build
|
|
118
130
|
|
|
119
|
-
#
|
|
131
|
+
# Lint
|
|
120
132
|
npm run lint
|
|
121
133
|
|
|
122
|
-
#
|
|
134
|
+
# Format
|
|
123
135
|
npm run format
|
|
124
136
|
```
|
|
125
137
|
|
|
126
|
-
## 📝
|
|
138
|
+
## 📝 License
|
|
127
139
|
|
|
128
140
|
[AGPL-3.0](LICENSE)
|