Hosts Editor is a command-line utility designed to simplify the management of your system's hosts file. It allows you to easily add, edit, delete, and toggle entries in the hosts file without manually editing the file.
- List all entries in the hosts file.
- Create new entries.
- Toggle the state of existing entries (enable or disable).
- Edit specific entries.
- Delete entries.
- Open the hosts file in vim for manual editing.
The general syntax for using Hosts Editor is:
hosts <command> <args>
-
--help
,-h
Displays the help message. -
list
Lists all entries in the hosts file. -
create
Creates a new entry in the hosts file. -
toggle <line_number>
Toggles the state of the entry at the specified line number, enabling or disabling it. -
edit <line_number>
Modifies the entry at the specified line number. -
delete <line_number>
Deletes the entry at the specified line number. -
vim
Opens the hosts file in vim for manual editing.
hosts list
hosts create
# Follow the prompts to add a new entry
hosts toggle 3
# This will enable or disable the entry at line 3
hosts edit 2
# This will modify the entry at line 2
hosts delete 4
# This will remove the entry at line 4
hosts vim
This project is licensed under the MIT License. See the LICENSE file for more details.