| Crates.io | locdev |
| lib.rs | locdev |
| version | 0.1.3 |
| created_at | 2023-05-25 17:20:47.539844+00 |
| updated_at | 2025-05-25 23:43:21.161743+00 |
| description | โ ๏ธ DEPRECATED: This crate has been renamed to 'hostie'. Please use 'hostie' instead. |
| homepage | https://github.com/nrempel/hostie |
| repository | https://github.com/nrempel/hostie |
| max_upload_size | |
| id | 874433 |
| size | 48,980 |
This crate has been renamed to hostie.
Please use hostie instead of locdev.
hostie is a handy CLI tool that simplifies the process of adding, removing, and
listing entries in your system's hosts file (/etc/hosts on Unix, C:\Windows\System32\drivers\etc\hosts on Windows).
Perfect for developers who need to quickly map hostnames to IP addresses for local development, testing, or debugging. You no longer need to deal with manual and error-prone editing. Now, it's as simple as running a command.
Instead of manually editing your hosts file like this:
sudo nano /etc/hosts
# Navigate to the right line, be careful not to break anything...
# Add: 127.0.0.1 myapp.local
# Save and exit
Just do this:
sudo hostie add 127.0.0.1 myapp.local
localhostYou can download the compiled binaries for hostie from the
GitHub Releases page. Choose the
binary that corresponds to your operating system and architecture, and place it
in a directory included in your system's PATH environment variable.
To install hostie using Cargo, you'll need to have Rust installed on your system. Once Rust is installed, you can install hostie with Cargo:
cargo install hostie
hostie [COMMAND]
add <ip> <hostname>: Add an entry to the hosts file with the specified IP
and hostnameremove <ip> <hostname>: Remove the entry with the specified IP and hostname
from the hosts filelist: Print the current entries in the hosts fileAdd a local development site:
sudo hostie add 127.0.0.1 myapp.local
Remove an entry when you're done:
sudo hostie remove 127.0.0.1 myapp.local
List all current entries:
hostie list
Set up multiple local services:
sudo hostie add 127.0.0.1 api.local
sudo hostie add 127.0.0.1 frontend.local
sudo hostie add 127.0.0.1 admin.local
Point to a staging server:
sudo hostie add 192.168.1.100 staging.mycompany.com
Override a production domain for testing:
sudo hostie add 127.0.0.1 api.production.com
Block a website (point to localhost):
sudo hostie add 127.0.0.1 distracting-website.com
$ hostie list
127.0.0.1 localhost
127.0.0.1 myapp.local
192.168.1.100 staging.mycompany.com
::1 localhost
localhostYou need to use sudo to execute the add and remove commands, as the hosts
file requires administrator privileges to modify its contents.
This project is available under the MIT License.