{"id":13581581,"url":"https://github.com/goodhosts/cli","last_synced_at":"2025-04-15T14:59:41.423Z","repository":{"id":40250979,"uuid":"234993518","full_name":"goodhosts/cli","owner":"goodhosts","description":"Simple hosts file management in a Go cli","archived":false,"fork":false,"pushed_at":"2024-01-25T04:57:09.000Z","size":11298,"stargazers_count":33,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T14:59:31.512Z","etag":null,"topics":["cli","go","golang","hosts","hosts-file","hosts-file-edit","hosts-manage","hostsfile"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goodhosts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-20T01:11:39.000Z","updated_at":"2025-03-16T06:11:07.000Z","dependencies_parsed_at":"2023-10-02T04:32:45.057Z","dependency_job_id":"e20c6dd1-172d-450e-a1d7-887abfc7f788","html_url":"https://github.com/goodhosts/cli","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodhosts%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodhosts%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodhosts%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodhosts%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goodhosts","download_url":"https://codeload.github.com/goodhosts/cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094940,"owners_count":21211837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","go","golang","hosts","hosts-file","hosts-file-edit","hosts-manage","hostsfile"],"created_at":"2024-08-01T15:02:06.389Z","updated_at":"2025-04-15T14:59:41.404Z","avatar_url":"https://github.com/goodhosts.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# goodhosts cli, fork of Lex Toumbourou's project [goodhosts](https://github.com/lextoumbourou/goodhosts)\n\n[![codecov](https://codecov.io/gh/goodhosts/cli/graph/badge.svg?token=S926B79ZJS)](https://codecov.io/gh/goodhosts/cli)\n[![Go Reference](https://pkg.go.dev/badge/github.com/goodhosts/cli.svg)](https://pkg.go.dev/github.com/goodhosts/cli)\n[![Go Report Card](https://goreportcard.com/badge/github.com/goodhosts/cli)](https://goreportcard.com/report/github.com/goodhosts/cli)\n\nSimple [hosts file](http://en.wikipedia.org/wiki/Hosts_%28file%29) (```/etc/hosts```) management in a Go cli. One simple\ninterface for any OS or architecture, script and automate hosts file updates using one simple tool.\n\n## Features\n\n- List, add, remove and check hosts file entries from code or the command-line\n  - Remove by IP, Host, or IP/Host\n  - `check` returns proper exit codes for scripting e.g. `goodhosts check 10.0.5.12 || echo \"Missing hosts entry for 10.0.5.12\"`\n- Clean hostsfile command will\n - Consolidate duplicate IPs\n - Remove duplicate hosts\n - Alpha sort Hosts\n - Sort IPs\n - Help with OS limitations, e.g. 9 hosts per IP line in windows\n- linux/darwin/windows support\n- Custom hosts file support\n- Backup/Restore\n- Quick inline editor (vim/nano)\n\n## Installation\n\nVisit the [releases](https://github.com/goodhosts/cli/releases/) page and download the proper binary for your\narchitecture. Unzip and run in place, put in your system path (linux: `/usr/local/bin` win: `~/bin`) for easier access.\n\n## Usage\n\nFor full usage directions simply call `goodhosts -h`\n\n```shell\n$ goodhosts -h\n  NAME:\n    goodhosts - manage your hosts file goodly\n\n  USAGE:\n     goodosts [global options] command [command options] [arguments...]\n  \n  COMMANDS:\n     add, a         Add an entry to the hostsfile\n     backup         Backup hosts file\n     check, c       Check if ip or host exists\n     clean, cl      Clean the hostsfile by doing: remove dupe IPs, for each IPs remove dupe hosts and sort, sort all IPs, split hosts per OS limitations\n     debug, d       Show debug table for hosts file\n     edit, e        Open hosts file in an editor, default vim\n     list, ls       List all entries in the hostsfile\n     remove, rm, r  Remove ip or host(s) if exists\n     restore        Restore hosts file from backup\n     version\n     help, h        Shows a list of commands or help for one command\n  \n  GLOBAL OPTIONS:\n     --file value, -f value  override the default hosts: ${SystemRoot}/System32/drivers/etc/hosts\n     --debug, -d             Turn on verbose debug logging (default: false)\n     --quiet, -q             Turn on off all logging (default: false)\n     --help, -h              show help (default: false)\n```\n\nEach sub-command can be called with a `-h` option to see detailed help information.\n```shell\n\n $ ./goodhosts list -h\n NAME:\n    goodhosts list - List all entries in the hostsfile\n\n USAGE:\n    goodhosts list [command options] [arguments...]\n\n OPTIONS:\n    --all       Show all entries in the hosts file including commented lines. (default: false)\n    --help, -h  show help (default: false)\n```\n\n## License\n\n[MIT](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodhosts%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodhosts%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodhosts%2Fcli/lists"}