Some commands support JSON output format for easy integration with scripts, APIs, and external tools.
Add --json or -j flag to supported commands:
madock status --json
madock config:list -jAll JSON responses follow a consistent structure:
Success:
{
"success": true,
"data": { ... }
}Error:
{
"success": false,
"error": "Error message"
}Shows container states, proxy status, and tools status.
madock status --jsonResponse:
{
"success": true,
"data": {
"services": [
{"name": "php-container", "service": "php", "state": "running", "running": true},
{"name": "nginx-container", "service": "nginx", "state": "running", "running": true},
{"name": "db-container", "service": "db", "state": "exited", "running": false}
],
"proxy": [
{"name": "proxy-container", "service": "proxy", "state": "running", "running": true}
],
"tools": {
"cron_enabled": false,
"debugger_enabled": true
}
}
}Shows all project configuration parameters.
madock config:list --jsonResponse:
{
"success": true,
"data": {
"project": "myproject",
"config": {
"platform": "magento2",
"php/version": "8.2",
"db/version": "10.6",
"nginx/hosts/base/name": "myproject.test"
}
}
}Shows all available scopes with active scope marker.
madock scope:list --jsonResponse:
{
"success": true,
"data": {
"scopes": [
{"name": "default", "active": true},
{"name": "staging", "active": false}
],
"active": "default"
}
}Shows all services with their enabled/disabled status.
madock service:list --jsonResponse:
{
"success": true,
"data": {
"services": [
{"name": "elasticsearch", "enabled": true},
{"name": "redis", "enabled": true},
{"name": "rabbitmq", "enabled": false},
{"name": "xdebug", "enabled": false}
]
}
}Shows database connection details.
madock db:info --jsonResponse:
{
"success": true,
"data": {
"databases": [
{
"name": "First DB",
"host": "db",
"database": "magento",
"user": "magento",
"password": "magento",
"root_password": "root",
"remote_host": "localhost",
"remote_port": 33060
},
{
"name": "Second DB",
"host": "db2",
"database": "magento",
"user": "magento",
"password": "magento",
"root_password": "root",
"remote_host": "localhost",
"remote_port": 33061
}
]
}
}madock db:info --json | jq -r '.data.databases[0].password'madock status --json | jq -r '.data.services[] | select(.service == "php") | .running'madock config:list --json | jq -r '.data.config["php/version"]'madock service:list --json | jq -r '.data.services[] | select(.enabled == true) | .name'