VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-phpstorm-copilot/5.1-macos-and-linux-support

⇱ macOS and Linux Support | invokable/laravel-boost-phpstorm-copilot | DeepWiki


Loading...
Last indexed: 28 February 2026 (57ef88)
Menu

macOS and Linux Support

Purpose and Scope

This document covers the standard implementation for macOS and Linux platforms in the laravel-boost-phpstorm-copilot package. These platforms share a unified implementation approach, utilizing consistent Unix file system conventions and straightforward path resolution. This is the simplest and most direct implementation path in the package, serving as the baseline for other platform adaptations.

For Windows-specific implementations, see Windows Native Support. For WSL environments where PhpStorm runs on Windows while PHP runs in Linux, see WSL (Windows Subsystem for Linux). For Docker-based environments, see Laravel Sail Integration.


Platform Detection

The package identifies macOS and Linux environments using the Platform enum from Laravel Boost. Detection occurs in two phases: system-wide detection to verify PhpStorm and GitHub Copilot are installed, and project-specific detection to confirm the project is configured for the agent.

System-Wide Detection Configuration

The systemDetectionConfig() method in src/PhpStormCopilot.php39-67 defines platform-specific detection paths:


Sources: src/PhpStormCopilot.php39-67

macOS Detection Paths

On macOS (identified as Platform::Darwin), the package searches for:

Detection PathPurpose
~/Library/Application Support/JetBrains/PhpStorm*/plugins/github-copilot-intellijGitHub Copilot plugin installation
/Applications/PhpStorm.appPhpStorm application bundle

The wildcard pattern PhpStorm* accommodates multiple PhpStorm versions installed simultaneously (e.g., PhpStorm2024.1, PhpStorm2024.3).

Sources: src/PhpStormCopilot.php42-46

Linux Detection Paths

On Linux, the package searches multiple common installation locations:

