# PsySH

> Runtime developer console, interactive debugger and REPL for PHP, with configurable themes, history management and system shell integration.

Stars: 9.8k · Language: PHP · License: MIT · Categories: Dev Tools

- Repository: https://github.com/bobthecow/psysh
- Website: https://psysh.org
- Page: https://www.trmn.sh/tools/psysh

## Install

- Homebrew: `brew install psysh`
- Composer (project dependency): `composer require psy/psysh:@stable`

## Overview

PsySH is an interactive PHP console and REPL. Running `psysh` opens a prompt where you can evaluate expressions, define functions, and inspect results without creating a separate script for each experiment. The manual also covers command history, session variables, shell integration, and configurable themes.

It can be embedded in a PHP program with `eval(\Psy\sh())`. Execution pauses at that point and opens a shell with access to the surrounding program state. A debugging context can also be passed explicitly to `\Psy\debug()`, including a bound object for inspecting the current class context.

This is interactive inspection rather than a step-through debugger. The documented embedding workflow supports command-line scripts and PHP's built-in web server; it does not support debugging through Apache, nginx, or PHP-FPM. It suits PHP developers exploring code and investigating application state from the terminal.

### Installation

```bash
# via Homebrew
brew install psysh
```

```bash
# via Composer (project dependency)
composer require psy/psysh:@stable
```

## Alternatives

- [reviewdog](https://www.trmn.sh/tools/reviewdog.md): Parses linter output and posts findings in changed lines as review comments on GitHub, GitLab, and Bitbucket, or filters lint results by diff locally. (Go, 9.8k stars)
- [serve](https://www.trmn.sh/tools/serve.md): Node.js CLI that serves a static site, single page application, or single file over HTTP, with a browsable directory listing UI. (TypeScript, 9.9k stars)
- [Terragrunt](https://www.trmn.sh/tools/terragrunt.md): Orchestration tool for OpenTofu/Terraform infrastructure code, used to scale and manage Infrastructure as Code across many modules and environments. (Go, 9.9k stars)
- [hexyl](https://www.trmn.sh/tools/hexyl.md): Terminal hex viewer that colors bytes by category: NULL, printable ASCII, whitespace, other ASCII, and non-ASCII. (Rust, 10.3k stars)
- [npm-check-updates](https://www.trmn.sh/tools/npm-check-updates.md): CLI that upgrades package.json dependencies to their latest versions, preserving semver range operators. Works with npm, yarn, pnpm, deno, and bun. (TypeScript, 10.3k stars)

---

Canonical: https://www.trmn.sh/tools/psysh
