# Malt > JSON-driven Homebrew Dev Services for macOS local development. Malt creates project-specific development environments using only Homebrew. Define your entire stack in `malt.json` — PHP version, web servers, databases, caching, and extensions — and replicate it anywhere with the portable `malt/` directory. No VMs or containers; native performance with port-based project isolation. ## Quick Start ```bash brew tap shivammathur/php brew tap shivammathur/extensions brew tap koriym/malt brew trust shivammathur/php shivammathur/extensions koriym/malt # Homebrew 7 refuses untrusted third-party taps brew install malt cd your-project malt init # Create malt.json malt install # Install Homebrew packages malt create # Generate malt/ config directory malt start # Start services source <(malt env) # Set up shell environment ``` For existing projects (joining a team or second machine): ```bash malt install && malt start && source <(malt env) ``` > If `malt/` is not present, run `malt create` before `malt start`. ## malt.json Single source of truth for the project environment. All fields are required. ```json { "project_name": "myapp", "dependencies": ["php@8.4", "mysql@8.0", "redis", "nginx", "composer"], "ports": { "php": [9000], "mysql": [3306], "nginx": [80], "httpd": [8080], "redis": [6379], "memcached": [11211] }, "php_extensions": ["xdebug", "redis", "apcu"] } ``` Fields: - `project_name`: Project identifier used in logs and status output. - `dependencies`: Homebrew formula names. Include the PHP version as `php@8.4`. - `ports`: Service name → port array. Multiple ports create multiple instances. Supported keys: `php`, `mysql`, `nginx`, `httpd`, `redis`, `memcached`. - `php_extensions`: PHP extensions installed via `shivammathur/extensions` tap. ## Commands - `malt init` — Create malt.json from default template (no-op if exists) - `malt install` — Install Homebrew packages and PHP extensions from malt.json - `malt create` — Generate malt/ directory with service configs (no-op if malt/ exists; delete it to regenerate) - `malt start` — Start all configured services; displays access URLs - `malt stop` — Stop all services and clean up temporary config files - `malt status` — Show running / stopped / external-process state per port - `malt kill` — Force-kill only malt-started service processes (SIGKILL), across all projects, regardless of malt.json - `malt env` — Output shell script: `source <(malt env)` sets PATH, MALT_DIR, DOCUMENT_ROOT, and port-specific aliases (e.g., `mysql@3306`, `redis-cli@6379`) - `malt info` — Show project name, directory, and configured service ports ## Supported Services - PHP-FPM: multiple versions, custom extensions, xdebug loaded as `zend_extension` - Nginx: multiple ports via a shared main config with includes - Apache HTTPD: separate instance per port, libphp.so loaded from Homebrew - MySQL: auto-initialized data directory on first start, multiple instances - Redis - Memcached ## Key Concepts - **Port-based isolation**: Multiple projects coexist via different ports; no container overhead. - **Two-phase config**: `malt create` generates files with `{{VARIABLE}}` placeholders. `malt start` expands them into `.tmp` files passed to service processes. - **Template variables**: `{{MALT_DIR}}`, `{{PROJECT_DIR}}`, `{{HOMEBREW_PREFIX}}`, `{{PHP_VERSION}}`, `{{PORT}}`, `{{INDEX}}` — expand at start time; usable in your customizations. - **Portable malt/**: Commit `malt.json` and `malt/conf/` (exclude `*.tmp`, `logs/`, `tmp/`, `var/`). ## Docs - [Customization Guide](https://github.com/koriym/homebrew-malt/blob/1.x/docs/customization_guide.md): Edit malt/conf/ files, template variable reference, Nginx/PHP/MySQL examples - [JSON Schema](https://github.com/koriym/homebrew-malt/blob/1.x/docs/schema.json): malt.json schema definition - [Full LLM Reference](https://github.com/koriym/homebrew-malt/blob/1.x/docs/llms-full.txt): Complete inlined documentation including architecture and source structure ## Optional - [README](https://github.com/koriym/homebrew-malt/blob/1.x/README.md): Quick start, commands, project structure - [Claude Code Skill](https://github.com/koriym/homebrew-malt): Setup, troubleshooting, and format conversion (Docker Compose, Kubernetes, Terraform, Ansible, GitHub Actions, .env)