PHPackages                             flatline/hosts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. flatline/hosts

ActiveLibrary[CLI &amp; Console](/categories/cli)

flatline/hosts
==============

CLI tool to manage hosts file

0.1.0(13y ago)3201PHP

Since Apr 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Cosmicist/hosts)[ Packagist](https://packagist.org/packages/flatline/hosts)[ RSS](/packages/flatline-hosts/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Hosts Manager
=============

[](#hosts-manager)

Hosts Manager is a utility to quickly and easily manage hosts in your hosts file.

Requirements
------------

[](#requirements)

- [Composer](http://getcomposer.org/)
- php 5.4+

Installation
------------

[](#installation)

1. Run `git clone git@github.com:xFlatlinex/hosts.git` to clone the repo.
2. Run `composer install` to install dependencies.

At this point you should be able to run it like this `php bin/hosts`.

### Global installation

[](#global-installation)

There are two ways to install it. Using composer global or compile the phar and move it to your corresponding `bin` dir. Note that both methods need composer, but the first one needs composer to be installed globally.

After you install it you should be able to run it directly:

```
$ hosts add somehost
```

#### With Composer installed globally

[](#with-composer-installed-globally)

First, make sure you have ~/.composer/vendor/bin/ in your path.
Then run the following composer command:

```
$ composer global require 'flatline/hosts=dev-master'
```

#### With Composer phar

[](#with-composer-phar)

This way, you need to compile it to a single phar file and then copy it to `/usr/local/bin`.

1. Clone the repo and install dependencies.
2. Generate `hosts.phar` by running `php bin/compile`
3. Run `sudo cp hosts.phar /usr/local/bin/hosts`
4. Make it executable `sudo chmod a+x /usr/local/bin/hosts`

Usage
-----

[](#usage)

To get a list of options and commands run `hosts` without any parameters.

Currently available commands:

- Run `hosts add [hostname] [options]` to add a host
- Run `hosts toggle [hostname] [options]` to enable/disable a host
- Run `hosts show [options]` to show a list of hosts
- Run `hosts remove [options]` to remove a host from the hosts file

All of the commands have several options and filters, you can check them out by running `hosts help [command]`.

Contributing
------------

[](#contributing)

This is a work in progress, I'll be adding more commands and modifying existing ones.
This project was built to suit my needs, but if it helps you as well, fantastic! Feel free to contribute with new functionality and/or fixes!

License
-------

[](#license)

Copyright (c) 2013 Luciano Longo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4783d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/019c54e641913619a9ac66163a02515fa8187062c7128d877903cbc4acfd5391?d=identicon)[Cosmicist](/maintainers/Cosmicist)

---

Top Contributors

[![Cosmicist](https://avatars.githubusercontent.com/u/1039580?v=4)](https://github.com/Cosmicist "Cosmicist (5 commits)")

### Embed Badge

![Health badge](/badges/flatline-hosts/health.svg)

```
[![Health](https://phpackages.com/badges/flatline-hosts/health.svg)](https://phpackages.com/packages/flatline-hosts)
```

###  Alternatives

[humbug/php-scoper

Prefixes all PHP namespaces in a file or directory.

7963.0M35](/packages/humbug-php-scoper)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
