PHPackages                             runcmf/runcli - 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. [Database &amp; ORM](/categories/database)
4. /
5. runcmf/runcli

ActiveLibrary[Database &amp; ORM](/categories/database)

runcmf/runcli
=============

RunCli - Command Line Interface. \[migrate, seed, generate migrations and seeds from existing database, create database, generate resources and much more :)\]

0.1.1(9y ago)136Apache 2PHPPHP &gt;=5.5.0

Since Dec 4Pushed 9y ago1 watchersCompare

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

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

[![Build Status](https://camo.githubusercontent.com/e7fa9cc7e4ce4ba1a7112fa48c7db786fb4612676005efdd02380f2d67b6aa70/68747470733a2f2f7472617669732d63692e6f72672f72756e636d662f72756e636c692e737667)](https://travis-ci.org/runcmf/runcli)[![Coverage Status](https://camo.githubusercontent.com/0ab64a0c471e839418a458a53c44c03bb655cf1a91be28efd5ca01c2769ba0c9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72756e636d662f72756e636c692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/runcmf/runcli?branch=master)[![Code Climate](https://camo.githubusercontent.com/9332d2848a6b46569e654d2a7bea2427570c6c077c7949f9158a5b3aa0135c64/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f72756e636d662f72756e636c692f6261646765732f6770612e737667)](https://codeclimate.com/github/runcmf/runcli)[![Latest Version on Packagist](https://camo.githubusercontent.com/65694581550fbe67f584bac85889fcae98b9d77a1b5d1a76f12f16d8fff59de3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72756e636d662f72756e636c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/runcmf/runcli)[![Total Downloads](https://camo.githubusercontent.com/d166710184a298345262e79f102d6a57a938c5f6ba2c9c916abe41bca7cf0aa7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72756e636d662f72756e636c692e7376673f7374796c653d666c61742d737175617265)](https://github.com/runcmf/runcli)[![Software License](https://camo.githubusercontent.com/f796eda07db57a327e15c16a203fa273d73959c234eb72e65db2c171133548cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322d677265656e2e7376673f7374796c653d666c61742d737175617265)](http://www.apache.org/licenses/LICENSE-2.0)

\#RunCli ##Standalone command line interface.

`migrate, seed, generate migrations, models and seeds from existing database, generate resources, create database`

supported driver `mysql, pgsql, sqlite`

```
$ mysql -V
mysql  Ver 15.1 Distrib 10.1.16-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

$ psql --version
psql (PostgreSQL) 9.4.9

$ sqlite3
SQLite version 3.8.2 2013-12-06 14:53:30
```

main objective was generate [Eloquent ORM](https://github.com/illuminate/database) migrations from existing database outside [Laravel](https://github.com/laravel/laravel)in my case [Eloquent ORM](https://github.com/illuminate/database) used with [Slim 3 Framework](https://github.com/slimphp/Slim)

Install
-------

[](#install)

```
$ composer require runcmf/runcli
```

- copy or `ln -s` cli to scripts\_root/bin

\#Config: script looking config in paths:
app/Config/Settings.php [runcmf/runcmf-skeleton](https://bitbucket.org/1f7/runcmf-skeleton.git)
app/settings.php [akrabat/slim3-skeleton](https://github.com/akrabat/slim3-skeleton)

config must contain \['settings'\]\['db'\] section. for example:

```
defined('DS') || define('DS', DIRECTORY_SEPARATOR);
define('DIR', realpath(__DIR__.'/../../') .DS);

return [
  'settings' => [
    'displayErrorDetails' => true,
    'determineRouteBeforeAppMiddleware' => true,
    'addContentLengthHeader' => false,
    'routerCacheFile' => DIR . 'var/cache/fastroute.cache',
    'db' => [// database configuration
      'default' => 'sqlite',
      'connections' => [
        'sqlite' => [
          'driver'   => 'sqlite',
          'database' => DIR . 'var/database/database.sqlite',
          'prefix'   => 'mybb_',
        ],
        'mysql' => [
          'driver'    => 'mysql',
//          'engine'    => 'MyISAM',
          'engine'    => 'InnoDB',
          'host'      => '127.0.0.1',
          'database'  => 'run',
          'username'  => 'dbuser',
          'password'  => '123',
          'charset'   => 'utf8',
          'collation' => 'utf8_unicode_ci',
          'prefix'    => 'mybb_',
        ],
        'pgsql' => [
          'driver'   => 'pgsql',
          'host'     => '127.0.0.1',
          'database' => 'run',
          'username' => 'dbuser',
          'password' => '123',
          'charset'  => 'utf8',
          'prefix'   => 'mybb_',
          'schema'   => 'public',
        ],
        'sqlsrv' => [
          'driver'   => 'sqlsrv',
          'host'     => '127.0.0.1',
          'database' => 'run',
          'username' => 'dbuser',
          'password' => '123',
          'prefix'   => '',
        ],
      ],
    ],
    ...
    ...
    ...
```

Usage:
======

[](#usage)

Seed &amp; Migrate
------------------

[](#seed--migrate)

```
php bin/cli migrate:fill
```

[![example](ss/ss1.png "migrate fill")](ss/ss1.png)

```
php bin/cli seed:fill
```

[![example](ss/ss2.png "seed fill")](ss/ss2.png)

Generate migration from existing database:
------------------------------------------

[](#generate-migration-from-existing-database)

> redone from [Xethron](https://github.com/Xethron/migrations-generator) with part of code doctrine/dbal but **without** Laravel, way/generators

```
php bin/cli migrate:generate
```

[![example](ss/ss3.png "generate migrations")](ss/ss3.png)\###*Generator info:*\####Know problems:

```
`regip` varbinary(16) NOT NULL DEFAULT '',
`lastip` varbinary(16) NOT NULL DEFAULT '',

with keys
ADD KEY `regip` (`regip`),
ADD KEY `lastip` (`lastip`);
```

migrated to

```
$table->binary('regip', 16)->default('')->index('regip');
$table->binary('lastip', 16)->default('')->index('lastip');
```

with migrate exception:

```
[Illuminate\Database\QueryException]
  SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'regip' used in key specification without a key length (SQL: alter table `mybb_users` add index `regip`(`regip`))
```

solution 1: if you want use binary(16):

```
comment index
$table->binary('regip', 16)->default('');//->index('regip');
$table->binary('lastip', 16)->default('');//->index('lastip');

and add in `up` section
DB::statement('CREATE INDEX regip_idx ON '.DB::getTablePrefix().'users (regip(16));');
DB::statement('CREATE INDEX lastip_idx ON '.DB::getTablePrefix().'users (lastip(16));');

and add in `down` section
DB::schema()->table('users', function($table) {
  $table->dropIndex('regip_idx');
});
DB::schema()->table('users', function($table) {
  $table->dropIndex('lastip_idx');
});
```

solution 2: refactor your code with **ipAddress** [Eloquent ORM ipAddress](https://laravel.com/docs/master/migrations)

```
$table->ipAddress('visitor');
```

solution 3:

Generate seeds from existing database:
--------------------------------------

[](#generate-seeds-from-existing-database)

> redone from [orangehill/iseed](https://github.com/orangehill/iseed)

```
php bin/cli seed:generate
```

[![example](ss/ss4.png "seed generate")](ss/ss4.png)

Generate models from existing database:
---------------------------------------

[](#generate-models-from-existing-database)

> redone from [user11001/eloquent-model-generator](https://github.com/pepijnolivier/Eloquent-Model-Generator)

```
php bin/cli model:generate --namespace='YourNameSpace\Models'
```

[![example](ss/ss5.png "models generate")](ss/ss5.png)

Create database
---------------

[](#create-database)

```
php bin/cli make:db [schema] [charset] [collation]
```

schema - OPTIONAL, schema name from config or exception generated on empty config value;
charset - OPTIONAL, default value \[MySQL = **utf8**, PostgreSQL = **UTF8**\];
collation - OPTIONAL, default value \[MySQL = **utf8\_general\_ci**, PostgreSQL = **en\_US.UTF-8**\];

Tests
-----

[](#tests)

```
$ cd vendor/runcmf/runtracy
$ composer update
$ vendor/bin/phpunit
```

Security
--------

[](#security)

If you discover any security related issues, please email to 1f7.wizard( at )gmail.com instead of using the issue tracker.

Credits
-------

[](#credits)

-
-
-

License
-------

[](#license)

[Apache License Version 2.0](LICENSE.md)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

3477d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16786165?v=4)[Vladimir](/maintainers/1f7)[@1f7](https://github.com/1f7)

---

Top Contributors

[![1f7](https://avatars.githubusercontent.com/u/16786165?v=4)](https://github.com/1f7 "1f7 (27 commits)")

---

Tags

climigrationdatabaseslim3Eloquent ORMslim 3generate migrationsRunCMF

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/runcmf-runcli/health.svg)

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

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M614](/packages/spatie-laravel-medialibrary)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M341](/packages/psalm-plugin-laravel)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M91](/packages/mongodb-laravel-mongodb)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[dbout/wp-orm

WordPress ORM with Eloquent.

12910.3k1](/packages/dbout-wp-orm)[dragon-code/migrate-db

Easy data transfer from one database to another

15622.1k](/packages/dragon-code-migrate-db)

PHPackages © 2026

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