qwerty-cli 0.0.1-alpha.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 +92 -0
- package/assets/registry.snapshot.json +4835 -0
- package/assets/sounds/correct.wav +0 -0
- package/assets/sounds/key-default.wav +0 -0
- package/assets/sounds/wrong.wav +0 -0
- package/bin/qwerty.mjs +2 -0
- package/dist/cli.js +1558 -0
- package/dist/cli.js.map +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# qwerty-cli
|
|
2
|
+
|
|
3
|
+
Terminal clone of [qwerty-learner](https://github.com/RealKai42/qwerty-learner): typing practice for English vocabulary, with chapters, dictation, mistake book, and audio.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g qwerty-cli
|
|
9
|
+
# or
|
|
10
|
+
pnpm add -g qwerty-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node 20+.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
qwerty # interactive main menu
|
|
19
|
+
qwerty dict search 四级 # browse the upstream registry
|
|
20
|
+
qwerty dict pull cet4 # download a dictionary
|
|
21
|
+
qwerty practice cet4 # start practicing
|
|
22
|
+
qwerty stats # show progress / streak / mistakes
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
- `qwerty practice [dictId] [-c <chapter>] [-m <mode>]` — start practice.
|
|
28
|
+
Modes: `order` (default), `dictation` (word hidden), `random`, `loop`, `review` (mistake book).
|
|
29
|
+
- `qwerty dict <list|search|pull|import|rm>` — manage dictionaries. `pull` fetches from `RealKai42/qwerty-learner@master/public/dicts/*.json`. `import --id <id> <file>` imports a local qwerty-native JSON file.
|
|
30
|
+
- `qwerty word <keyword>` — look up a word across local dictionaries; substring match by default, `--exact` for case-insensitive exact.
|
|
31
|
+
- `qwerty stats [-d <days>] [--top <n>]` — lifetime totals, daily sparklines, recent sessions, top mistakes.
|
|
32
|
+
- `qwerty config <list|get <key>|set <key> <value>>` — dotted paths, e.g. `qwerty config set accent uk`.
|
|
33
|
+
|
|
34
|
+
## In-session keys
|
|
35
|
+
|
|
36
|
+
| Key | Action |
|
|
37
|
+
|-----------|-------------------------------------|
|
|
38
|
+
| letters | Type the word. Any mistake clears the entire buffer and counts an error. |
|
|
39
|
+
| Esc | Pause / resume |
|
|
40
|
+
| Tab | Replay current word's pronunciation |
|
|
41
|
+
| Ctrl+C | Quit (current session is saved if a chapter was finished) |
|
|
42
|
+
|
|
43
|
+
After a chapter completes: `n` next chapter, `m` review mistakes, `q` quit.
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
Config lives at `~/.qwerty-cli/config.json`. Defaults:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mirror": "jsdelivr",
|
|
52
|
+
"accent": "us",
|
|
53
|
+
"chapterSize": 20,
|
|
54
|
+
"sounds": { "master": true, "keystroke": true, "feedback": true, "keySoundName": "default" },
|
|
55
|
+
"autoplayPronunciation": true,
|
|
56
|
+
"defaultMode": "order"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Switch the mirror to `github` if jsDelivr is blocked. Set `defaultDict` so the main menu can jump straight into practice.
|
|
61
|
+
|
|
62
|
+
## Audio
|
|
63
|
+
|
|
64
|
+
- Keystroke / correct / wrong WAV files are bundled.
|
|
65
|
+
- Word pronunciations come from `dict.youdao.com/dictvoice` (`type=1` UK, `type=2` US) and are cached under `~/.qwerty-cli/cache/audio/`.
|
|
66
|
+
- Playback uses whichever of `afplay`, `ffplay`, `mpg123`, `paplay`, `aplay`, or PowerShell `Media.SoundPlayer` is on PATH. If none is found, sounds are silently disabled for the session (with a one-time warning).
|
|
67
|
+
|
|
68
|
+
## Data layout
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
~/.qwerty-cli/
|
|
72
|
+
├── config.json
|
|
73
|
+
├── registry.json # optional override of the bundled registry snapshot
|
|
74
|
+
├── dicts/<id>.json # downloaded dictionaries
|
|
75
|
+
├── stats.jsonl # append-only session records
|
|
76
|
+
├── mistakes.json # cumulative per-word error counts
|
|
77
|
+
└── cache/audio/<word>-{us|uk}.mp3
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Developing
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pnpm install
|
|
84
|
+
pnpm build # tsup -> dist/cli.js
|
|
85
|
+
pnpm test # vitest
|
|
86
|
+
pnpm typecheck
|
|
87
|
+
pnpm sync-registry # refresh assets/registry.snapshot.json from upstream
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT.
|