#host #sites #systems #file #block #cli #command

app site-blocker

A CLI to block sites through the systems hosts file

3 releases

0.1.2 Mar 19, 2024
0.1.1 Mar 19, 2024
0.1.0 Mar 19, 2024

#125 in Text editors

Download history 237/week @ 2024-03-14 60/week @ 2024-03-21 30/week @ 2024-03-28 12/week @ 2024-04-04

146 downloads per month

MIT license

18KB
440 lines

site-blocker

Unit-Test Super-Linter

A CLI to block sites through the systems hosts file.

Installation

cargo install site-blocker

This CLI does not natively support Windows and has not been tested on it. However, nothing is stopping it from working since the hosts file path can be configured as an option. Try it out and create an issue if there are problems.

Usage

site-blocker [OPTIONS] <COMMAND>

Commands:
  get     Get blocked sites [aliases: ls]
  add     Add blocked sites
  delete  Remove blocked sites [aliases: rm]
  edit    Edit blocked sites in an editor

Browsers usually require their cache to be cleared before they reflect changes to the hosts file.

Examples

sudo site-blocker add www.example.com www.example2.com
INFO www.example.com added
INFO www.example2.com added

site-blocker list
www.example.com
www.example2.com

sudo site-blocker delete www.example.com
INFO www.example.com deleted

sudo site-blocker edit

Dependencies

~3–15MB
~166K SLoC