PHPackages                             nafigator/bash-helpers - 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. nafigator/bash-helpers

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

nafigator/bash-helpers
======================

Collections of useful functions for usage in Bash scripts.

1.1.4(1y ago)59.0k1MITShellCI passing

Since Aug 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nafigator/bash-helpers)[ Packagist](https://packagist.org/packages/nafigator/bash-helpers)[ RSS](/packages/nafigator-bash-helpers/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependenciesVersions (33)Used By (1)

bash-helpers
============

[](#bash-helpers)

[![GitHub license](https://camo.githubusercontent.com/37c3f6b0888b98b46bdd7c27883dacc31f42884073d2622d5cd169344658bf30/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6166696761746f722f626173682d68656c706572733f6c6f676f436f6c6f723d33333326636f6c6f723d7465616c)](https://tldrlegal.com/license/mit-license) [![GitHub release](https://camo.githubusercontent.com/f36a4a158168a4f0a16ffc1ce37a331ce1fde3d04bc0b95532668c07b56307cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f6e6166696761746f722f626173682d68656c706572733f6c6f676f3d676974687562266c6162656c436f6c6f723d33333326636f6c6f723d7465616c)](https://github.com/nafigator/bash-helpers) [![Github main status](https://github.com/nafigator/bash-helpers/actions/workflows/daily.yml/badge.svg?branch=main)](https://github.com/nafigator/bash-helpers/actions?query=branch%3Amain) [![Conventional Commits](https://camo.githubusercontent.com/347c8842fe2aab70502e8b637806625c30f08185fd94838e247f183179cb21ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e76656e74696f6e616c253230436f6d6d6974732d312e302e302d7465616c2e737667)](https://conventionalcommits.org) [![Semantic Versioning](https://camo.githubusercontent.com/e3a4b047f5dd7d014f21b3a6a2852c924ad5cbb1f0f8da540464b6ab9b3a53ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656d616e74696325323056657273696f6e696e672d322e302e302d7465616c2e737667)](https://semver.org)

**Collection of useful functions for usage in Bash scripts**

Usage
-----

[](#usage)

 Without installation```
#!/usr/bin/env bash

source  **NOTE**: For logging purpose colors may be disabled by global `INTERACTIVE` variable:
    >
    > INTERACTIVE=
- **Functions for nicely formatted messages `error`, `inform`, `warning`.**

    Examples:

    ```
     inform 'Script start'
     warning 'Make backup!'
     error 'File not found'
    ```

    [![Messages formatting](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/messages-formatting.jpg)](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/messages-formatting.jpg)
- **Libs including.**

    Example:

    ```
     include google/client || exit 1
     include mysql/query-builder || exit 1
     include logger; status 'Logger including' $? || exit 1
    ```
- **Status messages.**

    Example:

    ```
     test -d /usr/local/nonexistent
     status 'Check /usr/local/nonexistent dir' $?
     test -d /usr/local/bin
     status 'Check /usr/local/bin dir' $?
    ```

    [![Status messages](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/status-messages.jpg)](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/status-messages.jpg)
- **Checking dependencies.**

    Example:

    ```
     check_dependencies yarn rust || exit 1
    ```

    [![Check dependencies](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/check-dependencies.jpg)](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/check-dependencies.jpg)
- **Debug messages and statuses.**

    Example:

    ```
     debug 'This message is hidden'
     status_dbg 'This status is hidden' $?
     DEBUG=1
     debug 'Visible because of DEBUG variable'
     test -d /nonexists
     status_dbg 'Visible because of DEBUG variable' $?
     test -d /var/log
     status_dbg 'Visible because of DEBUG variable' $?
    ```

    [![Debug messages](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/debug-messages.jpg)](https://raw.githubusercontent.com/nafigator/bash-helpers/master/.images/debug-messages.jpg)

Message statuses
----------------

[](#message-statuses)

```
[ OK ] - success status
[FAIL] - fail status
[ ?? ] - debug message
[ ++ ] - success debug status
[ -- ] - fail debug status

```

Versioning
----------

[](#versioning)

This software follows *"Semantic Versioning"* specifications. All function signatures declared as public API.

Read more on [SemVer.org](http://semver.org).

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance49

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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 ~67 days

Recently: every ~333 days

Total

32

Last Release

390d ago

Major Versions

0.16.4 → 1.0.02021-04-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/c171f2966ae0908bc06e7a1cb586483a65edc32f38c7db26ee7cd663fad01d87?d=identicon)[nafigat0r](/maintainers/nafigat0r)

---

Top Contributors

[![nafigator](https://avatars.githubusercontent.com/u/1971423?v=4)](https://github.com/nafigator "nafigator (95 commits)")

---

Tags

bashbash-scriptincludesshellscriptsbash

### Embed Badge

![Health badge](/badges/nafigator-bash-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/nafigator-bash-helpers/health.svg)](https://phpackages.com/packages/nafigator-bash-helpers)
```

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[seregazhuk/php-watcher

Automatically restart PHP application once the source code changes

394137.8k4](/packages/seregazhuk-php-watcher)[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24032.0k2](/packages/alecrabbit-php-console-spinner)[mikehaertl/php-shellcommand

An object oriented interface to shell commands

32437.5M61](/packages/mikehaertl-php-shellcommand)[nystudio107/craft-scripts

Shell scripts to manage database backups, asset backups, file permissions, asset syncing, cache clearing, and database syncing between Craft CMS environments

36262.5k5](/packages/nystudio107-craft-scripts)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)

PHPackages © 2026

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