x-uptime
by @edwinjhlee
Enhanced `uptime` with structured YAML output showing uptime, users, and 1/5/15-minute load averages. **Dependency**: This is an x-cmd module. Install x-cmd...
clawhub install x-uptimeπ About This Skill
name: x-uptime description: | Enhanced
uptime with structured YAML output showing
uptime, users, and 1/5/15-minute load averages.
Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options).
see x-cmd skill for installation.license: Apache-2.0 compatibility: POSIX Shell
metadata: author: Li Junhao version: "1.0.0" category: x-cmd-extension tags: [x-cmd, system, uptime, load]
x uptime - System Uptime and Load
> Enhanced uptime command with structured YAML output and cross-platform support.
Quick Start
# YAML format output (default)
x uptimeRaw uptime command output
x uptime --raw
Features
Output Fields
| Field | Description | Example |
|-------|-------------|---------|
| time | Current system time | 14:32:10 |
| up | System uptime | 5 days, 3 hours, 27 minutes |
| users | Logged-in users count | 2 users |
| load | Load averages (1m, 5m, 15m) | 0.52, 0.58, 0.59 |
Commands
| Command | Description |
|---------|-------------|
| x uptime | YAML format output (default) |
| x uptime --yml | YAML format (explicit) |
| x uptime --raw | Raw system uptime output |
Examples
Basic Usage
# Default YAML output
x uptimeOutput example:
time : 14:32:10
up : 5 days, 3 hours, 27 minutes
users : 2 users
load : 0.52, 0.58, 0.59
Raw Output
# Traditional uptime output
x uptime --raw
14:32:10 up 5 days, 3:27, 2 users, load average: 0.52, 0.58, 0.59
Parsing
# Extract uptime
x uptime | awk -F': ' '/^up/{print $2}'Get load average
x uptime | awk -F': ' '/^load/{print $2}'
Understanding Load Averages
Load averages indicate system busyness - the average number of processes waiting for CPU or I/O.
| Value | Interpretation |
|-------|----------------|
| < 1.0 | System has spare capacity |
| β 1.0 | System is fully utilized |
| > 1.0 | Processes are waiting (queue forming) |
The three numbers show:
Multi-Core Systems
Divide load by CPU core count:
# 4-core system with load 3.2
effective_load = 3.2 / 4 = 0.8 # Still has capacity
Platform Notes
Linux
uptime commandmacOS
uptime commandWindows
uptime commandRelated
uptime(1) manual pageπ‘ Examples
Basic Usage
# Default YAML output
x uptimeOutput example:
time : 14:32:10
up : 5 days, 3 hours, 27 minutes
users : 2 users
load : 0.52, 0.58, 0.59
Raw Output
# Traditional uptime output
x uptime --raw
14:32:10 up 5 days, 3:27, 2 users, load average: 0.52, 0.58, 0.59
Parsing
# Extract uptime
x uptime | awk -F': ' '/^up/{print $2}'Get load average
x uptime | awk -F': ' '/^load/{print $2}'