keyvoid 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/CHANGELOG.md +15 -0
- package/CONTRIBUTING.md +42 -0
- package/LICENSE +21 -0
- package/README.md +233 -0
- package/bin/keyvoid.js +121 -0
- package/package.json +77 -0
- package/src/app.js +294 -0
- package/src/engine/permissions.js +107 -0
- package/src/engine/suppressor/helpers/linux-helper.py +192 -0
- package/src/engine/suppressor/helpers/macos-helper.swift +108 -0
- package/src/engine/suppressor/helpers/macos-pynput-helper.py +179 -0
- package/src/engine/suppressor/helpers/windows-helper.ps1 +144 -0
- package/src/engine/suppressor/index.js +306 -0
- package/src/scripts/postinstall.js +33 -0
- package/src/ui/components/counter.js +64 -0
- package/src/ui/components/header.js +102 -0
- package/src/ui/components/status-bar.js +71 -0
- package/src/ui/components/unvoid-button.js +78 -0
- package/src/ui/mouse.js +97 -0
- package/src/ui/renderer.js +113 -0
- package/src/ui/skins/arcade.js +530 -0
- package/src/ui/skins/cat.js +223 -0
- package/src/ui/skins/clean.js +155 -0
- package/src/ui/skins/hacker.js +194 -0
- package/src/ui/skins/prank.js +195 -0
- package/src/ui/skins/toddler.js +131 -0
- package/src/ui/skins/zen.js +169 -0
- package/src/ui/unlock-sequence.js +105 -0
- package/src/utils/big-digits.js +130 -0
- package/src/utils/colors.js +114 -0
- package/src/utils/terminal.js +119 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is inspired by Keep a Changelog and follows Semantic Versioning.
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2026-03-30
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Initial npm-ready CLI release of KeyVoid
|
|
12
|
+
- Cross-platform keyboard suppression via native helpers
|
|
13
|
+
- Seven interactive terminal modes (`clean`, `zen`, `arcade`, `hacker`, `cat`, `prank`, `toddler`)
|
|
14
|
+
- Mouse-driven unlock flow with emergency failsafe (`ESC + SPACE`)
|
|
15
|
+
- Updated publish metadata and maintainer verification scripts
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Contributing to KeyVoid
|
|
2
|
+
|
|
3
|
+
Thanks for taking the time to contribute.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/chirayuoli/keyvoid.git
|
|
9
|
+
cd keyvoid
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Branch and Commit Flow
|
|
14
|
+
|
|
15
|
+
1. Create a feature branch from `main`
|
|
16
|
+
2. Keep commits focused and descriptive
|
|
17
|
+
3. Run `npm run verify` before opening a PR
|
|
18
|
+
4. Open a PR with a short problem statement and test notes
|
|
19
|
+
|
|
20
|
+
## Code Guidelines
|
|
21
|
+
|
|
22
|
+
- Keep behavior cross-platform (`darwin`, `linux`, `win32`)
|
|
23
|
+
- Preserve safety guarantees (mouse unlock + failsafe)
|
|
24
|
+
- Avoid adding dependencies unless there is a strong reason
|
|
25
|
+
- Match existing code style and naming conventions
|
|
26
|
+
|
|
27
|
+
## Pull Request Checklist
|
|
28
|
+
|
|
29
|
+
- [ ] Change is scoped and documented
|
|
30
|
+
- [ ] README is updated when CLI behavior changes
|
|
31
|
+
- [ ] `npm run verify` passes locally
|
|
32
|
+
- [ ] No unrelated refactors are mixed in
|
|
33
|
+
|
|
34
|
+
## Reporting Issues
|
|
35
|
+
|
|
36
|
+
When opening an issue, include:
|
|
37
|
+
|
|
38
|
+
- OS and terminal app/version
|
|
39
|
+
- Node version
|
|
40
|
+
- Command used (`keyvoid --mode`)
|
|
41
|
+
- Expected behavior vs actual behavior
|
|
42
|
+
- Any relevant logs/screenshots
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KeyVoid contributors
|
|
4
|
+
|
|
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:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
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
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# KeyVoid
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Global keyboard lock in your terminal with safe mouse-first unlock.</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/chirayuoli/keyvoid/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-22c55e"></a>
|
|
9
|
+
<a href="https://nodejs.org/"><img alt="Node" src="https://img.shields.io/badge/node-%3E%3D18-0ea5e9"></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/keyvoid"><img alt="NPM" src="https://img.shields.io/npm/v/keyvoid"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/keyvoid"><img alt="Downloads" src="https://img.shields.io/npm/dm/keyvoid"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
KeyVoid is a cross-platform CLI that intercepts keyboard input at the OS level and displays an interactive full-screen terminal UI. It is built for focus sessions, safe keyboard lock while away from desk, toddler/cat-proof moments, and lightweight prank demos.
|
|
15
|
+
|
|
16
|
+
## Table of Contents
|
|
17
|
+
|
|
18
|
+
- [What You Get](#what-you-get)
|
|
19
|
+
- [System Requirements](#system-requirements)
|
|
20
|
+
- [Install](#install)
|
|
21
|
+
- [First Run Checklist](#first-run-checklist)
|
|
22
|
+
- [Usage](#usage)
|
|
23
|
+
- [Modes](#modes)
|
|
24
|
+
- [Safety and Unlock Paths](#safety-and-unlock-paths)
|
|
25
|
+
- [Troubleshooting](#troubleshooting)
|
|
26
|
+
- [Developer Setup](#developer-setup)
|
|
27
|
+
- [NPM Publishing (Maintainer)](#npm-publishing-maintainer)
|
|
28
|
+
- [Project Structure](#project-structure)
|
|
29
|
+
- [Security Notes](#security-notes)
|
|
30
|
+
- [License](#license)
|
|
31
|
+
|
|
32
|
+
## What You Get
|
|
33
|
+
|
|
34
|
+
- Global keyboard suppression (not just app-local key capture)
|
|
35
|
+
- Mouse-first unlock control with visible UI feedback
|
|
36
|
+
- Emergency failsafe combo (`ESC + SPACE`) and `Ctrl+C` fallback
|
|
37
|
+
- Seven built-in visual modes (`clean`, `zen`, `arcade`, `hacker`, `cat`, `prank`, `toddler`)
|
|
38
|
+
- Works through npm (`npx`, local install, or global install)
|
|
39
|
+
|
|
40
|
+
## System Requirements
|
|
41
|
+
|
|
42
|
+
| Requirement | Minimum |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Node.js | `>= 18` |
|
|
45
|
+
| Terminal | Interactive TTY (not piped/non-interactive) |
|
|
46
|
+
| OS | macOS, Linux, or Windows |
|
|
47
|
+
|
|
48
|
+
Platform-specific notes:
|
|
49
|
+
|
|
50
|
+
| OS | Status | Required Setup |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| macOS | Supported | Accessibility permission for your terminal app |
|
|
53
|
+
| Linux | Supported | X11 session + `xinput` installed |
|
|
54
|
+
| Windows | Supported | PowerShell available (default on modern Windows) |
|
|
55
|
+
|
|
56
|
+
## Install
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# run instantly (no install)
|
|
60
|
+
npx keyvoid
|
|
61
|
+
|
|
62
|
+
# OR install globally once
|
|
63
|
+
npm install -g keyvoid
|
|
64
|
+
keyvoid
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## First Run Checklist
|
|
68
|
+
|
|
69
|
+
### macOS
|
|
70
|
+
|
|
71
|
+
1. Open `System Settings`
|
|
72
|
+
2. Go to `Privacy & Security -> Accessibility`
|
|
73
|
+
3. Add your terminal app (`Terminal`, `iTerm2`, etc.)
|
|
74
|
+
4. Toggle permission to ON
|
|
75
|
+
|
|
76
|
+
### Linux
|
|
77
|
+
|
|
78
|
+
Install `xinput`:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Ubuntu / Debian
|
|
82
|
+
sudo apt install xinput
|
|
83
|
+
|
|
84
|
+
# Fedora
|
|
85
|
+
sudo dnf install xinput
|
|
86
|
+
|
|
87
|
+
# Arch
|
|
88
|
+
sudo pacman -S xorg-xinput
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Note: KeyVoid is intended for X11 environments. Wayland setups may not provide equivalent behavior.
|
|
92
|
+
|
|
93
|
+
### Windows
|
|
94
|
+
|
|
95
|
+
No additional permission prompts are typically required.
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# interactive mode picker
|
|
101
|
+
keyvoid
|
|
102
|
+
|
|
103
|
+
# direct mode launch
|
|
104
|
+
keyvoid --clean
|
|
105
|
+
keyvoid --zen
|
|
106
|
+
keyvoid --arcade
|
|
107
|
+
keyvoid --hacker
|
|
108
|
+
keyvoid --cat
|
|
109
|
+
keyvoid --prank
|
|
110
|
+
keyvoid --toddler
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
CLI utilities:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
keyvoid --help
|
|
117
|
+
keyvoid --version
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Modes
|
|
121
|
+
|
|
122
|
+
| Flag | Theme | Description |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `--clean` | Minimal UI | High-contrast dashboard with animated blocked-key counter |
|
|
125
|
+
| `--zen` | Calm focus | Breathing-style motion and low-stimulus visuals |
|
|
126
|
+
| `--arcade` | Retro 8-bit | Shooter-inspired animation reacting to key mashing |
|
|
127
|
+
| `--hacker` | Matrix style | Green terminal aesthetic with lock-screen vibes |
|
|
128
|
+
| `--cat` | ASCII cat defense | Reactive cat states and streak-based animation |
|
|
129
|
+
| `--prank` | Fake updater | Convincing fake update view with secret unlock gesture |
|
|
130
|
+
| `--toddler` | Color chaos | Giant emoji bursts and fast-changing vibrant colors |
|
|
131
|
+
|
|
132
|
+
## Safety and Unlock Paths
|
|
133
|
+
|
|
134
|
+
KeyVoid is intentionally designed with redundant exits:
|
|
135
|
+
|
|
136
|
+
1. Click the on-screen **UNVOID** button using your mouse
|
|
137
|
+
2. Hold `ESC + SPACE` for about 5 seconds (failsafe)
|
|
138
|
+
3. Use `Ctrl+C` as emergency terminal fallback
|
|
139
|
+
|
|
140
|
+
On exit, KeyVoid attempts to restore keyboard hook state before terminating.
|
|
141
|
+
|
|
142
|
+
## Troubleshooting
|
|
143
|
+
|
|
144
|
+
### "It says permissions are missing on macOS"
|
|
145
|
+
|
|
146
|
+
- Re-check Accessibility permission for your exact terminal app
|
|
147
|
+
- Fully close and re-open terminal after granting permission
|
|
148
|
+
- Run `keyvoid` again
|
|
149
|
+
|
|
150
|
+
### "Linux launch fails or keyboard is not blocked"
|
|
151
|
+
|
|
152
|
+
- Confirm you are in an X11 session
|
|
153
|
+
- Confirm `xinput` exists: `xinput --version`
|
|
154
|
+
- Retry from a local terminal session (not remote shell)
|
|
155
|
+
|
|
156
|
+
### "I launched with --cat but got another mode"
|
|
157
|
+
|
|
158
|
+
- Ensure you are on the latest commit/release
|
|
159
|
+
- Verify command spelling: `keyvoid --cat`
|
|
160
|
+
- Check version: `keyvoid --version`
|
|
161
|
+
|
|
162
|
+
### "Command not found: keyvoid"
|
|
163
|
+
|
|
164
|
+
- If installed globally, check npm global bin is on `PATH`
|
|
165
|
+
- Or run via `npx keyvoid`
|
|
166
|
+
|
|
167
|
+
## Developer Setup
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
git clone https://github.com/chirayuoli/keyvoid.git
|
|
171
|
+
cd keyvoid
|
|
172
|
+
npm install
|
|
173
|
+
npm run verify
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Useful scripts:
|
|
177
|
+
|
|
178
|
+
- `npm run smoke` -> checks CLI help/version
|
|
179
|
+
- `npm run pack:preview` -> previews publish tarball contents
|
|
180
|
+
- `npm run verify` -> runs smoke + pack preview
|
|
181
|
+
|
|
182
|
+
## NPM Publishing (Maintainer)
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# 1) login
|
|
186
|
+
npm login
|
|
187
|
+
npm whoami
|
|
188
|
+
|
|
189
|
+
# 2) verify package before release
|
|
190
|
+
npm run verify
|
|
191
|
+
|
|
192
|
+
# 3) dry-run package contents
|
|
193
|
+
npm pack --dry-run
|
|
194
|
+
|
|
195
|
+
# 4) publish
|
|
196
|
+
npm publish --access public
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Recommended release flow:
|
|
200
|
+
|
|
201
|
+
1. Bump version (`npm version patch|minor|major`)
|
|
202
|
+
2. Update `CHANGELOG.md`
|
|
203
|
+
3. Tag and push (`git push origin main --tags`)
|
|
204
|
+
4. Publish to npm
|
|
205
|
+
|
|
206
|
+
## Project Structure
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
keyvoid/
|
|
210
|
+
├── bin/keyvoid.js # CLI entry point
|
|
211
|
+
├── src/app.js # Application orchestrator
|
|
212
|
+
├── src/engine/permissions.js # OS/platform checks
|
|
213
|
+
├── src/engine/suppressor/ # Native keyboard suppression layer
|
|
214
|
+
├── src/ui/renderer.js # Full-screen ANSI renderer
|
|
215
|
+
├── src/ui/mouse.js # Mouse region tracking and clicks
|
|
216
|
+
├── src/ui/skins/ # Visual modes
|
|
217
|
+
├── src/scripts/postinstall.js # macOS helper dependency bootstrap
|
|
218
|
+
├── CONTRIBUTING.md
|
|
219
|
+
├── CHANGELOG.md
|
|
220
|
+
└── LICENSE
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Contributing
|
|
224
|
+
|
|
225
|
+
Please see `CONTRIBUTING.md` for workflow and PR expectations.
|
|
226
|
+
|
|
227
|
+
## Security Notes
|
|
228
|
+
|
|
229
|
+
KeyVoid intercepts keyboard input by design. Use only on systems and sessions you control. Avoid running in privileged production shells or remote sessions where recovery may be difficult.
|
|
230
|
+
|
|
231
|
+
## License
|
|
232
|
+
|
|
233
|
+
MIT - see `LICENSE`.
|
package/bin/keyvoid.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// ─── KeyVoid CLI Entry Point ─────────────────────────────────────────
|
|
4
|
+
// Cross-platform keyboard locker with beautiful terminal UI.
|
|
5
|
+
// Usage: npx keyvoid [--clean|--toddler|--cat|--prank]
|
|
6
|
+
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
import { createRequire } from 'module';
|
|
10
|
+
import { KeyVoidApp } from '../src/app.js';
|
|
11
|
+
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const { version } = require('../package.json');
|
|
14
|
+
|
|
15
|
+
const program = new Command();
|
|
16
|
+
|
|
17
|
+
program
|
|
18
|
+
.name('keyvoid')
|
|
19
|
+
.description('🔒 Cross-platform keyboard locker with stunning terminal UI')
|
|
20
|
+
.version(version)
|
|
21
|
+
.option('--clean', 'Minimalist mode with keystroke counter')
|
|
22
|
+
.option('--toddler', 'Fun emoji mode for kids — flashes colors and emojis')
|
|
23
|
+
.option('--cat', 'Cat defense mode — ASCII cat guards your keyboard')
|
|
24
|
+
.option('--prank', 'Fake update screen — looks like Windows is updating')
|
|
25
|
+
.option('--hacker', 'Matrix digital rain with fake system errors')
|
|
26
|
+
.option('--arcade', 'Retro 8-bit alien shooter mini-game')
|
|
27
|
+
.option('--zen', 'Calm breathing ripples for focus')
|
|
28
|
+
.action(async (options) => {
|
|
29
|
+
// Determine selected skin
|
|
30
|
+
let skin = null;
|
|
31
|
+
if (options.clean) skin = 'clean';
|
|
32
|
+
if (options.toddler) skin = 'toddler';
|
|
33
|
+
if (options.cat) skin = 'cat';
|
|
34
|
+
if (options.prank) skin = 'prank';
|
|
35
|
+
if (options.hacker) skin = 'hacker';
|
|
36
|
+
if (options.arcade) skin = 'arcade';
|
|
37
|
+
if (options.zen) skin = 'zen';
|
|
38
|
+
|
|
39
|
+
// Interactive prompt if no explicit option is passed
|
|
40
|
+
if (!skin) {
|
|
41
|
+
if (!process.stdout.isTTY) {
|
|
42
|
+
skin = 'clean'; // Fallback for non-interactive shells
|
|
43
|
+
} else {
|
|
44
|
+
const { select } = await import('@inquirer/prompts');
|
|
45
|
+
try {
|
|
46
|
+
skin = await select({
|
|
47
|
+
message: 'Choose a KeyVoid mode to launch:',
|
|
48
|
+
choices: [
|
|
49
|
+
{
|
|
50
|
+
name: chalk.cyanBright('1. Clean Mode'),
|
|
51
|
+
value: 'clean',
|
|
52
|
+
description: 'Dark minimalist interface with a colorful giant keystroke counter.'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: chalk.magenta('2. Zen Mode'),
|
|
56
|
+
value: 'zen',
|
|
57
|
+
description: 'Soothing colors and breathing ripples for deep focus.'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: chalk.redBright('3. Arcade Mode'),
|
|
61
|
+
value: 'arcade',
|
|
62
|
+
description: 'Mashing keys shoots lasers at 8-bit aliens.'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: chalk.greenBright('4. Hacker Mode'),
|
|
66
|
+
value: 'hacker',
|
|
67
|
+
description: 'Matrix green digital rain and intense system lock errors.'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: chalk.magentaBright('5. Cat Defense'),
|
|
71
|
+
value: 'cat',
|
|
72
|
+
description: 'An ASCII cat animates and gets angry when you try to type.'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: chalk.blueBright('6. Prank Mode'),
|
|
76
|
+
value: 'prank',
|
|
77
|
+
description: 'A fake Windows Update screen. Perfect for coffee breaks! (triple click on top right to exit)'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: chalk.yellow('7. Toddler Mode'),
|
|
81
|
+
value: 'toddler',
|
|
82
|
+
description: 'Bright random background colors and giant emojis on every key press.'
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
} catch (err) {
|
|
87
|
+
if (err.name === 'ExitPromptError') {
|
|
88
|
+
process.exit(0);
|
|
89
|
+
} else {
|
|
90
|
+
console.error('Prompt error:', err);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Ensure proper terminal
|
|
98
|
+
if (!process.stdout.isTTY) {
|
|
99
|
+
console.error(chalk.red('Error: KeyVoid requires an interactive terminal (TTY).'));
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Check terminal size
|
|
104
|
+
const cols = process.stdout.columns || 80;
|
|
105
|
+
const rows = process.stdout.rows || 24;
|
|
106
|
+
if (cols < 50 || rows < 15) {
|
|
107
|
+
console.error(chalk.yellow('Warning: Terminal is very small. For the best experience, resize to at least 80×24.'));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Launch the app
|
|
111
|
+
const app = new KeyVoidApp({ skin });
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
await app.start();
|
|
115
|
+
} catch (err) {
|
|
116
|
+
console.error(chalk.red('Failed to start KeyVoid:'), err.message);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "keyvoid",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Cross-platform keyboard lock CLI with immersive terminal themes and mouse-only unlock",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"homepage": "https://github.com/chirayuoli/keyvoid#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/chirayuoli/keyvoid.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/chirayuoli/keyvoid/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"keyvoid": "./bin/keyvoid.js"
|
|
16
|
+
},
|
|
17
|
+
"main": "src/app.js",
|
|
18
|
+
"preferGlobal": true,
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"os": [
|
|
23
|
+
"darwin",
|
|
24
|
+
"linux",
|
|
25
|
+
"win32"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"start": "node bin/keyvoid.js",
|
|
29
|
+
"clean": "node bin/keyvoid.js --clean",
|
|
30
|
+
"zen": "node bin/keyvoid.js --zen",
|
|
31
|
+
"arcade": "node bin/keyvoid.js --arcade",
|
|
32
|
+
"hacker": "node bin/keyvoid.js --hacker",
|
|
33
|
+
"toddler": "node bin/keyvoid.js --toddler",
|
|
34
|
+
"cat": "node bin/keyvoid.js --cat",
|
|
35
|
+
"prank": "node bin/keyvoid.js --prank",
|
|
36
|
+
"postinstall": "node src/scripts/postinstall.js",
|
|
37
|
+
"smoke": "node bin/keyvoid.js --version && node bin/keyvoid.js --help",
|
|
38
|
+
"pack:preview": "npm pack --dry-run",
|
|
39
|
+
"verify": "npm run smoke && npm run pack:preview"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"keyboard",
|
|
43
|
+
"lock",
|
|
44
|
+
"locker",
|
|
45
|
+
"blocker",
|
|
46
|
+
"system-hook",
|
|
47
|
+
"terminal",
|
|
48
|
+
"cli",
|
|
49
|
+
"security",
|
|
50
|
+
"toddler",
|
|
51
|
+
"cat",
|
|
52
|
+
"prank",
|
|
53
|
+
"npx"
|
|
54
|
+
],
|
|
55
|
+
"author": "KeyVoid Contributors",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18.0.0"
|
|
59
|
+
},
|
|
60
|
+
"files": [
|
|
61
|
+
"bin",
|
|
62
|
+
"src",
|
|
63
|
+
"README.md",
|
|
64
|
+
"LICENSE",
|
|
65
|
+
"CHANGELOG.md",
|
|
66
|
+
"CONTRIBUTING.md"
|
|
67
|
+
],
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@inquirer/prompts": "^8.3.2",
|
|
70
|
+
"ansi-escapes": "^7.0.0",
|
|
71
|
+
"chalk": "^5.4.1",
|
|
72
|
+
"cli-cursor": "^5.0.0",
|
|
73
|
+
"commander": "^13.1.0",
|
|
74
|
+
"figlet": "^1.8.0",
|
|
75
|
+
"gradient-string": "^3.0.0"
|
|
76
|
+
}
|
|
77
|
+
}
|