Documentation

Everything you need to install, configure, and use lockin.

Installation

Install lockin with a single command. The script detects your architecture (Apple Silicon or Intel) and downloads the correct binary.

$ curl -fsSL https://lockin.sh/install | sh

The binary is installed to /usr/local/bin/lockin. You can also build from source:

$ git clone https://github.com/0xmanny/lockin.git
$ cd lockin && make install

Usage

Start blocking distractions:

$ lockin

Check what's being blocked:

$ lockin status

Change what's blocked:

$ lockin config

Stop blocking:

$ lockin stop

Fully remove lockin and all its data:

$ lockin uninstall

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.

Configuration

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.

How It Works

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.

Safety

  • -Your /etc/hosts is backed up to ~/.lockin/hosts.bak before any modification
  • -Managed entries are wrapped in LOCKIN-START / LOCKIN-END markers
  • -A LaunchDaemon automatically runs lockin stop on reboot, so your hosts file is always restored — even after a crash or power loss
  • -lockin uninstall fully removes everything: hosts entries, daemon, config, and the binary