PHPackages                             teraone/slim-cli - 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. [Framework](/categories/framework)
4. /
5. teraone/slim-cli

AbandonedArchivedLibrary[Framework](/categories/framework)

teraone/slim-cli
================

Making a mock GET request through the CLI and enabling the same application entry point on CLI scripts.

2.0.0(9y ago)01.2kBSD-3-ClausePHPPHP &gt;=5.5.0

Since Dec 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/teraone/slim-cli)[ Packagist](https://packagist.org/packages/teraone/slim-cli)[ Docs](http://github.com/teraone/slim-cli)[ RSS](/packages/teraone-slim-cli/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (9)Used By (0)

[![Build Status](https://camo.githubusercontent.com/301f40e3b7a4d19c277f5ae9edbf21079f2c732ed6f7482a8f2989dee0d99967/68747470733a2f2f7472617669732d63692e6f72672f7061766c616b69732f736c696d2d636c692e737667)](https://travis-ci.org/pavlakis/slim-cli)

Slim 3 Framework CLI Request Middleware
=======================================

[](#slim-3-framework-cli-request-middleware)

This middleware will transform a CLI call into a GET Request. It is based on  but does not use the method paramter.

### Add it with composer

[](#add-it-with-composer)

```
composer require teraone/slim-cli

```

### Pass the parameters in this order

[](#pass-the-parameters-in-this-order)

`route / query string`

```
php public/index.php /status event=true
```

### Add it in the middleware section of your application

[](#add-it-in-the-middleware-section-of-your-application)

```
$app->add(new \Teraone\SlimCli\CliRequest());

```

### Pass a route to test it with

[](#pass-a-route-to-test-it-with)

```
$app->get('/status', 'YourNameSpace\YourController:yourMethod')
    ->setName('status');
```

### Check you're only using a CLI call

[](#check-youre-only-using-a-cli-call)

```
final class YourController
{
    ...

    public function yourMethod(Request $request, Response $response, $args)
    {

        // ONLY WHEN CALLED THROUGH CLI
        if (PHP_SAPI !== 'cli') {
            return $response->withStatus(404)->withHeader('Location', '/404');
        }

        if (!$request->getParam('event')) {
            return $response->withStatus(404)->withHeader('Location', '/404');
        }

        ...

    }

}
```

### Credits

[](#credits)

Based on Bobby DeVeaux's ([@bobbyjason](https://twitter.com/bobbyjason)) [Gulp Skeleton](https://github.com/dvomedia/gulp-skeleton/blob/master/web/index.php)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Total

5

Last Release

3300d ago

Major Versions

1.0.3 → 2.0.02017-05-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/34bb3ed24e78987d5f89cff121c51fd55070a90f2887eba16583a78cb77acb50?d=identicon)[teraone](/maintainers/teraone)

---

Top Contributors

[![pavlakis](https://avatars.githubusercontent.com/u/673223?v=4)](https://github.com/pavlakis "pavlakis (18 commits)")

---

Tags

middlewarecliframeworkslim

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/teraone-slim-cli/health.svg)

```
[![Health](https://phpackages.com/badges/teraone-slim-cli/health.svg)](https://phpackages.com/packages/teraone-slim-cli)
```

###  Alternatives

[slim/csrf

Slim Framework 4 CSRF protection PSR-15 middleware

3512.1M94](/packages/slim-csrf)[slim/http-cache

Slim Framework HTTP cache middleware and service provider

1242.9M27](/packages/slim-http-cache)[pavlakis/slim-cli

Making a mock GET request through the CLI and enabling the same application entry point on CLI scripts.

3691.9k3](/packages/pavlakis-slim-cli)[davidepastore/slim-validation

A slim middleware for validation based on Respect/Validation

171223.7k3](/packages/davidepastore-slim-validation)[davidepastore/slim-restrict-route

A Slim middleware to restrict ip addresses that will access to your routes

2220.6k1](/packages/davidepastore-slim-restrict-route)[davidepastore/slim-config

A slim middleware to read configuration from different files based on hassankhan/config

338.9k1](/packages/davidepastore-slim-config)

PHPackages © 2026

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