A simple CLI tool to block distracting websites on macOS by modifying /etc/hosts.
make installOr manually:
go build -o focus .
sudo mv focus /usr/local/bin/# Block all configured sites
focus block
# Unblock all sites
focus unblock
# Check current status
focus status
# Open config file in editor
focus configSites are stored in ~/.config/focus/sites.txt (one domain per line):
x.com
linkedin.com
discord.com
news.ycombinator.com
Edit this file to add or remove sites. Changes apply on next focus block.
- Adds
127.0.0.1 <domain>entries to/etc/hosts - Flushes DNS cache after changes
- Requires sudo to modify the hosts file