Everything you need to install, configure, and use lockin.
Install lockin with a single command. The script detects your architecture (Apple Silicon or Intel) and downloads the correct binary.
The binary is installed to /usr/local/bin/lockin. You can also build from source:
Start blocking distractions:
Check what's being blocked:
Change what's blocked:
Stop blocking:
Fully remove lockin and all its data:
lockin prompts for your password, activates blocking, and returns you to your terminal. App monitoring runs silently in the background. Your original /etc/hosts is backed up to ~/.lockin/hosts.bak and fully restored on stop.
On first run, lockin creates a config at ~/.lockin/config.yaml. Edit it to customize what gets blocked:
blocked_websites: - twitter.com - x.com - facebook.com - instagram.com - tiktok.com - reddit.com - youtube.com - netflix.com - twitch.tv blocked_apps: - Messages - Telegram - Discord - WhatsApp settings: poll_interval: 3s
The www. variants of all websites are automatically included. The poll_interval controls how often lockin checks for blocked apps.
Website blocking works by adding entries to /etc/hosts that redirect blocked domains to 127.0.0.1. This is kernel-level DNS interception with zero network performance impact. No proxy, no packet inspection.
App blocking runs as a lightweight background daemon that polls running applications via macOS System Events and gracefully quits any blocked apps. Your terminal is returned to you immediately.
All changes are fully reversible. Your /etc/hosts is backed up before modification and restored when you stop lockin. Managed entries are wrapped in marker comments so they never interfere with your existing configuration.
/etc/hosts is backed up to ~/.lockin/hosts.bak before any modificationLOCKIN-START / LOCKIN-END markerslockin stop on reboot, so your hosts file is always restored — even after a crash or power losslockin uninstall fully removes everything: hosts entries, daemon, config, and the binary