|
| 1 | +--- |
| 2 | +name: lametric-cli |
| 3 | +description: Control LaMetric TIME/SKY smart displays from the command line. Use when sending notifications, controlling device brightness/volume, managing timers, or displaying data on LaMetric devices. Triggers on "LaMetric", "smart display", "notification to device", "set timer", "send alert to clock". |
| 4 | +license: MIT |
| 5 | +metadata: |
| 6 | + author: dedene |
| 7 | + version: "1.0.0" |
| 8 | +--- |
| 9 | + |
| 10 | +# LaMetric CLI |
| 11 | + |
| 12 | +CLI tool for controlling LaMetric TIME/SKY devices. Send notifications, control settings, manage timers, and stream content. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +### Installation |
| 17 | + |
| 18 | +```bash |
| 19 | +# Homebrew (macOS/Linux) |
| 20 | +brew install dedene/tap/lametric |
| 21 | + |
| 22 | +# Or Go install |
| 23 | +go install github.com/dedene/lametric-cli/cmd/lametric@latest |
| 24 | +``` |
| 25 | + |
| 26 | +### Setup |
| 27 | + |
| 28 | +1. Get API key from LaMetric mobile app: Device Settings > API Key |
| 29 | +2. Run setup wizard: |
| 30 | + |
| 31 | +```bash |
| 32 | +lametric setup |
| 33 | +``` |
| 34 | + |
| 35 | +Or configure manually: |
| 36 | + |
| 37 | +```bash |
| 38 | +# Store API key securely |
| 39 | +lametric auth set-key --device=living-room |
| 40 | + |
| 41 | +# Or use environment variables |
| 42 | +export LAMETRIC_API_KEY=your-api-key |
| 43 | +export LAMETRIC_DEVICE=192.168.1.100 |
| 44 | +``` |
| 45 | + |
| 46 | +Config file location: `~/.config/lametric-cli/config.yaml` |
| 47 | + |
| 48 | +## Core Workflows |
| 49 | + |
| 50 | +### Sending Notifications |
| 51 | + |
| 52 | +**Simple notification:** |
| 53 | +```bash |
| 54 | +lametric notify "Hello World" |
| 55 | +``` |
| 56 | + |
| 57 | +**With icon and sound:** |
| 58 | +```bash |
| 59 | +lametric notify "Build passed" --icon=checkmark --sound=positive1 |
| 60 | +``` |
| 61 | + |
| 62 | +**Critical alert (wakes device, plays alarm):** |
| 63 | +```bash |
| 64 | +lametric notify "ALERT: Server down" --priority=critical --sound=alarm1 |
| 65 | +``` |
| 66 | + |
| 67 | +**Progress indicator:** |
| 68 | +```bash |
| 69 | +lametric notify "Upload progress" --goal=75/100 --icon=upload |
| 70 | +``` |
| 71 | + |
| 72 | +**Sparkline chart:** |
| 73 | +```bash |
| 74 | +lametric notify "CPU Usage" --chart=10,25,50,30,45,80,60 |
| 75 | +``` |
| 76 | + |
| 77 | +**From stdin (for pipelines):** |
| 78 | +```bash |
| 79 | +echo "Build complete" | lametric notify |
| 80 | +git log -1 --format="%s" | lametric notify --icon=github |
| 81 | +``` |
| 82 | + |
| 83 | +**Wait for user dismissal:** |
| 84 | +```bash |
| 85 | +lametric notify "Confirm deployment?" --wait |
| 86 | +``` |
| 87 | + |
| 88 | +### Device Control |
| 89 | + |
| 90 | +**Get device info:** |
| 91 | +```bash |
| 92 | +lametric device |
| 93 | +``` |
| 94 | + |
| 95 | +**Display brightness:** |
| 96 | +```bash |
| 97 | +lametric display get |
| 98 | +lametric display brightness 50 # Set to 50% |
| 99 | +lametric display mode auto # Auto brightness |
| 100 | +``` |
| 101 | + |
| 102 | +**Audio volume:** |
| 103 | +```bash |
| 104 | +lametric audio get |
| 105 | +lametric audio volume 30 # Set to 30% |
| 106 | +``` |
| 107 | + |
| 108 | +**Bluetooth:** |
| 109 | +```bash |
| 110 | +lametric bluetooth get |
| 111 | +lametric bluetooth on |
| 112 | +lametric bluetooth off |
| 113 | +``` |
| 114 | + |
| 115 | +### Built-in Apps |
| 116 | + |
| 117 | +**Timer:** |
| 118 | +```bash |
| 119 | +lametric app timer set 5m # Set 5 minute timer |
| 120 | +lametric app timer set 1h30m # Set 1 hour 30 minutes |
| 121 | +lametric app timer start |
| 122 | +lametric app timer pause |
| 123 | +lametric app timer reset |
| 124 | +``` |
| 125 | + |
| 126 | +**Stopwatch:** |
| 127 | +```bash |
| 128 | +lametric app stopwatch start |
| 129 | +lametric app stopwatch pause |
| 130 | +lametric app stopwatch reset |
| 131 | +``` |
| 132 | + |
| 133 | +**Radio:** |
| 134 | +```bash |
| 135 | +lametric app radio play |
| 136 | +lametric app radio stop |
| 137 | +lametric app radio next |
| 138 | +lametric app radio prev |
| 139 | +``` |
| 140 | + |
| 141 | +**App navigation:** |
| 142 | +```bash |
| 143 | +lametric app list # List installed apps |
| 144 | +lametric app next # Switch to next app |
| 145 | +lametric app prev # Switch to previous app |
| 146 | +``` |
| 147 | + |
| 148 | +### Streaming |
| 149 | + |
| 150 | +Stream images or video to the display: |
| 151 | + |
| 152 | +```bash |
| 153 | +lametric stream start # Start streaming session |
| 154 | +lametric stream image logo.png # Send static image |
| 155 | +lametric stream gif animation.gif # Send animated GIF |
| 156 | +lametric stream stop # End streaming |
| 157 | +``` |
| 158 | + |
| 159 | +**Pipe from ffmpeg:** |
| 160 | +```bash |
| 161 | +ffmpeg -i video.mp4 -vf "scale=37:8" -f rawvideo -pix_fmt rgb24 - | lametric stream pipe |
| 162 | +``` |
| 163 | + |
| 164 | +### Discovery |
| 165 | + |
| 166 | +Find LaMetric devices on your network: |
| 167 | + |
| 168 | +```bash |
| 169 | +lametric discover |
| 170 | +lametric discover --timeout=10s |
| 171 | +``` |
| 172 | + |
| 173 | +## Common Patterns |
| 174 | + |
| 175 | +### Build/CI Notifications |
| 176 | + |
| 177 | +```bash |
| 178 | +# Success |
| 179 | +lametric notify "Build #123 passed" --icon=checkmark --sound=positive1 |
| 180 | + |
| 181 | +# Failure |
| 182 | +lametric notify "Build #123 failed" --icon=error --sound=negative1 --priority=warning |
| 183 | + |
| 184 | +# Deployment |
| 185 | +lametric notify "Deployed to prod" --icon=rocket --sound=positive2 |
| 186 | +``` |
| 187 | + |
| 188 | +### System Monitoring |
| 189 | + |
| 190 | +```bash |
| 191 | +# CPU alert |
| 192 | +lametric notify "High CPU: 95%" --priority=warning --icon=warning |
| 193 | + |
| 194 | +# Disk space |
| 195 | +lametric notify "Disk: 85% full" --goal=85/100 --icon=harddrive |
| 196 | +``` |
| 197 | + |
| 198 | +### Pomodoro Timer |
| 199 | + |
| 200 | +```bash |
| 201 | +lametric app timer set 25m && lametric app timer start |
| 202 | +``` |
| 203 | + |
| 204 | +### Meeting Reminder |
| 205 | + |
| 206 | +```bash |
| 207 | +lametric notify "Meeting in 5 min" --icon=calendar --sound=alarm3 --priority=warning |
| 208 | +``` |
| 209 | + |
| 210 | +## Quick Reference |
| 211 | + |
| 212 | +### Popular Icons |
| 213 | + |
| 214 | +| Alias | Description | |
| 215 | +|-------|-------------| |
| 216 | +| `checkmark` | Success/complete | |
| 217 | +| `error` | Error/failure | |
| 218 | +| `warning` | Warning/caution | |
| 219 | +| `info` | Information | |
| 220 | +| `rocket` | Deploy/launch | |
| 221 | +| `github` | GitHub | |
| 222 | +| `slack` | Slack | |
| 223 | +| `mail` | Email | |
| 224 | +| `calendar` | Calendar/meeting | |
| 225 | +| `download` | Download | |
| 226 | +| `upload` | Upload | |
| 227 | + |
| 228 | +Run `lametric icons` for full list. |
| 229 | + |
| 230 | +### Popular Sounds |
| 231 | + |
| 232 | +| Sound | Category | |
| 233 | +|-------|----------| |
| 234 | +| `positive1-5` | Success sounds | |
| 235 | +| `negative1-5` | Error sounds | |
| 236 | +| `alarm1-13` | Alarm sounds | |
| 237 | +| `notification1-4` | Gentle notifications | |
| 238 | + |
| 239 | +Run `lametric sounds` for full list. |
| 240 | + |
| 241 | +### Global Flags |
| 242 | + |
| 243 | +| Flag | Description | |
| 244 | +|------|-------------| |
| 245 | +| `-d, --device` | Device name or IP | |
| 246 | +| `-j, --json` | Output JSON | |
| 247 | +| `--plain` | Output TSV (for scripting) | |
| 248 | +| `-v, --verbose` | Verbose logging | |
| 249 | + |
| 250 | +## Troubleshooting |
| 251 | + |
| 252 | +### Connection Failed |
| 253 | + |
| 254 | +1. Verify device IP: `lametric discover` |
| 255 | +2. Check device is on same network |
| 256 | +3. Ensure API key is correct: `lametric auth get-key --device=NAME` |
| 257 | + |
| 258 | +### Authentication Error |
| 259 | + |
| 260 | +```bash |
| 261 | +# Re-set API key |
| 262 | +lametric auth set-key --device=living-room |
| 263 | + |
| 264 | +# Or use environment variable |
| 265 | +export LAMETRIC_API_KEY=your-api-key |
| 266 | +``` |
| 267 | + |
| 268 | +### Device Not Found |
| 269 | + |
| 270 | +```bash |
| 271 | +# Discover devices |
| 272 | +lametric discover --timeout=10s |
| 273 | + |
| 274 | +# Add to config |
| 275 | +lametric setup |
| 276 | +``` |
0 commit comments