readshell 0.3.1 → 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/LICENSE +17 -13
- package/README.md +139 -90
- package/dist/index.js +1235 -216
- package/dist/index.js.map +1 -1
- package/package.json +10 -5
package/LICENSE
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
Version 3, 19 November 2007
|
|
1
|
+
MIT License
|
|
3
2
|
|
|
4
|
-
Copyright (
|
|
3
|
+
Copyright (c) 2026 ReadShell / davidy
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
the
|
|
9
|
-
|
|
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:
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU Affero General Public License for more details.
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,143 +1,192 @@
|
|
|
1
1
|
[English](README.md) | [中文](README_zh.md)
|
|
2
2
|
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
3
5
|
# ReadShell
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**Your terminal already has everything. Now it has a bookshelf.**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/readshell)
|
|
10
|
+
[](https://www.npmjs.com/package/readshell)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://nodejs.org)
|
|
13
|
+
|
|
14
|
+
*A low-friction reading tool for developers who never leave the terminal. Free and open source — no accounts, no servers, no paid tier.*
|
|
15
|
+
|
|
16
|
+

|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
[](https://nodejs.org)
|
|
18
|
+
</div>
|
|
9
19
|
|
|
10
20
|
---
|
|
11
21
|
|
|
12
|
-
##
|
|
22
|
+
## The Problem
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
Waiting for a build to finish? Pipeline still running? You have 5 minutes.
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
You open your phone. 40 minutes later, you're still scrolling.
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
ReadShell is built for that gap — a reading space that lives inside your workflow, not outside it.
|
|
29
|
+
```bash
|
|
30
|
+
novel resume
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
One command. Back to where you were. Back to work when you're ready.
|
|
34
|
+
|
|
35
|
+
---
|
|
24
36
|
|
|
25
|
-
##
|
|
37
|
+
## Features
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
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.
|
|
39
|
+
**📖 `novel resume` — Zero-friction re-entry**
|
|
40
|
+
The most important command. Picks up exactly where you left off, down to the byte.
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
**🥷 Boss Key (`b` / `Esc`) — Instant disguise**
|
|
43
|
+
One keypress transforms the reader into a convincing terminal error log (nodejs / python / java / c / go). Your secret is safe.
|
|
44
|
+

|
|
45
|
+
*Boss Key wipes the scrollback buffer and shows a fake error. `novel resume` jumps back to the exact spot.*
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
**🔄 Folder sync — multi-device, no server**
|
|
48
|
+
Point ReadShell at any folder synced by iCloud Drive, Dropbox, OneDrive, 坚果云, or Syncthing. Progress, bookmarks (including deletions), and reading stats merge across devices automatically on open/exit. Nothing is ever uploaded to a ReadShell server — there isn't one.
|
|
39
49
|
|
|
40
|
-
|
|
50
|
+
**📊 `novel stats` — GitHub-style heatmap**
|
|
51
|
+
A year of reading at a glance, plus reading days, total time, books read, and streaks — aggregated across all synced devices.
|
|
41
52
|
|
|
42
|
-
|
|
53
|
+
**🔖 Bookmarks (`m`) + free export**
|
|
54
|
+
Capture a passage mid-read, revisit via the chapter navigator (`c`), export everything with `novel bookmarks export --format md|json`.
|
|
43
55
|
|
|
44
|
-
|
|
45
|
-
|
|
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.
|
|
56
|
+
**📚 Batch import**
|
|
57
|
+
`novel import ~/books/` — recursively imports `.txt`, `.epub`, and `.md` files.
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
**🌐 i18n**
|
|
60
|
+
Native Chinese and English support (`novel lang zh|en`).
|
|
51
61
|
|
|
52
|
-
|
|
62
|
+
---
|
|
53
63
|
|
|
64
|
+
## Quick Start
|
|
54
65
|
```bash
|
|
55
66
|
npm install -g readshell
|
|
56
67
|
```
|
|
57
|
-
|
|
58
|
-
### Basic Usage
|
|
59
|
-
|
|
60
68
|
```bash
|
|
61
|
-
#
|
|
62
|
-
novel lang en
|
|
63
|
-
|
|
64
|
-
# Import a single book or batch import a folder (.txt and .epub)
|
|
69
|
+
# Import your books
|
|
65
70
|
novel import ~/books/
|
|
66
71
|
|
|
67
|
-
#
|
|
72
|
+
# Jump back in
|
|
68
73
|
novel resume
|
|
69
74
|
|
|
70
|
-
#
|
|
75
|
+
# Or pick a specific book
|
|
71
76
|
novel open <book-id>
|
|
72
77
|
|
|
73
|
-
#
|
|
74
|
-
novel config language en
|
|
75
|
-
novel config line-spacing 1
|
|
76
|
-
novel config reading-mode scroll
|
|
77
|
-
|
|
78
|
-
# View book list
|
|
78
|
+
# Browse your library
|
|
79
79
|
novel list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Reader Controls
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
| Key | Action |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `Space` / `j` / `↓` / `f` | Next page / scroll down |
|
|
87
|
+
| `k` / `↑` | Previous page / scroll up |
|
|
88
|
+
| `g` / `G` | First / last page |
|
|
89
|
+
| `c` | Chapter list & bookmarks |
|
|
90
|
+
| `Tab` | Toggle chapters / bookmarks |
|
|
91
|
+
| `m` | Add bookmark |
|
|
92
|
+
| `b` / `Esc` | **Boss Key** — disguise & save |
|
|
93
|
+
| `q` | Quit & save |
|
|
94
|
+
| `?` | Help |
|
|
83
95
|
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
### Commands
|
|
97
|
+
```bash
|
|
98
|
+
novel import <path> # file or directory (txt / epub / md)
|
|
99
|
+
novel list # library
|
|
100
|
+
novel open <id|title> # open a book
|
|
101
|
+
novel resume # resume last position
|
|
102
|
+
novel remove <id|title> # remove from library
|
|
103
|
+
novel stats # reading heatmap & streaks
|
|
104
|
+
novel bookmarks export [--format json|md] [--out file]
|
|
105
|
+
novel sync --dir <path> [--with-books] # set sync folder & sync
|
|
106
|
+
novel sync # sync with saved folder
|
|
107
|
+
novel sync --off # disable sync
|
|
108
|
+
novel lang zh|en # interface language
|
|
109
|
+
novel config <key> <value> # language | line-spacing | reading-mode | boss-key-lang
|
|
110
|
+
novel update # update to latest
|
|
86
111
|
```
|
|
87
112
|
|
|
88
|
-
|
|
113
|
+
---
|
|
89
114
|
|
|
90
|
-
|
|
91
|
-
| `k` / `↑` | Previous Page (or Scroll half-page in scroll mode) |
|
|
92
|
-
| `c` | **Open Chapters and Bookmarks list (Quick Navigation)** |
|
|
93
|
-
| `Tab` | Switch between Chapters/Bookmarks in menu |
|
|
94
|
-
| `m` / `M` | Add Bookmark at the current page |
|
|
95
|
-
| `b` / `Esc` | Boss Key (instantly disguise terminal and save) |
|
|
96
|
-
| `q` | Quit and save progress |
|
|
97
|
-
| `?` | Help |
|
|
115
|
+
## Folder Sync
|
|
98
116
|
|
|
99
|
-
|
|
117
|
+
ReadShell syncs through a plain folder — no account, no server. Each device writes a snapshot to `<syncDir>/readshell-sync/devices/<deviceId>.json` and merges every other device's file (last-write-wins progress, bookmark tombstones, session union).
|
|
100
118
|
|
|
101
|
-
|
|
102
|
-
- **Ink** — React-based Terminal UI framework
|
|
103
|
-
- **SQLite** (`better-sqlite3`) — Zero-dependency local DB
|
|
104
|
-
- **Vitest** — Testing Framework
|
|
119
|
+
Pick a folder that your sync tool already watches:
|
|
105
120
|
|
|
106
|
-
|
|
121
|
+
```bash
|
|
122
|
+
# iCloud Drive (macOS)
|
|
123
|
+
novel sync --dir "$HOME/Library/Mobile Documents/com~apple~CloudDocs/ReadShell"
|
|
107
124
|
|
|
125
|
+
# Dropbox
|
|
126
|
+
novel sync --dir ~/Dropbox/ReadShell
|
|
127
|
+
|
|
128
|
+
# 坚果云 / OneDrive / Syncthing — same idea, any synced folder
|
|
129
|
+
novel sync --dir ~/Nutstore/ReadShell
|
|
108
130
|
```
|
|
109
|
-
src/
|
|
110
|
-
├── cli/ # CLI layer: args parsing, command dispatch
|
|
111
|
-
├── ui/ # TUI layer (Ink components)
|
|
112
|
-
├── services/ # Business logic
|
|
113
|
-
├── parsers/ # Format parsers (txt/epub)
|
|
114
|
-
├── db/ # Database layer (SQLite)
|
|
115
|
-
├── config/ # Configuration management
|
|
116
|
-
└── utils/ # Utilities
|
|
117
|
-
```
|
|
118
131
|
|
|
119
|
-
|
|
132
|
+
Add `--with-books` to also copy book files into the sync folder — other devices will auto-import books they don't have yet. Without it, only progress/bookmarks/stats sync (books are matched by file hash).
|
|
133
|
+
|
|
134
|
+
Sync runs automatically when the reader opens (pull) and exits (push + pull), silently and bounded to ~2s. `novel sync --off` disables it.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Migrating from readshell-pro
|
|
120
139
|
|
|
121
140
|
```bash
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
npm uninstall -g readshell-pro && npm install -g readshell
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Your library, progress, and bookmarks are preserved — the data directory is unchanged. Cloud auth keys are cleaned up automatically on first run.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Why the terminal?
|
|
149
|
+
|
|
150
|
+
The terminal is already where you live. It's focused, text-only, and distraction-resistant by nature.
|
|
124
151
|
|
|
125
|
-
|
|
126
|
-
npm run dev
|
|
152
|
+
ReadShell doesn't ask you to context-switch. It sits quietly in your workflow — invisible to colleagues, zero install friction, no accounts, no cloud, no noise.
|
|
127
153
|
|
|
128
|
-
|
|
129
|
-
npm test
|
|
154
|
+
Your reading history lives entirely on your local machine in a SQLite file (plus the sync folder you choose). Nothing leaves your disk otherwise.
|
|
130
155
|
|
|
131
|
-
|
|
132
|
-
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Tech Stack
|
|
133
159
|
|
|
134
|
-
|
|
135
|
-
|
|
160
|
+
- **TypeScript** + **Node.js** ≥ 20
|
|
161
|
+
- **Ink** — React-based TUI framework
|
|
162
|
+
- **SQLite** (`better-sqlite3`) — local-first, zero-dependency storage
|
|
163
|
+
- **Vitest** — testing
|
|
136
164
|
|
|
137
|
-
|
|
138
|
-
|
|
165
|
+
## Project Structure
|
|
166
|
+
```
|
|
167
|
+
src/
|
|
168
|
+
├── cli/ # Command layer
|
|
169
|
+
├── ui/ # TUI components (Ink)
|
|
170
|
+
├── services/ # Business logic (incl. folder sync, stats)
|
|
171
|
+
├── parsers/ # txt / epub / md parsers
|
|
172
|
+
├── db/ # SQLite layer
|
|
173
|
+
├── config/ # Config management
|
|
174
|
+
└── utils/
|
|
139
175
|
```
|
|
140
176
|
|
|
141
|
-
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Contributing
|
|
180
|
+
|
|
181
|
+
Issues, ideas, and PRs are welcome — see [CONTRIBUTING](docs/CONTRIBUTING.md).
|
|
182
|
+
If ReadShell fits into your workflow, a ⭐ helps more people find it.
|
|
183
|
+
|
|
184
|
+
## Sponsor
|
|
185
|
+
|
|
186
|
+
If ReadShell saves you time, consider supporting development: https://readshell.com/sponsor
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## License
|
|
142
191
|
|
|
143
|
-
[
|
|
192
|
+
[MIT](LICENSE)
|