blue-lock
v0.1.0
Published
Lock Windows when a remembered Bluetooth LE device moves away.
Maintainers
Readme
blue-lock
blue-lock is a small Windows CLI that locks your screen when a remembered Bluetooth LE device is no longer seen nearby.
It is designed for the simplest phone setup possible: users do not install a phone app. They turn on Bluetooth, run the learning command, and keep the watcher running.
Important limits
- Locking Windows is supported.
- Automatic unlock is not supported from this CLI. Windows intentionally prevents ordinary user programs from bypassing the lock screen. Use Windows Hello, Dynamic Lock, or a proper Windows credential provider for unlock behavior.
- Bluetooth proximity is approximate. Phones often randomize Bluetooth identifiers and may stop advertising when idle, so detection can vary by phone model and OS settings.
- The scanner uses Bluetooth LE advertisements. If your phone does not appear during learning, open Bluetooth settings on the phone and keep the screen awake while learning.
Install
npm install -g blue-lockIf npm fails with UNABLE_TO_VERIFY_LEAF_SIGNATURE, fix your local Node/npm certificate trust before installing. This usually means a corporate proxy or local TLS inspection certificate is not trusted by Node.
For local development:
npm install
npm linkUsage
Learn nearby Bluetooth LE devices:
blue-lock scanRemember a device:
blue-lock pair <device-id>Start watching:
blue-lock watchInstall auto-start for the current Windows user:
blue-lock autostart enableDisable auto-start:
blue-lock autostart disableShow current configuration:
blue-lock statusConfiguration
The config file is stored at:
%APPDATA%\blue-lock\config.jsonUseful options:
blue-lock config --away-seconds 20 --near-rssi -75 --lock-cooldown 60away-seconds: seconds without seeing the phone before locking.near-rssi: RSSI threshold. Less negative is nearer, so-65is stricter than-85.lock-cooldown: minimum seconds between lock attempts.
Publish
npm login
npm publish --access publicIf the package name is already taken, change name in package.json before publishing.