Detection PathPurpose
/opt/phpstormStandard system-wide installation
/opt/PhpStorm*Versioned PhpStorm installations
/usr/local/bin/phpstormSymbolic link or direct binary
~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-*JetBrains Toolbox managed installations
/mnt/c/Users/*/AppData/Local/github-copilotWSL environment detection path

The last path (/mnt/c/...) is included in Linux detection to identify WSL environments, where the Linux system can access Windows filesystem mounts.

Sources: src/PhpStormCopilot.php48-56

Project-Specific Detection

The projectDetectionConfig() method checks for project-level GitHub Copilot configuration:


This file indicates that the project has been configured for GitHub Copilot integration, regardless of which agent is being used.

Sources: src/PhpStormCopilot.php74-79


MCP Configuration File Location

Both macOS and Linux use the same Unix-style configuration path. This unified approach simplifies the implementation compared to Windows platforms.

Unified Unix Path

The mcpConfigPath() method returns identical paths for both platforms:

mcpConfigPath() — Unified Unix Path Resolution


The path construction uses:

  • getenv('HOME') to retrieve the user's home directory
  • Static suffix: /.config/github-copilot/intellij/mcp.json

Sources: src/PhpStormCopilot.php104-114 README.md122-124

File Path Components

ComponentDescription
$HOME or ~User's home directory (platform-independent)
.config/XDG Base Directory specification for configuration files
github-copilot/GitHub Copilot configuration namespace
intellij/IntelliJ platform (PhpStorm is built on IntelliJ)
mcp.jsonMCP server configuration file

This path follows the XDG Base Directory specification, which is standard on both macOS and Linux for modern applications.

Sources: README.md123


Installation Process

The installation process for macOS and Linux follows the standard flow without requiring special adaptations like WSL or Sail environments.

Standard Installation Flow


Sources: src/PhpStormCopilot.php119-132

Installation Method Logic

The installFileMcp() method in src/PhpStormCopilot.php119-132 implements a decision tree:

  1. Testbench Check (isRunningInTestbench()): Throws Exception if TESTBENCH_CORE is defined.
  2. WSL Check (isWSL()): Delegates to installMcpViaWsl() if WSL_DISTRO_NAME env var is set. On native macOS/Linux this returns false.
  3. Sail Transformation (transformSailCommand()): Wraps Sail commands with bash -c. On standard setups without Sail, the command and args pass through unchanged.
  4. Parent Implementation: Calls parent::installFileMcp() from Agent, which writes mcp.json to disk.

On native macOS and Linux, steps 2 and 3 are pass-through, making the file write the only meaningful operation.

Sources: src/PhpStormCopilot.php119-132

Sources: src/PhpStormCopilot.php119-132


Absolute Path Resolution

The package uses absolute paths for MCP configuration to ensure reliable execution regardless of the working directory from which PhpStorm launches the MCP server.

Absolute Path Requirement

useAbsolutePathForMcp() — Absolute Path Enforcement


The useAbsolutePathForMcp() method returns true, instructing Laravel Boost to resolve absolute paths for both the PHP executable and the artisan binary.

Sources: src/PhpStormCopilot.php29-32

Example MCP Configuration

A typical MCP configuration file on macOS or Linux:



























FieldValueRequirement
commandAbsolute path to PHP binaryMust be executable
args[0]Absolute path to artisan fileMust exist in project
args[1]"boost:mcp"Laravel Boost MCP command

Sources: README.md72-80 src/PhpStormCopilot.php29-32


Configuration Key Structure

The MCP configuration uses the servers key as its top-level structure.

mcpConfigKey() — JSON Structure Key


The mcpConfigKey() method returns "servers", which defines the JSON key under which MCP server configurations are stored. This aligns with the MCP specification expected by PhpStorm's GitHub Copilot plugin.

Sources: src/PhpStormCopilot.php99-102


Empty Array Removal

The package removes empty arrays from the configuration to prevent compatibility issues with MCP tools.

Removal Logic

removeEmptyArrays() — Recursive Empty Array Removal


The removeEmptyArrays() method in src/PhpStormCopilot.php168-181 recursively traverses the configuration array and removes any empty arrays. This prevents issues where some MCP tools fail when encountering empty arrays like "headers": [].

Sources: src/PhpStormCopilot.php168-181


Comparison with Other Platforms

macOS and Linux implementations serve as the baseline "standard" case:

FeaturemacOS/LinuxWindowsWSL
Config Path~/.config/github-copilot/intellij/mcp.json%LOCALAPPDATA%\github-copilot\intellij\mcp.jsonWindows path via PowerShell
Path ResolutionStandard Unix pathsWindows pathsWSL→Windows path conversion
File WritingDirect filesystem writesDirect filesystem writesPowerShell Base64 encoding
Special RequirementsNoneNonewslu package, PowerShell access
Implementation ComplexitySimpleSimpleComplex

The macOS and Linux implementations require no special traits or path transformations (unlike WithWSL), making them the most straightforward platform support in the package.

Sources: src/PhpStormCopilot.php1-187 README.md16-125


Code Entity Mapping

Key Classes and Methods

PhpStormCopilot — Methods and Their macOS/Linux Roles


Sources: src/PhpStormCopilot.php19-187

File System Paths Referenced

The following paths are explicitly referenced in the codebase for macOS and Linux:

macOS (Darwin) Paths:

  • ~/Library/Application Support/JetBrains/PhpStorm*/plugins/github-copilot-intellij
  • /Applications/PhpStorm.app
  • ~/.config/github-copilot/intellij/mcp.json

Linux Paths:

  • /opt/phpstorm
  • /opt/PhpStorm*
  • /usr/local/bin/phpstorm
  • ~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-*
  • ~/.config/github-copilot/intellij/mcp.json

Project Paths:

  • .github/copilot-instructions.md
  • .github/instructions/laravel-boost.instructions.md
  • .github/skills

Sources: src/PhpStormCopilot.php39-114 README.md101-103 README.md123