https://github.com/nrempel/locdev
locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file.
https://github.com/nrempel/locdev
cli command-line command-line-tool hosts hosts-file localhost
Last synced: 11 months ago
JSON representation
locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file.
- Host: GitHub
- URL: https://github.com/nrempel/locdev
- Owner: nrempel
- License: mit
- Created: 2023-05-25T17:08:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-03T17:08:30.000Z (almost 2 years ago)
- Last Synced: 2025-05-08T23:08:44.823Z (11 months ago)
- Topics: cli, command-line, command-line-tool, hosts, hosts-file, localhost
- Language: Rust
- Homepage:
- Size: 45.9 KB
- Stars: 26
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# locdev 🛠️
[](https://crates.io/crates/locdev)
[](https://github.com/nrempel/locdev/actions)
[](https://github.com/nrempel/locdev/releases)
locdev is a handy CLI tool that simplifies the process of adding, removing, and
listing entries in the hosts file. You no longer need to deal with manual and
error-prone editing. Now, it's as simple as running a command.
## Features
- Add entries to the hosts file
- Remove entries from the hosts file
- Print the current entries in the hosts file
## Installation
### Download Compiled Binaries
You can download the compiled binaries for locdev from the
[GitHub Releases](https://github.com/nrempel/locdev/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.
### Install with Cargo
To install locdev using Cargo, you'll need to have
[Rust](https://www.rust-lang.org/tools/install) installed on your system. Once
Rust is installed, you can install locdev with Cargo:
```bash
cargo install locdev
```
## Usage
```bash
locdev [COMMAND]
```
### Commands
- `add `: Add an entry to the hosts file with the specified IP
and hostname
- `remove `: Remove the entry with the specified IP and hostname
from the hosts file
- `list`: Print the current entries in the hosts file
## Examples
Add an entry to the hosts file:
```bash
sudo locdev add 127.0.0.1 dev.local
```
Remove an entry from the hosts file:
```bash
sudo locdev remove 127.0.0.1 dev.local
```
Print the current entries in the hosts file:
```bash
locdev list
```
## Note
You need to use `sudo` to execute the `add` and `remove` commands, as the hosts
file requires administrator privileges to modify its contents.
## License
This project is available under the MIT License.