Run named
composer updatetasks directly from the right-click menu oncomposer.json— with custom packages, prefix env vars, and postfix flags — all configured through a visual settings panel.
Why Compose This?
PHP projects often need to update specific packages with environment variables set beforehand and platform requirement flags appended. Running these commands manually every time is error-prone and slow. Compose This lets you save these commands as named tasks and run them in one click.
Before:
$env:OTEL_PHP_AUTOLOAD_ENABLED="false"; composer update monolog/monolog --ignore-platform-req=ext-ftp --ignore-platform-req=ext-opentelemetry
After: Right-click composer.json → Compose This → Update Logger Packages ✓
Features
- Context menu integration — the "Compose This" option only appears when you right-click
composer.json - Named tasks — save as many tasks as you need, each with its own name, packages, and flags
- Live command preview — see the exact command that will run before you save
- Visual settings panel — a purpose-built UI to add, edit, and remove tasks without editing JSON
- Tag-style package input — type a package name and press
EnterorSpaceto add it as a pill;Backspaceto remove - Prefix commands — set environment variables or run any commands before
composer - Postfix flags — append
--ignore-platform-reqor any other flags after the command - Runs in a dedicated terminal — a new "Compose This" terminal is created each time so output stays clean
Screenshots
1 — Right-click composer.json to access your tasks

2 — Pick a task from the quick-select menu

3 — Configure tasks in the visual settings panel

Getting Started
1. Install the extension
Search for "Compose This" in the VS Code Extensions panel (Ctrl+Shift+X) or install the .vsix file directly:
Extensions panel → ··· menu → Install from VSIX
2. Open the settings panel
Open the Command Palette (Ctrl+Shift+P) and run:
Compose This: Open Settings
3. Add a task
Click + Add Task, fill in the fields, and click Save All Tasks.
4. Run it
Right-click any composer.json in the Explorer → Compose This → select your task.
Task Configuration
Each task has four fields:
| Field | Description | Example |
|---|---|---|
| Task Name | Label shown in the context menu | Update Logger Packages |
| Packages | vendor/package entries to pass to composer update. Leave empty to update all. |
monolog/monolog, vendor/core |
| Prefix Commands | Commands or env var assignments that run before composer, separated by ; |
$env:OTEL_PHP_AUTOLOAD_ENABLED="false" |
| Postfix Flags | Flags appended after the composer command | --ignore-platform-req=ext-ftp |
Generated command format
<prefix commands>; composer update <packages> <postfix flags>
Example output:
$env:OTEL_PHP_AUTOLOAD_ENABLED="false"; composer update monolog/monolog vendor/core --ignore-platform-req=ext-ftp --ignore-platform-req=ext-opentelemetry
Advanced: Edit tasks in settings.json
Tasks are stored in your VS Code global settings under composeThis.tasks. You can edit them directly:
- Open Command Palette → Preferences: Open User Settings (JSON)
- Add or edit the
composeThis.tasksarray:
"composeThis.tasks": [
{
"name": "Update Logger Packages",
"packages": ["monolog/monolog", "vendor/core"],
"prefixCommands": "$env:OTEL_PHP_AUTOLOAD_ENABLED=\"false\"",
"postfixCommands": "--ignore-platform-req=ext-ftp --ignore-platform-req=ext-opentelemetry"
},
{
"name": "Full Update",
"packages": [],
"prefixCommands": "",
"postfixCommands": "--no-plugins"
}
]
Requirements
- PHP installed and available in your terminal's
PATH - Composer installed globally (
composercommand available)
Extension Settings
| Setting | Type | Default | Description |
|---|---|---|---|
composeThis.tasks |
array |
[] |
List of named composer tasks. Use the visual settings panel or edit the JSON directly. |
Tips
- No tasks configured? Clicking "Compose This" will prompt you to open the settings panel.
- Multiple projects? Tasks are saved globally (per user) and work across all workspaces.
- Prefix on Windows — use PowerShell syntax for env vars:
$env:MY_VAR="value" - Prefix on Mac/Linux — use shell syntax:
MY_VAR=valueorexport MY_VAR=value
Contributing
Issues and pull requests are welcome at the GitHub repository.
License
MIT © Compose This