PHPackages                             kivagant/runonce - 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. kivagant/runonce

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

kivagant/runonce
================

Run any shell command only once (deny concurrent execution)

0.0.4(10y ago)026Apache License v2.0PHP

Since May 10Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kivagant/runonce)[ Packagist](https://packagist.org/packages/kivagant/runonce)[ Docs](https://github.com/KIVagant/runonce)[ RSS](/packages/kivagant-runonce/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

RunOnce
=======

[](#runonce)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/99ea5d0285fdee735209d27f052c3254aa6f8e15e9a6f35f82b2b57e367964e2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b49566167616e742f72756e6f6e63652f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/kivagant/runonce)

About
-----

[](#about)

[RunOnce](bin/runonce) is the php-based Unix tool that help you to run any command only once. This tool will only execute command and will not waiting for result.

Warnings
--------

[](#warnings)

NO WARRANTY implied!

Only Unix is supported. This tool does not working neither in OSX nor in Windows. Tested in RHEL 7.

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

[](#installation)

Download this repo somewhere or run.

```
composer require kivagant/runonce

```

Usage and examples
------------------

[](#usage-and-examples)

Basic usage:

```
 ./vendor/bin/runonce your-command

```

Verbose output:

```
 ./vendor/bin/runonce -v your-command

```

**Example 1:**

*Run first command:*

```
./vendor/bin/runonce sleep 10 && echo 'first launch' || echo 'already running';
> first launch

```

*Run another one:* different options are considered as different processes.

```
./vendor/bin/runonce sleep 20 && echo 'first launch' || echo 'already running';
> first launch

```

*Run the first command again:*

```
./vendor/bin/runonce sleep 10 && echo 'first launch' || echo 'already running';
> already running

```

**Example 2:**

*More complex commands:*

```
./vendor/bin/runonce php ./cron.php -v=\"some string\" && echo 'first launch' || echo 'already running';
> first launch

./vendor/bin/runonce -v php ./cron.php -v=\"some string\" && echo 'first launch' || echo 'already running';
> Command was already executed with PID  20438
> already running

```

Dependencies
------------

[](#dependencies)

This tool based on the [liip/process-manager](http://github.com/liip/LiipProcessManager.git).

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

[](#contributing)

Just fork and send me a pull request.

License
-------

[](#license)

Apache License 2.0

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

4

Last Release

3703d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/815e11f1b4574991a9aa2d0df6beb2d983e9eca63ea7ab0b29f419a38f24c54f?d=identicon)[KIVagant](/maintainers/KIVagant)

---

Top Contributors

[![KIVagant](https://avatars.githubusercontent.com/u/517501?v=4)](https://github.com/KIVagant "KIVagant (9 commits)")

---

Tags

shellpidonce

### Embed Badge

![Health badge](/badges/kivagant-runonce/health.svg)

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k569.8M787](/packages/psy-psysh)[mikehaertl/php-shellcommand

An object oriented interface to shell commands

32439.6M69](/packages/mikehaertl-php-shellcommand)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3426.9M45](/packages/kevinlebrun-colorsphp)[mrrio/shellwrap

Use any command-line tool as a PHP function.

738210.3k2](/packages/mrrio-shellwrap)[alecrabbit/php-console-spinner

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

24035.5k2](/packages/alecrabbit-php-console-spinner)[stepanenko3/nova-command-runner

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

361.0M](/packages/stepanenko3-nova-command-runner)

PHPackages © 2026

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