PHPackages                             jonpugh/ash - 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. jonpugh/ash

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

jonpugh/ash
===========

Global CLI for managing sites using Consolidation Site Aliases.

1.0.2(2y ago)101.6k↓50%[2 issues](https://github.com/jonpugh/ash/issues)[2 PRs](https://github.com/jonpugh/ash/pulls)MITPHP

Since Sep 12Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/jonpugh/ash)[ Packagist](https://packagist.org/packages/jonpugh/ash)[ RSS](/packages/jonpugh-ash/feed)WikiDiscussions main Synced 1mo ago

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

Ash: Site Alias Shell
=====================

[](#ash-site-alias-shell)

A global CLI to list sites and run commands on them. Very similar to global `drush site:alias` command.

Overview
--------

[](#overview)

This project is a global cli designed to run commands against multiple sites using Consolidation's [Site Aliases](https://github.com/consolidation/site-alias).

This is a possible replacement for global Drush.

Commands
--------

[](#commands)

```
site
site:exec        [e] Run a command against a site (in the root directory.)
site:get         [get] Show contents of a single site alias.
site:list        [sl|ls] List available site aliases.
site:value       Access a value from a single alias.
site-spec
site-spec:parse  Parse a site specification.

```

Alias syntax
------------

[](#alias-syntax)

For simpler access to the `site:exec` command, you can use the alias syntax:

```
    ash @alias command-to-execute

```

History
-------

[](#history)

This tool was built from the ashes of a small tool created by the `consolidation/site-alias` team called [alias-tool](https://github.com/consolidation/site-alias/blob/3.0.1/alias-tool).

It was inspired by the need to retire global drush.

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

[](#installation)

Ash is a CLI designed to run globally, but can be installed in a composer project as well. Here are 3 options for installing:

1. Site local `composer require`

    ```
     composer require jonpugh/ash`

    ```
2. Composer Global require command and add to PATH:

    1. Run the following command to install `ash` to your user's global composer directory:

        ```
         composer global require jonpugh/ash

        ```
    2. To make `ash` available globally, set the PATH variable:

        ```
         export PATH="~/$COMPOSER_HOME/vendor/bin:$PATH"

        ```

        Put this in your `~/.bashrc` or similar file.

    Notes:

    - This will install a `composer.json` file to the global `COMPOSER_HOME` directory.
    - The bin scripts will be installed in `$COMPOSER_HOME/vendor/bin`.
    - Your `COMPOSER_HOME` may vary. Refer to the `composer global --help` command for more information about `COMPOSER_HOME`.
    - From `composer global --help`:

        ```
        You can use this to install CLI utilities globally, all you need
        is to add the COMPOSER_HOME/vendor/bin dir to your PATH env var.

        COMPOSER_HOME is c:\Users\AppData\Roaming\Composer on Windows
        and /home//.composer on unix systems.

        If your system uses freedesktop.org standards, then it will first check
        XDG_CONFIG_HOME or default to /home//.config/composer

        Note: This path may vary depending on customizations to bin-dir in
        composer.json or the environmental variable COMPOSER_BIN_DIR.

        Read more at https://getcomposer.org/doc/03-cli.md#global
        ```

        ```
3. Source install.

    For development, install the source, and if desired, set a symlink to make `ash` available globally.

    ```
    git clone git@github.com:jonpugh/ash.git
    cd ash
    composer install
    sudo ln -s $PWD/ash /usr/local/bin/ash

    ```
4. Phar install.

    Coming Soon.

Setup
-----

[](#setup)

Once the `ash` command works, you need to tell it where your sites are. You can create alias files manually, or use the `site:add` command.

### `ash site:add`

[](#ash-siteadd)

This command makes it easy to add new global site aliases.

To use, run `ash site:add` in the directory to your Drupal site. (@todo: allow adding from any directory)

If your site has the file `./drush/sites/self.yml`, these aliases will be included in the global alias list.

Configuration
-------------

[](#configuration)

See [ash.yml](ash.yml) for default config:

```
# Copy this file to ~/.ash/ash.yml if overriding is needed.
ash:
  alias_directories:
    - "${env.HOME}/.ash"
```

Put alias files in one of the directories defined in `alias_directories`.

Remember to name the files `$APP.site.yml` instead of `self.site.yml`

See Drush [Site Alias Documentation](https://www.drush.org/12.x/site-aliases/) for details on how to create alias files.

Usage
-----

[](#usage)

Given you have added the example file [examples/operations.site.yml](./examples/operations.site.yml) to `$HOME/.ash/operations.site.yml`, you can run the following commands:

### List all aliases

[](#list-all-aliases)

```
# List all aliases from global config (~/.ash/*)
$ ash ls
'@ash.operations.local':
  root: /home/jonpugh/Work/Operations/operations/web
  uri: 'https://operations.lndo.site'
  env:
    HOME: /home/jonpugh
'@ash.operations.mars':
  root: /home/jonpugh/Work/Operations/operations/web
  uri: 'https://mars.lndo.site'
  env:
    HOME: /home/jonpugh
```

### List site local aliases.

[](#list-site-local-aliases)

If you are running `ash` from a drupal codebase, it will detect and load all aliases in the `drush/sites` folder.

```
# List all aliases from a specific site.
$ cd path/to/myproject
$ ash ls
'@self.prod':
  host: sites.watch
  user: platform
  root: /var/platform/projects/siteswatch/prod
  uri: 'https://sites.watch'
$ ash exec @self.prod drush status
```

These aliases are also compatible with drush.

### Run a command on the site

[](#run-a-command-on-the-site)

The main `ash site:exec` command uses `SiteAlias` &amp; `SiteProcess`, so commands will automatically be run on the remote server via SSH. See additional options at

Docker-compose aliases can also be used. )

```
# Execute a command in the site's folder, on the site's server.
$ ash exec @self.prod drush status
Drupal version : 9.5.10
Site URI       : http://default
PHP binary     : /usr/bin/php8.1
PHP config     : /etc/php/8.1/cli/php.ini
PHP OS         : Linux
PHP version    : 8.1.20
```

If options are needed, use the `--` as divider between `ash` command and target command.

```
$ ash exec @ash.operations.live -- drush wd-tail --extended
```

Ash aliases are drush aliases, so this is an equivalent command:

```
$ drush @ash.operations.live wd-tail --extended
```

@TODO
-----

[](#todo)

- Allow aliases to only contain name.environment. Currently all aliases get `@ash` pre-pended.
- Allow syntax `ash @alias command` instead of `ash site:exec @alias command`. Need to find out how drush processes argv to set current alias.

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

[](#contributing)

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/consolidation/site-alias/releases) page.

Authors
-------

[](#authors)

- **Jon Pugh**
- **Greg Anderson** - Original `alias-tool` script and command files.

See also the list of [contributors](https://github.com/jonpugh/ash/contributors) who participated in this project. Thanks also to all of the [drush contributors](https://github.com/drush-ops/drush/contributors) who contributed directly or indirectly to site aliases.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance43

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Every ~1 days

Total

3

Last Release

977d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10539fb9e887c35b626eba70c97dd9d53ba14e987d4f129b55a488664a834eca?d=identicon)[jonpugh](/maintainers/jonpugh)

---

Top Contributors

[![jonpugh](https://avatars.githubusercontent.com/u/106420?v=4)](https://github.com/jonpugh "jonpugh (68 commits)")

### Embed Badge

![Health badge](/badges/jonpugh-ash/health.svg)

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

###  Alternatives

[drush/drush

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2.4k57.4M685](/packages/drush-drush)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M13](/packages/pantheon-systems-terminus)[jigarius/drall

Drall is a command-line utility to run drush on multi-site Drupal installations.

35105.9k](/packages/jigarius-drall)[chromatic/usher

A collection of Robo commands for use on Chromatic projects.

13534.3k1](/packages/chromatic-usher)[openeuropa/task-runner

PHP task runner based on Robo, focused on extensibility.

37208.7k14](/packages/openeuropa-task-runner)[boedah/robo-drush

Drush CommandStack for Robo Task Runner

22344.5k4](/packages/boedah-robo-drush)

PHPackages © 2026

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