DEV Community

Cover image for Dead-Simple CLI Uptime Monitor – No SaaS, POST Support, CI/CD Ready (Open Source)
Chintan Shah
Chintan Shah

Posted on

Dead-Simple CLI Uptime Monitor – No SaaS, POST Support, CI/CD Ready (Open Source)

I kept spinning up heavy monitoring dashboards or paying monthly for SaaS tools just to check if a few personal APIs were still breathing. Most tools were massive overkill for what I actually needed.

So I built upstatus — a tiny CLI uptime monitor that lives in your terminal. It checks URLs (including POST health endpoints), tracks response times and uptime percentages, and exports results. No accounts, no dashboards, pure local power.

Why I Built This

I monitor a handful of personal APIs and side-project backends. I needed a "terminal-first" tool more capable than a curl script:

  • POST/PUT support with bodies for auth/health checks
  • "Degraded" status to catch slow responses before they fail completely
  • Easy JSON/CSV export for reports or sharing
  • Script-friendly output to fail CI builds on uptime drops
  • Lightweight with zero external service dependencies

Existing tools were either bloated (dashboards I never used) or subscription-based. upstatus is TypeScript-native, solves the repetitive pains I kept hitting, and stays small.

Features at a Glance

  • HTTP methods: GET, POST, PUT, PATCH, DELETE
  • Request bodies (CLI via -b) and headers (programmatic API)
  • Response time + uptime % tracking
  • Statuses: up / degraded / down
  • Retry with exponential backoff (configurable)
  • Degraded threshold (default 2000ms, customizable)
  • Clean, colorful terminal output (powered by logfx)
  • JSON/CSV export on exit (Ctrl+C)
  • --json mode for scripts/CI
  • Programmatic API for Node.js/TS apps

Quick Start

Try it instantly without installing:

npx upstatus https://api.github.com
Enter fullscreen mode Exit fullscreen mode

Or install globally:

npm install -g upstatus

# Basic check
upstatus https://api.example.com

# Multiple + custom interval (default 30s)
upstatus https://api1.com https://api2.com -i 15

# POST with body
upstatus https://api.example.com/health -m POST -b '{"probe":"full"}'

# Degraded >800ms + export
upstatus https://slow-api.com -d 800 --export json -o uptime-log.json
Enter fullscreen mode Exit fullscreen mode

Example Output

✅ https://api.example.com ........ 187ms (99.8% uptime)
⚠️ https://slow-api.com ......... 1450ms (98.7% uptime) [degraded]
🔴 https://down.example.com ..... DOWN (last check failed)
Enter fullscreen mode Exit fullscreen mode

CI/CD & Scripting

Use JSON mode in pipelines:

upstatus https://prod-api.com --json > status.json

# Fail build if uptime < 99%
if jq -e '.uptime < 99' status.json; then 
  echo "Uptime requirement not met!" && exit 1 
fi
Enter fullscreen mode Exit fullscreen mode

Or use it as a library (full config including headers, timeouts, retries):

import { MonitorManager } from 'upstatus';

const manager = new MonitorManager();

manager.add({
  url: 'https://api.example.com',
  interval: 30,
  method: 'POST',
  body: JSON.stringify({ check: 'deep' }),
  headers: { 'Authorization': 'Bearer token' },
  degradedThreshold: 1500,
  expectedStatus: [200, 201],
  timeout: 10000,
  maxRetries: 2,
  retryDelay: 1000,
});

manager.startAll();

console.log(manager.getMonitor('api.example.com')?.getStats());
Enter fullscreen mode Exit fullscreen mode

Under the Hood

Built with TypeScript + Node.js:

  • Built-in Node HTTP for requests (no heavy deps)
  • Custom interval + Ctrl+C handling for clean exports
  • Colorful output via logfx
  • Zero deps beyond basics, MIT licensed, small core

Status Meanings

Status Meaning
✅ up Expected status, under threshold
⚠️ degraded Expected status, but too slow
🔴 down Timeout, error, wrong status, etc.

Try It Out

If you're tired of heavy monitoring for simple needs — especially POST endpoints or quick CI checks — give it a spin. Star it if it helps, open issues/PRs for features, or just let me know what you think.

What simple monitoring hacks do you use in your terminal or CI? Or are you also fed up with bloated uptime tools? Drop your thoughts below 👇

Top comments (0)