PHPackages                             recipe-runner/system-module - 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. recipe-runner/system-module

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

recipe-runner/system-module
===========================

System module with methods for executing commands and handling files

018PHP

Since Aug 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/recipe-runner/system-module)[ Packagist](https://packagist.org/packages/recipe-runner/system-module)[ RSS](/packages/recipe-runner-system-module/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

System module
=============

[](#system-module)

[![Build Status](https://camo.githubusercontent.com/3010484107e16ff0e15767ae0dc180de9eee9bbe5069db9b152f1d258291cf74/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7265636970652d72756e6e65722f73797374656d2d6d6f64756c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/recipe-runner/system-module)

Requires
--------

[](#requires)

- PHP +7.2
- [Recipe Runner](https://github.com/recipe-runner/recipe-runner)

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

[](#installation)

Create a recipe and add the module to the `packages` section:

```
name: "Your recipe"
extra:
  rr:
    packages:
      "recipe-runner/system-module": "1.0.x-dev"
```

Usage
-----

[](#usage)

### Method: `run`

[](#method-run)

Executes a command.

```
steps:
    - actions:
        - run: "echo hi user"
```

A command could be split into command and parameters. This way, parameters will be escaped automatically.

```
steps:
    - actions:
        run:
            command:
                "echo"      # Command
                "hi user"   # parameter 1
```

You can also set a timeout and the *current working directory*

```
steps:
    - actions:
        - run:
            command: "echo hi user"
            timeout: 60
            cwd: "/temp"
```

### Method: `copy_file`

[](#method-copy_file)

Makes a copy of a single file.

```
steps:
    - actions:
        - copy_file:
            from: "/dir1/file.txt"
            to: "/tmp/file.txt"
```

### Method: `download_file`

[](#method-download_file)

Download a file from network.

```
steps:
    - actions:
        - download_file:
            url: "https://phar.phpunit.de/phpunit-8.phar"
            filename: "phpunit.phar"
```

### Method: `make_dir`

[](#method-make_dir)

Makes a directory recursively. On POSIX filesystems, directories are created with a default mode value 0777.

```
steps:
    - actions:
        - make_dir: "/dir1"
```

or you can set the directory mode with the parameter `mode`

```
steps:
    - actions:
        - make_dir:
            dir: "/dir1"
            mode: 0777
```

### Method: `mirror_dir`

[](#method-mirror_dir)

Copies all the contents of the source directory into the target one.

```
steps:
    - actions:
        - mirror_dir:
            from: "/dir1"
            to: "/tmp"
```

### Method: `read_file`

[](#method-read_file)

Reads the content of a file or URL address.

```
steps:
    - actions:
        - read_file: "/tmp/hi.txt"
          register: "file_content"
```

File content available at `content`:

```
registered["file_content"]["content"]

## or

registered.get('file_content.content')
```

### Method: `remove`

[](#method-remove)

Deletes files, directories and symlinks.

```
steps:
    - actions:
        - remove: "/tmp/hi.txt"
```

or

```
steps:
    - actions:
        - remove:
            - "/tmp/hi.txt"
            - "/dir1"
            - "/home/user/symlink1.sh"
```

### Method: `write_file`

[](#method-write_file)

Saves the given contents into a file.

```
steps:
    - actions:
        - write_file:
            filename: "/tmp/hi.txt"
            content: "hi user"
```

For module developers
---------------------

[](#for-module-developers)

The preferred installation method is [Composer](https://getcomposer.org):

```
composer require recipe-runner/system-module
```

### Unit tests

[](#unit-tests)

You can run the unit tests with the following command:

```
$ cd system-module
$ composer test
```

License
-------

[](#license)

This library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![yosymfony](https://avatars.githubusercontent.com/u/3321099?v=4)](https://github.com/yosymfony "yosymfony (14 commits)")

---

Tags

modulephprecipe-runner

### Embed Badge

![Health badge](/badges/recipe-runner-system-module/health.svg)

```
[![Health](https://phpackages.com/badges/recipe-runner-system-module/health.svg)](https://phpackages.com/packages/recipe-runner-system-module)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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