https://github.com/jeasonstudio/hfm
Host file manager for command line.
https://github.com/jeasonstudio/hfm
hosts hostseditor hostsfile
Last synced: 10 days ago
JSON representation
Host file manager for command line.
- Host: GitHub
- URL: https://github.com/jeasonstudio/hfm
- Owner: jeasonstudio
- License: mit
- Created: 2018-06-21T08:44:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T05:34:17.000Z (almost 3 years ago)
- Last Synced: 2025-10-10T11:17:07.643Z (10 days ago)
- Topics: hosts, hostseditor, hostsfile
- Language: JavaScript
- Size: 161 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
HFM
[![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]
[travis-image]: https://img.shields.io/travis/jeasonstudio/hfm/master.svg
[travis-url]: https://travis-ci.org/jeasonstudio/hfm
[npm-image]: https://img.shields.io/npm/v/hfm.svg
[npm-url]: https://npmjs.org/package/hfm
[downloads-image]: https://img.shields.io/npm/dm/hfm.svg
[downloads-url]: https://npmjs.org/package/hfm> Simple, programmatic `hosts` file manager. Just like `nrm`.
## Install
```bash
npm install hfm -g
```## Usage
If you use OS X or Linux, this module assumes your hosts file is at `/etc/hosts`. On
Windows, it assumes your hosts file is at `C:/Windows/System32/drivers/etc/hosts`.### help
> Print help message for hfm
```bash
$ hfm helpUsage: hfm [options] [command]
Options:
-V, --version output the version number
-h, --help output usage informationCommands:
list|ls List origin or local host files alias
show Show all current domain records in hosts file
alias Alias a(n) origin/local host file
del Unalias a(n) origin/local host file
set Set a domain in the hosts file
remove Remove a set of host entries from URL or local path
search Search related domain records in hosts file
use Use a(n) origin hosts path or an ALIAS_NAME(see `hfm ls`)
unuse Unuse a(n) origin hosts path or an ALIAS_NAME(see `hfm ls`)
help Print help for hfm
```### list|ls
> List origin or local host files alias
```bash
$ ./bin/cli.js ls
* Google https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts
* GoogleMirror https://coding.net/u/scaffrey/p/hosts/git/raw/master/hosts-files/hosts
```### show
> Show all current domain records in hosts file
```bash
$ hfm show
# ----------------------------
# SYSTEM
127.0.0.1 localhost
255.255.255.255 broadcasthost
```### set [ip] [domain]
> Set a domain in the hosts file
### remove [domain]
> Remove a set of host entries from URL or local path
### alias [name] [path]
> Alias a(n) origin/local host file
> `path` could be local path or URL### del [name]
> Unalias a(n) origin/local host file
### search [domain]
> Search related domain records in hosts file
```bash
$ hfm search \.com$
$ hfm search google.*
$ hfm search www.google.com
```### use [alias]
> Use a(n) origin hosts path or an ALIAS_NAME(see `hfm ls`)
```bash
$ hfm use Google
```### unuse [alias]
> Unuse a(n) origin hosts path or an ALIAS_NAME(see `hfm ls`)