PHPackages                             shanginn/som - 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. shanginn/som

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

shanginn/som
============

CLI tool to interact with PHP app inside docker compose env

1.3.0(1y ago)15.4k↓33.3%1MITShellCI passing

Since Aug 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/shanginn/som)[ Packagist](https://packagist.org/packages/shanginn/som)[ RSS](/packages/shanginn-som/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

som
===

[](#som)

[![](logo.png)](logo.png)

`som` is a command-line utility for interacting with Symfony applications (now I'm working with [API platform](https://api-platform.com/)) running on Docker Compose. It provides a number of useful commands for managing your application and makes it easy to run Symfony, PHP, Composer and Docker Compose commands without manual docker command hassle.

Inspired by Laravel's `sail` tool, `som` aims to provide similar functionality, but designed specifically for Symfony based projects.

System Requirements
-------------------

[](#system-requirements)

- Docker and Docker Compose
- bash
- jq (optional, for shorthand Composer script commands)

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

[](#installation)

`composer require --dev shanginn/som`

`som` is a bash and it will be placed inside `vendor/bin` folder. You can use it directly from there, but it's recommended to make a symlink:

```
ln -s vendor/bin/som som
```

Usage
-----

[](#usage)

```
som COMMAND [options] [arguments]
```

Unknown commands are passed directly to the Docker Compose.

### Docker Compose Commands

[](#docker-compose-commands)

- `som up` - Start the application
- `som up -d` - Start the application in the background
- `som stop` - Stop the application
- `som restart` - Restart the application
- `som ps` - Display the status of all containers

### Symfony Console Commands

[](#symfony-console-commands)

- `som console ...` - Run a Symfony console command

### PHP Commands

[](#php-commands)

- `som php ...` - Run a PHP snippet
- `som php -v` - Show PHP version

### Composer Commands

[](#composer-commands)

- `som composer ...` - Run a Composer command
- `som run ...` - Run a Composer script (equivalent to "composer run")

If you have 'jq' installed and your composer.json has, for example, 'fix' script, you can run:

- `som fix`

If composer.json not in the current dir set COMPOSER\_JSON\_PATH env

### Running Tests

[](#running-tests)

- `som test` - Run PHPUnit tests via the Artisan test command
- `som phpunit ...` - Run PHPUnit
- `som pest ...` - Run Pest

### Container CLI

[](#container-cli)

- `som shell` - Start a shell session within the application container
- `som bash` - Alias for 'som shell'
- `som root-shell` - Start a root shell session within the application container
- `som root-bash` - Alias for 'som root-shell'
- TODO: `som psysh` - Start a new psysh session

### Binaries

[](#binaries)

- `som bin ...` - Run Composer binary scripts from the vendor/bin directory

### Help

[](#help)

- `som help` - Show help information

Environment Variables
---------------------

[](#environment-variables)

Environment variables can be defined in your .env file. The following variables are used by the SOM script:

- `HTTP_PORT`: The HTTP port for your application (default: 80)
- `HTTPS_PORT`: The HTTPS port for your application (default: 443)
- `HTTP3_PORT`: The HTTP3 port for your application (default: 443)
- `DOCKER_PHP_SERVICE`: The Docker service name for PHP (default: "php")
- `DOCKER_DB_SERVICE`: The Docker service name for the database (default: "database")
- `DOCKER_WEB_SERVER_SERVICE`: The Docker service name for the web server (default: "caddy")
- `DB_PORT`: The database port (default: 5432)
- `USER`: The user ID for the Docker container (default: UID of the current user)
- `GROUP`: The group ID for the Docker container (default: GID of the current user)
- `DOCKER_COMPOSE_FILES`: The Docker Compose file paths (separated by a colon if multiple files, ex DOCKER\_COMPOSE\_FILES="docker-compose.yml:docker-compose.prod.yml")
- `COMPOSER_JSON_PATH`: The path to the composer.json file (default: "composer.json")

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit a pull request or create an issue to discuss the changes you want to make.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance46

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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

Total

5

Last Release

400d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/311e425711f60c09486c23252696fbe4dfa77e9b0dd5517bc89b288ac2f58655?d=identicon)[shanginn](/maintainers/shanginn)

---

Top Contributors

[![shanginn](https://avatars.githubusercontent.com/u/3357943?v=4)](https://github.com/shanginn "shanginn (15 commits)")

### Embed Badge

![Health badge](/badges/shanginn-som/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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