npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oneuptime/cli

v10.0.35

Published

OneUptime CLI - Command-line interface for managing OneUptime resources

Readme

@oneuptime/cli

Command-line interface for managing OneUptime resources. Supports all MCP-enabled resources with full CRUD operations, named contexts for multiple environments, and flexible output formats.

Installation

npm install -g @oneuptime/cli

Or run directly within the monorepo:

cd CLI
npm install
npm start -- --help

Quick Start

# Authenticate with your OneUptime instance
oneuptime login <api-key> <instance-url>
oneuptime login sk-your-api-key https://oneuptime.com

# List incidents
oneuptime incident list --limit 10

# Get a single resource by ID
oneuptime monitor get 550e8400-e29b-41d4-a716-446655440000

# Create a resource
oneuptime monitor create --data '{"name":"API Health","projectId":"..."}'

# See all available resources
oneuptime resources

Authentication & Contexts

The CLI supports multiple authentication contexts, making it easy to switch between environments.

Setting Up

# Create a production context
oneuptime login sk-prod-key https://oneuptime.com --context-name production

# Create a staging context
oneuptime login sk-staging-key https://staging.oneuptime.com --context-name staging

Switching Contexts

# List all contexts
oneuptime context list

# Switch active context
oneuptime context use staging

# Show current context
oneuptime context current

# Delete a context
oneuptime context delete old-context

Credential Resolution Order

  1. CLI flags: --api-key and --url
  2. Environment variables: ONEUPTIME_API_KEY and ONEUPTIME_URL
  3. Current context from config file (~/.oneuptime/config.json)

Command Reference

Authentication

| Command | Description | |---|---| | oneuptime login <api-key> <url> | Authenticate and create a context | | oneuptime context list | List all contexts | | oneuptime context use <name> | Switch active context | | oneuptime context current | Show current context | | oneuptime context delete <name> | Remove a context | | oneuptime whoami | Show current auth info |

Resource Operations

Every discovered resource supports these subcommands:

| Subcommand | Description | |---|---| | <resource> list [options] | List resources with filtering and pagination | | <resource> get <id> | Get a single resource by ID | | <resource> create --data <json> | Create a new resource | | <resource> update <id> --data <json> | Update an existing resource | | <resource> delete <id> | Delete a resource | | <resource> count [--query <json>] | Count resources |

List Options

--query <json>    Filter criteria as JSON
--limit <n>       Maximum number of results (default: 10)
--skip <n>        Number of results to skip (default: 0)
--sort <json>     Sort order as JSON (e.g. '{"createdAt": -1}')
-o, --output      Output format: json, table, wide

Utility Commands

| Command | Description | |---|---| | oneuptime version | Print CLI version | | oneuptime whoami | Show current authentication info | | oneuptime resources | List all available resource types |

Output Formats

| Format | Description | |---|---| | table | Formatted ASCII table (default for TTY) | | json | Raw JSON (default when piped) | | wide | Table with all columns shown |

# Explicit format
oneuptime incident list -o json
oneuptime incident list -o table
oneuptime incident list -o wide

# Pipe to jq (auto-detects JSON)
oneuptime incident list | jq '.[].title'

Scripting Examples

# List incidents as JSON for scripting
oneuptime incident list -o json --limit 100

# Count resources with filter
oneuptime incident count --query '{"currentIncidentStateId":"..."}'

# Create from a JSON file
oneuptime monitor create --file monitor.json

# Use environment variables in CI/CD
ONEUPTIME_API_KEY=sk-xxx ONEUPTIME_URL=https://oneuptime.com oneuptime incident list

Environment Variables

| Variable | Description | |---|---| | ONEUPTIME_API_KEY | API key for authentication | | ONEUPTIME_URL | OneUptime instance URL | | NO_COLOR | Disable colored output |

Configuration File

The CLI stores configuration at ~/.oneuptime/config.json with 0600 permissions. The file contains:

{
  "currentContext": "production",
  "contexts": {
    "production": {
      "name": "production",
      "apiUrl": "https://oneuptime.com",
      "apiKey": "sk-..."
    }
  },
  "defaults": {
    "output": "table",
    "limit": 10
  }
}

Global Options

| Option | Description | |---|---| | --api-key <key> | Override API key for this command | | --url <url> | Override instance URL for this command | | --context <name> | Use a specific context for this command | | -o, --output <format> | Output format: json, table, wide | | --no-color | Disable colored output |

Supported Resources

Run oneuptime resources to see all available resource types. Resources are auto-discovered from OneUptime models that have MCP enabled. Currently supported:

  • Incident - Manage incidents
  • Alert - Manage alerts
  • Monitor - Manage monitors
  • Monitor Status - Manage monitor statuses
  • Incident State - Manage incident states
  • Status Page - Manage status pages
  • On-Call Policy - Manage on-call duty policies
  • Team - Manage teams
  • Scheduled Maintenance Event - Manage scheduled maintenance

As more models are MCP-enabled in OneUptime, they automatically become available in the CLI.

Development

cd CLI
npm install
npm start -- --help     # Run via ts-node
npm test                # Run tests
npm run compile         # Type-check

License

Apache-2.0