### Install and Run Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Demonstrates how to run Kumacli without installation using `uvx` or install it globally with `pip`. Also shows local development setup. ```bash # Run without installing (recommended) uvx kumacli --help # Install globally pip install kumacli # Local development uv sync --all-groups uv run kumacli --help ``` -------------------------------- ### Install KumaCLI using uvx Source: https://github.com/vedmaka/kumacli/blob/master/README.md Run KumaCLI without installation using uvx. This is the default method. ```bash uvx kumacli --help ``` -------------------------------- ### Development Setup and Testing Source: https://github.com/vedmaka/kumacli/blob/master/README.md Commands for setting up the development environment and running tests using uv and pytest. ```bash uv sync --all-groups uv run pytest -q ``` -------------------------------- ### Get Global Help Source: https://github.com/vedmaka/kumacli/blob/master/README.md Display help information for the main kumacli command and its subcommands. ```bash uvx kumacli --help uvx kumacli monitors --help uvx kumacli maintenance --help ``` -------------------------------- ### Install KumaCLI from PyPI Source: https://github.com/vedmaka/kumacli/blob/master/README.md Optionally install KumaCLI globally from the Python Package Index using pip. ```bash pip install kumacli ``` -------------------------------- ### Quick Start: Set Environment Variables and List Monitors Source: https://github.com/vedmaka/kumacli/blob/master/README.md Configure Uptime Kuma connection details via environment variables and then list all monitors in JSON format. ```bash export KUMACLI_HOST="http://localhost:3001" export KUMACLI_USERNAME="admin" export KUMACLI_PASSWORD="secret" uvx kumacli monitors list --json ``` -------------------------------- ### Create a recurring weekly maintenance window Source: https://context7.com/vedmaka/kumacli/llms.txt Set up a maintenance window that repeats weekly on a specified day, with defined start and end times and timezone. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ maintenance create \ --title "Weekly DB backup" \ --strategy recurring-weekday \ --weekday 0 \ --time-start "02:00" \ --time-end "04:00" \ --timezone "Europe/Berlin" \ --monitor-id 4 \ --json ``` -------------------------------- ### CI/CD Deployment Script Example Source: https://context7.com/vedmaka/kumacli/llms.txt A bash script demonstrating a typical CI/CD integration pattern. It pauses monitors, creates a maintenance window, deploys an application, resumes monitors, and cleans up the maintenance window. Uses environment variables for authentication and `jq` for parsing JSON output. ```bash #!/usr/bin/env bash # deploy.sh — pause monitors, deploy, create maintenance window, resume set -euo pipefail KUMA="--url $KUMACLI_HOST --username $KUMACLI_USERNAME --password $KUMACLI_PASSWORD" echo "Pausing monitors..." kumacli $KUMA monitors pause --id 1 --json kumacli $KUMA monitors pause --id 2 --json echo "Creating maintenance window..." MAINT_ID=$(kumacli $KUMA maintenance create \ --title "Deploy $(date -u +%Y-%m-%dT%H:%M)" \ --strategy single \ --date-start "$(date -u '+%Y-%m-%d %H:%M')" \ --date-end "$(date -u -d '+2 hours' '+%Y-%m-%d %H:%M')" \ --monitor-id 1,2 \ --json | jq -r '.maintenance_id') echo "Deploying application..." # ... your deploy steps here ... echo "Resuming monitors..." kumacli $KUMA monitors resume --id 1 --json kumacli $KUMA monitors resume --id 2 --json echo "Cleaning up maintenance window..." kumacli $KUMA maintenance delete --id "$MAINT_ID" --json echo "Done." ``` -------------------------------- ### Kumacli .env Configuration Source: https://context7.com/vedmaka/kumacli/llms.txt Example of a `.env` file used for configuring Kumacli connection details like host, username, password, timeout, and TLS verification. ```ini # .env KUMACLI_HOST=http://localhost:3001 KUMACLI_USERNAME=admin KUMACLI_PASSWORD=change-me KUMACLI_TIMEOUT=10 KUMACLI_INSECURE=false ``` -------------------------------- ### Handle maintenance create error for unknown monitor ID Source: https://context7.com/vedmaka/kumacli/llms.txt This example shows how the CLI validates monitor IDs during creation and fails fast if unknown IDs are provided. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ maintenance create --title "Test" --monitor-id 999 ``` -------------------------------- ### Get Specific Monitor Details Source: https://github.com/vedmaka/kumacli/blob/master/SKILL.md Retrieve detailed information for a specific monitor by its ID, with output formatted as JSON. Requires authentication credentials. ```bash uv run kumacli --url http://localhost:3001 --username "$KUMA_USERNAME" --password "$KUMA_PASSWORD" monitors get --id 1 --json ``` -------------------------------- ### monitors get Source: https://context7.com/vedmaka/kumacli/llms.txt Retrieves the full configuration object for a specific monitor by its numeric ID. ```APIDOC ## monitors get ### Description Retrieve the full configuration object for a specific monitor by its numeric ID. ### Method GET (implied) ### Endpoint /api/monitors/{id} (implied) ### Parameters #### Global Connection Flags - `--url` / `--host` (string) - Required - Uptime Kuma base URL - `--username` (string) - Required - Login username - `--password` (string) - Required - Login password - `--timeout` (integer) - Optional - API timeout in seconds (default: 10) - `--insecure` (boolean) - Optional - Disable TLS certificate verification (default: false) #### Command Flags - `--id` (integer) - Required - The numeric ID of the monitor to retrieve. - `--json` (boolean) - Optional - Output in JSON format ### Request Example ```bash kumacli --url http://localhost:3001 --username admin --password secret monitors get --id 1 --json ``` ### Response #### Success Response (200) - `id` (integer) - The unique identifier for the monitor. - `name` (string) - The name of the monitor. - `type` (string) - The type of monitor. - `url` (string) - The URL or hostname being monitored. - `interval` (integer) - The interval in seconds for checking the monitor. - `active` (boolean) - Indicates if the monitor is currently active. - `maxretries` (integer) - The maximum number of retries before marking as down. - `retryInterval` (integer) - The interval in seconds between retries. - ... (other configuration fields) #### Response Example ```json { "id": 1, "name": "Main API", "type": "http", "url": "https://example.com/health", "interval": 60, "active": true, "maxretries": 3, "retryInterval": 30 } ``` ``` -------------------------------- ### Handle monitor update errors Source: https://context7.com/vedmaka/kumacli/llms.txt This example shows an error case where no update fields are provided for a monitor. The CLI will return an error and a non-zero exit code. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ monitors update --id 1 ``` -------------------------------- ### Add HTTP Monitor with Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Example of adding a new HTTP monitor using Kumacli, specifying URL, interval, and retry settings via `--field` flags. Output is JSON. ```bash # HTTP monitor with interval and retry settings via --field kumacli --url http://localhost:3001 --username admin --password secret \ monitors add \ --name "Payment API" \ --type http \ --field "url=https://api.example.com/health" \ --field "interval=60" \ --field "maxretries=3" \ --field "retryInterval=30" \ --json ``` -------------------------------- ### Create Maintenance Window: Single Strategy Source: https://context7.com/vedmaka/kumacli/llms.txt Creates a one-time maintenance window with a specific start and end date and time. This is suitable for scheduled, non-recurring events. ```bash kumacli ... maintenance create --title "Deploy" --strategy single \ --date-start "2026-08-01 20:00" --date-end "2026-08-01 22:00" --monitor-id 1 ``` -------------------------------- ### Get a specific maintenance window Source: https://context7.com/vedmaka/kumacli/llms.txt Fetch the complete configuration details for a single maintenance window using its ID. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ maintenance get --id 5 --json ``` -------------------------------- ### Get Specific Monitor Details with Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Retrieves the full configuration object for a specific monitor by its numeric ID using Kumacli, with JSON output. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ monitors get --id 1 --json ``` -------------------------------- ### Update Monitor Fields with Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Example of updating fields on an existing monitor using Kumacli, specifying the monitor ID and the fields to update via `--field` flags. Output is JSON. ```bash # Update retry count kumacli --url http://localhost:3001 --username admin --password secret \ monitors update --id 1 \ --field "maxretries=5" \ --json ``` -------------------------------- ### maintenance get Source: https://context7.com/vedmaka/kumacli/llms.txt Retrieve the full configuration of a specific maintenance window by its ID. This command is useful for inspecting the detailed settings of a maintenance period. ```APIDOC ## maintenance get Retrieve the full configuration of a maintenance window by ID. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ maintenance get --id 5 --json # Expected output: # { # "id": 5, # "title": "Deploy window", # "status": "active", # "strategy": "manual", # ... # } ``` ``` -------------------------------- ### List, Get, Pause, or Resume Maintenance Windows Source: https://github.com/vedmaka/kumacli/blob/master/SKILL.md Manage maintenance windows by listing all, retrieving a specific one by ID, or changing its state to paused or resumed. All operations use JSON output. ```bash uv run kumacli --url http://localhost:3001 --username "$KUMA_USERNAME" --password "$KUMA_PASSWORD" maintenance list --json ``` ```bash uv run kumacli --url http://localhost:3001 --username "$KUMA_USERNAME" --password "$KUMA_PASSWORD" maintenance get --id 5 --json ``` ```bash uv run kumacli --url http://localhost:3001 --username "$KUMA_USERNAME" --password "$KUMA_PASSWORD" maintenance pause --id 5 --json ``` ```bash uv run kumacli --url http://localhost:3001 --username "$KUMA_USERNAME" --password "$KUMA_PASSWORD" maintenance resume --id 5 --json ``` -------------------------------- ### Add Monitor from JSON File with Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Shows how to add a monitor by loading its configuration from a JSON file using `--data-file` and overriding specific fields with `--field` flags. ```bash # Load full payload from a JSON file, then override a single field kumacli --url http://localhost:3001 --username admin --password secret \ monitors add \ --data-file ./monitor-template.json \ --field "name=Staging API" \ --json ``` -------------------------------- ### Preflight Checks with kumacli Source: https://github.com/vedmaka/kumacli/blob/master/SKILL.md Run these commands to ensure kumacli is set up correctly and to view help for its subcommands. ```bash uv sync --all-groups uv run kumacli --help uv run kumacli monitors --help uv run kumacli maintenance --help ``` -------------------------------- ### List Monitors with Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Demonstrates listing all Uptime Kuma monitors using Kumacli. Shows both human-readable table output and JSON output suitable for scripting. ```bash # Human-readable table kumacli --url http://localhost:3001 --username admin --password secret \ monitors list # JSON output (suitable for jq, scripts) kumacli --url http://localhost:3001 --username admin --password secret \ monitors list --json # Pipe to jq to filter only down monitors kumacli --url http://localhost:3001 --username admin --password secret \ monitors list --json | jq '[.[] | select(.status == "down")]' ``` -------------------------------- ### List Monitors with JSON Output Source: https://github.com/vedmaka/kumacli/blob/master/SKILL.md Use this command to list all monitors with detailed JSON output. Ensure you provide the correct URL, username, and password. ```bash uv run kumacli --url http://localhost:3001 --username "$KUMA_USERNAME" --password "$KUMA_PASSWORD" monitors list --json ``` -------------------------------- ### Create Maintenance Window: Manual Strategy Source: https://context7.com/vedmaka/kumacli/llms.txt Creates a maintenance window with a 'manual' strategy, which requires manual triggering and has no associated schedule. ```bash kumacli ... maintenance create --title "Ad-hoc" --strategy manual --monitor-id 1 ``` -------------------------------- ### Add TCP Port Monitor with Kumacli Source: https://context7.com/vedmaka/kumacli/llms.txt Demonstrates adding a TCP port monitor using Kumacli, specifying hostname and port via `--field` flags. Output is JSON. ```bash # TCP port monitor kumacli --url http://localhost:3001 --username admin --password secret \ monitors add \ --name "Postgres" \ --type port \ --field "hostname=db.internal" \ --field "port=5432" \ --json ``` -------------------------------- ### Create a Maintenance Window Source: https://github.com/vedmaka/kumacli/blob/master/README.md Schedule a maintenance window with a title, strategy, date range, and associate it with specific monitors. ```bash uvx kumacli maintenance create \ --title "Deploy window" \ --strategy single \ --date-start "2026-03-01 22:00" \ --date-end "2026-03-01 23:00" \ --monitor-id 1 --monitor-id 2 ``` -------------------------------- ### Create a one-time maintenance window Source: https://context7.com/vedmaka/kumacli/llms.txt Schedule a single maintenance window for a specific period, attaching multiple monitors by comma-separated IDs. ```bash kumacli --url http://localhost:3001 --username admin --password secret \ maintenance create \ --title "v2.4.0 Deploy" \ --strategy single \ --date-start "2026-06-15 22:00" \ --date-end "2026-06-15 23:30" \ --monitor-id 1,2,3 \ --json ``` -------------------------------- ### Add Monitor with Layered Payload Source: https://context7.com/vedmaka/kumacli/llms.txt Demonstrates adding a monitor using a layered payload system. It shows how to combine a base template from a file, override settings with inline JSON, and further refine fields using the --field option. Later entries take precedence. ```bash # Layer 1: base template from file cat > base.json <