PHPackages                             tareqas/psym - 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. tareqas/psym

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

tareqas/psym
============

A REPL for Symfony and PHP

v1.0.4(1y ago)17351[2 issues](https://github.com/tareqas/psym/issues)MITPHPPHP &gt;=7.2

Since Sep 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tareqas/psym)[ Packagist](https://packagist.org/packages/tareqas/psym)[ RSS](/packages/tareqas-psym/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

pSym
====

[](#psym)

A REPL for Symfony and PHP

**pSym** works both inside and outside Symfony project. When used within a Symfony project, it provides additional features such as access to variables like `$kernel`, `$container`, `$doctrine`, and `$em`. Additionally, all registered **project commands** become accessible as well.

The `lse` command and `table()`, `sql()`, and `dql()` functions are available when **Doctrine** is installed.

Function `html()` and features like `auto-completion`, `auto-suggestion`, and `doc-and-signature` work **universally**.

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

[](#installation)

To install it, create a project using `composer create-project` in your preferred location. It supports PHP versions `>=7.2` and works with Symfony versions `4`, `5`, `6`, and `7`.

```
# The home directory might be an ideal place to install
cd ~
composer create-project tareqas/psym psym
```

Next, add the `your-psym-installation-path/psym/bin/` directory to your system's PATH, so you can run the `psym` command directly from your shell.

> **Warning:** Do not install it as a global or local package; it won't work.

### Commands

[](#commands)

```
# list all the commands, including your project commands.
list
# or
?
```

### Auto-complete and Auto-suggestion

[](#auto-complete-and-auto-suggestion)

[![auto-completion](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/auto-completion.gif)](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/auto-completion.gif)

To get suggestions, press the `TAB` key.

> **Note:** Sometimes you may need to press `SPACE` first and then `TAB`.

```
# press TAB for suggestion
$kernel->
# it also works with method chaining
$kernel->getBundle()->
# press TAB for completion
$kernel->getBund
```

### Documentation and Signature

[](#documentation-and-signature)

[![documentation and signature](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/doc-and-html.gif)](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/doc-and-html.gif)

You can view PHPDoc documentation and signature for `function`, `property`, and `method`.

```
# press TAB to display the phpDoc and signature for getBundle
$kernel->getBundle
```

### lse

[](#lse)

[![lse](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/lse.gif)](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/lse.gif)

The `lse` command lists all entities managed by Doctrine.

```
# list of of all matching tables
lse ca
# list all properties, columns, types, and default values of an entity
lse cart
# list of all matching properties for the 'cart' entity
lse cart tot
```

### html()

[](#html)

```
function html(...$vars): void
```

The `html()` function dumps variables and renders them as a browsable HTML page. If any of your variables contain Doctrine objects, it will automatically instantiate all proxy objects.

You can fine-tune the dump by providing additional options in the last parameter as an associative array:

```
html($var, [
    'nestedLevel' => -1, # or 'level' - how deep it should go to instantiate doctrine proxy object
    'collectionSize' => 1, # or 'size' - cut the Doctrine association collection to this specific size
    'maxString' => -1 # cut the overlong string to this specific size
])
# -1 implies no limit.
```

### table()

[](#table)

```
function table(string $table, ?string $alias = null): EntityRepository|QueryBuilder|void
```

The `table()` function retrieves a repository for a given entity. It returns a `Doctrine\ORM\EntityRepository`if no alias is provided, or a `Doctrine\ORM\QueryBuilder` if an alias is specified.

### sql()

[](#sql)

[![sql](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/sql.gif)](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/sql.gif)

```
function sql(string $sql, array $params = []): array|void
```

The `sql()` function executes raw SQL queries and returns the result as an associative array. Doctrine is required to use this feature.

```
# press TAB to display all available tables
sql('select * from '
# press TAB to display all available columns in the 'cart' table
sql('select c. from cart c'
```

### dql()

[](#dql)

[![dql](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/dql.gif)](https://raw.githubusercontent.com/tareqas/psym/d4a4b9064035e4eb36e95e6a09a6e0de3c22ba9c/docs/images/dql.gif)

```
function dql(string $dql, array $params = []): array|void
```

The `dql()` function allows you to execute DQL queries and also returns the result as an associative array.

```
# press TAB to display all available entities
dql('select * from '
# press TAB to display all available properties in the 'Cart' entity
sql('select c. from App\Entity\Cart c'
```

> **Limitation:** Auto-completion may have limitations with entity classes due to backslashes (\\). Other features work as expected.

And more
--------

[](#and-more)

To unlock the full potential, explore the [PsySH documentation](https://psysh.org/#docs). pSym is built on top of PsySH.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

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.

###  Release Activity

Cadence

Every ~15 days

Total

5

Last Release

579d ago

### Community

Maintainers

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

---

Top Contributors

[![tareqas](https://avatars.githubusercontent.com/u/20209780?v=4)](https://github.com/tareqas "tareqas (10 commits)")

---

Tags

consolesymfonyREPLpsyshshellinteractivepsym

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/tareqas-psym/health.svg)

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k569.8M785](/packages/psy-psysh)[drupal/console

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.

93415.1M161](/packages/drupal-console)[ramsey/composer-repl

A REPL for PHP built into Composer.

105115.7k25](/packages/ramsey-composer-repl)[gokure/hyperf-tinker

A Powerful REPL for the Hyperf framework.

1522.7k](/packages/gokure-hyperf-tinker)

PHPackages © 2026

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