Skip to content

2.1.3 — Environment snapshot

Choose a tag to compare

@FernandoEbert FernandoEbert released this 11 Nov 18:07
· 9 commits to master since this release
924586c

Environment snapshot: valet state

A single command to see the whole Valet environment: services, PHP versions and every served site (#11).

Command Description
valet state Human-readable tables: domain, global and CLI PHP, services status and all sites (parked, linked and proxies) with type, effective PHP, SSL and path.
valet state --json Machine-readable snapshot for scripts and GUIs. Runs without sudo.

The JSON payload is versioned (schema_version: 1) and includes:

  • domain, port, https_port and Valet home
  • php: global version, CLI (path, resolved binary, version), fallback_binary and installed versions
  • paths: parked directories
  • sites: name, domain, url, path, type (parked / linked / proxy), secure, php (effective: isolated → .valetphprc → global), isolated_php, phprc_php, custom_nginx, proxy_host
  • services: nginx, dnsmasq, each PHP-FPM in use, mysql/mariadb, redis and mailpit, with active as true, false or null (not installed)
valet state --json | jq '.sites[] | {url, php, type}'
valet state --json | jq '.services[] | select(.active == false)'

This is the foundation for the upcoming desktop UI. Existing commands are unchanged.

Other changes

  • ServiceManager::isActive(): non-interactive service status check for systemd and SysV service
  • 5 new tests

Upgrading

composer global update fernandoebert/valet-linux-plus