Status Command
v0.4.8Updated for ɳSelf v0.4.8
The nself status command displays the current state of all ɳSelf services. View container health, resource usage, uptime, and detailed service information at a glance.
Status Information
- - Container State: Running, stopped, unhealthy, restarting
- - Health Checks: Healthy, unhealthy, starting, no healthcheck
- - Resource Usage: CPU, memory, network I/O
- - Uptime: How long each service has been running
- - Port Mappings: Exposed ports and bindings
Usage
nself status [service...] [options]
Options
| Option | Description | Default |
|---|
--resources, -r | Include CPU and memory usage | false |
--verbose, -v | Show detailed information | false |
--watch, -w | Continuously update status | false |
--interval N | Update interval for watch mode (seconds) | 2 |
--json | Output in JSON format | false |
--quiet, -q | Only show service names and states | false |
--all, -a | Include stopped services | false |
Examples
Basic Status
nself status
# Output:
➞ ɳSelf Status - local.nself.org
SERVICE STATE HEALTH UPTIME PORTS
------- ----- ------ ------ -----
postgres running healthy 2h 15m 5432/tcp
hasura running healthy 2h 15m 8080/tcp
auth running healthy 2h 15m 4000/tcp
nginx running - 2h 15m 80/tcp, 443/tcp
redis running healthy 2h 15m 6379/tcp
minio running healthy 2h 15m 9000/tcp, 9001/tcp
meilisearch running healthy 2h 15m 7700/tcp
mailpit running healthy 2h 14m 1025/tcp, 8025/tcp
✓ 8 services running (8 healthy)
Status with Resources
nself status --resources
# Output:
➞ ɳSelf Status - local.nself.org
SERVICE STATE HEALTH CPU MEMORY NET I/O
------- ----- ------ --- ------ -------
postgres running healthy 0.5% 128 MB 1.2 MB / 500 KB
hasura running healthy 1.2% 256 MB 3.5 MB / 1.2 MB
auth running healthy 0.3% 96 MB 800 KB / 200 KB
nginx running - 0.1% 24 MB 5.0 MB / 4.8 MB
redis running healthy 0.2% 32 MB 100 KB / 50 KB
minio running healthy 0.4% 192 MB 2.0 MB / 1.5 MB
meilisearch running healthy 0.8% 384 MB 500 KB / 100 KB
mailpit running healthy 0.1% 48 MB 10 KB / 5 KB
Total: CPU 3.6% | Memory 1.16 GB | Net 13.1 MB / 8.35 MB
Specific Service Status
nself status postgres
# Output:
➞ Service: postgres
State: running
Health: healthy
Uptime: 2 hours, 15 minutes
Image: postgres:15-alpine
Container ID: abc123def456
Ports:
5432/tcp -> 0.0.0.0:5432
Health Check:
Test: pg_isready -U postgres
Interval: 10s
Retries: 5
Status: healthy (last: 5s ago)
Resources:
CPU: 0.5%
Memory: 128 MB / 512 MB (25%)
Network I/O: 1.2 MB / 500 KB
Logs (last 5 lines):
2026-01-24 10:30:00 LOG: checkpoint complete
2026-01-24 10:29:55 LOG: database system is ready
Verbose Output
nself status --verbose
# Shows additional details:
# - Container IDs
# - Image versions
# - Environment variables (redacted)
# - Volume mounts
# - Network configuration
# - Health check configuration
Watch Mode
# Continuously monitor status
nself status --watch
# Custom update interval (5 seconds)
nself status --watch --interval 5
# Watch specific service
nself status hasura --watch
# Press Ctrl+C to exit
Include Stopped Services
nself status --all
# Shows all services including stopped:
SERVICE STATE HEALTH UPTIME
------- ----- ------ ------
postgres running healthy 2h 15m
hasura running healthy 2h 15m
auth running healthy 2h 15m
nginx running - 2h 15m
nself-admin stopped - -
mlflow stopped - -
Service States
| State | Description | Color |
|---|
running | Container is running normally | Green |
starting | Container is starting up | Yellow |
restarting | Container is restarting | Yellow |
stopped | Container has exited (exit 0) | Gray |
exited | Container has exited (non-zero) | Red |
paused | Container is paused | Yellow |
dead | Container is dead (resource issue) | Red |
created | Container created but not started | Gray |
Health States
| Health | Description | Icon |
|---|
healthy | Health check passing | Green checkmark |
unhealthy | Health check failing | Red X |
starting | Health check in progress | Yellow spinner |
- | No health check defined | Gray dash |
JSON Output
nself status --json
# Output:
{
"project": "my-project",
"environment": "local",
"domain": "local.nself.org",
"timestamp": "2026-01-24T10:30:00Z",
"summary": {
"total": 8,
"running": 8,
"healthy": 7,
"unhealthy": 0,
"stopped": 0
},
"services": [
{
"name": "postgres",
"state": "running",
"health": "healthy",
"uptime_seconds": 8100,
"uptime_human": "2h 15m",
"image": "postgres:15-alpine",
"container_id": "abc123def456",
"ports": [
{ "container": 5432, "host": 5432, "protocol": "tcp" }
],
"resources": {
"cpu_percent": 0.5,
"memory_bytes": 134217728,
"memory_percent": 25.0,
"network_rx_bytes": 1258291,
"network_tx_bytes": 524288
}
}
]
}
Quiet Mode
nself status --quiet
# Minimal output:
postgres running
hasura running
auth running
nginx running
redis running
minio running
meilisearch running
mailpit running
Filtering Services
# Status of specific services
nself status postgres hasura auth
# Status of services matching pattern (not supported directly, use grep)
nself status --quiet | grep running
Resource Thresholds
When using --resources, values are color-coded based on thresholds:
| Metric | Warning | Critical |
|---|
| CPU | > 70% | > 90% |
| Memory | > 80% | > 95% |
| Disk | > 80% | > 95% |
Exit Codes
| Code | Meaning |
|---|
| 0 | All services running and healthy |
| 1 | Some services not running or unhealthy |
| 2 | No services running |
| 3 | Error running status command |
Comparison with Other Commands
| Command | Purpose |
|---|
nself status | Current state of all containers |
nself health | Detailed health checks with history |
nself doctor | System diagnostics and auto-fix |
nself logs | View service logs |
nself urls | List service URLs |
CI/CD Integration
# Check if all services are running
if nself status --quiet > /dev/null 2>&1; then
echo "All services running"
else
echo "Some services not running"
nself status
exit 1
fi
# Get status as JSON for processing
STATUS=$(nself status --json)
UNHEALTHY=$(echo $STATUS | jq '.summary.unhealthy')
if [ "$UNHEALTHY" -gt 0 ]; then
echo "Unhealthy services detected"
exit 1
fi
Troubleshooting
Service Shows Unhealthy
# Check detailed status
nself status postgres --verbose
# View recent logs
nself logs postgres --tail 50
# Check health check output
docker inspect --format='{{json .State.Health}}' project_postgres_1 | jq
Service Keeps Restarting
# Check restart count and policy
nself status --verbose
# View logs for crash reasons
nself logs service_name
# Check resource limits
docker stats --no-stream
High Resource Usage
# Monitor resources continuously
nself status --resources --watch
# Identify resource-heavy services
nself status --resources --json | jq '.services | sort_by(.resources.memory_bytes) | reverse | .[0:3]'
Related Commands