PHPackages                             spaceboy/datex - 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. spaceboy/datex

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

spaceboy/datex
==============

Simple command line tool for easy creating PHP entity, form and model classes in Nette PHP framework

v1.00(4y ago)14MITPHPPHP &gt;=7.2

Since Mar 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/spaceboy/datex)[ Packagist](https://packagist.org/packages/spaceboy/datex)[ RSS](/packages/spaceboy-datex/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Datex
=====

[](#datex)

Simple command line tool for rapid development of database-related routines work (creating *entity*, *form* and *model* PHP classes/files) under PHP/Nette framework environment.

1 Installation
--------------

[](#1-installation)

### 1.1 Install tool

[](#11-install-tool)

In command line, type

```
>composer require spaceboy/datex

```

### 1.2 Copy script file

[](#12-copy-script-file)

Copy file `datex.php` from

```
APP_ROOT/vendor/spaceboy/datex/bin/datex.php

```

to

```
APP_ROOT/app/bin/datex.php

```

### 1.3 Register service DatexModel

[](#13-register-service-datexmodel)

In `APP_ROOT/config/services.neon` add service into service list:

```
services:
	- Spaceboy\Datex\DatexModel(%datex%)

```

2 Configuration
---------------

[](#2-configuration)

### 2.1 Add configuration parameters

[](#21-add-configuration-parameters)

In `APP_ROOT/config/services.neon` add `datex` section into `parameters`:

```
parameters:
	datex:
		entity:
			namespace: App\Model\Entities
			path: app/model/entities
			template: templateEntity.phtml
		form:
			namespace: App\Forms
			path: app/forms
			template: templateForm.phtml
		model:
			namespace: App\Model
			path: app/model/models
			template: templateModel.phtml

```

### 2.2 Connect to database

[](#22-connect-to-database)

Before first run, make sure your database connection is correctly set.

In `database` section of your config file (`APP_ROOT/config/local.neon` or `APP_ROOT/config/common.neon`) should be your DB connection described somehow like that:

```
database:
	dsn: 'mysql:host=127.0.0.1;dbname=my_database'
	user: db_user
	password: *****

```

Use script
----------

[](#use-script)

In command line terminal, go to the `APP_ROOT/bin` directory and try very first run:

```
>php datex.php

```

If anything goes wrong, **clear the cache** and try again.

Works? Great. You can use the script in simple, classic way:

```
>php datex.php command [--parameter] [--switch]

```

### Commands:

[](#commands)

**tables**

```
>php datex.php tables

```

Writes list of accessible tables and views in database.

**columns**

```
>php datex.php columns --table table_name
>php datex.php columns -t=table_name

```

Writes list of columns of database table.

**entity**

```
>php datex.php entity --table table_name [--file path/to/EntityFile.php] [--overwrite] [--screen]
>php datex.php entity -t=table_name [-f="path/to/EntityFile.php"] [-o] [-s]

```

Creates PHP **entity** file based on colums of database table.

The file is placed in default directory declared in *config* section, or specified if *file* parameter of script.

If the target file already exists, script halts unless the `---overwite` (`-o`) switch is used.

If the `--screen` (`-s`) switch is used, source code of PHP file is shown on screen and no file is written.

**form**

```
>php datex.php form --table table_name [--file path/to/EntityFile.php] [--overwrite] [--screen]
>php datex.php form -t=table_name [-f="path/to/EntityFile.php"] [-o] [-s]

```

Works same way as *entity* command, except that creates nette **form** file based on colums of database table.

**model**

```
>php datex.php model --table table_name [--file path/to/EntityFile.php] [--overwrite] [--screen]
>php datex.php model -t=table_name [-f="path/to/EntityFile.php"] [-o] [-s]

```

Works same way as *entity* and *form* command, except that creates PHP **model** file based on colums of database table.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

1524d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09d6444dda5f70a00423d2d049409f3670a49c0c2d008add06820d45c4f680e6?d=identicon)[spaceboy](/maintainers/spaceboy)

---

Top Contributors

[![spaceboy](https://avatars.githubusercontent.com/u/419521?v=4)](https://github.com/spaceboy "spaceboy (2 commits)")

---

Tags

phpclinette

### Embed Badge

![Health badge](/badges/spaceboy-datex/health.svg)

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

###  Alternatives

[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[mehrancodes/laravel-harbor

A CLI tool to Quickly create On-Demand preview environment for your apps.

9989.0k](/packages/mehrancodes-laravel-harbor)[alecrabbit/php-cli-snake

Lightweight cli spinner with zero dependencies

29211.3k5](/packages/alecrabbit-php-cli-snake)

PHPackages © 2026

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