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

@opstrails/cli

v0.1.0

Published

CLI for OpsTrails event ingestion

Readme

@opstrails/cli

CLI for OpsTrails event ingestion.

Track deployments, rollbacks, releases, and other infrastructure events from your terminal or CI/CD pipeline.

Installation

npm install -g @opstrails/cli

Or run directly with npx:

npx @opstrails/cli track --type deployment --source "//github.com/org/repo"

Configuration

Set your API key as an environment variable:

export OPSTRAILS_API_KEY=ot_your_api_key

Get your API key from the OpsTrails Console.

Optionally override the API URL:

export OPSTRAILS_API_URL=https://api-staging.opstrails.dev

Commands

opstrails track

Track an infrastructure event.

opstrails track \
  --type deployment \
  --source "//github.com/org/repo" \
  --subject production \
  --version v1.2.3 \
  --severity LOW \
  --description "Deployed v1.2.3"

Options

| Flag | Required | Description | |------|----------|-------------| | -t, --type <type> | Yes | Event type (e.g. deployment, rollback, release) | | -s, --source <source> | Yes | Event source URI (e.g. //github.com/org/repo) | | --subject <subject> | No | Event subject (e.g. environment name) | | --version <version> | No | Version string (e.g. v1.2.3) | | --severity <severity> | No | LOW, MINOR, MAJOR, or CRITICAL | | --description <desc> | No | Event description | | --id <id> | No | Custom event ID | | --time <time> | No | Event time (ISO 8601 or NOW) | | --data <json> | No | Additional data as JSON string | | --json | No | Output as JSON (machine-readable) |

opstrails whoami

Show current API key info.

opstrails whoami
# ✓ API key configured
#   Key:   ot_abc...xyz
#   Scope: READ_WRITE
#   URL:   https://api.opstrails.dev

CI/CD Usage

GitHub Actions

- name: Track deployment
  run: npx @opstrails/cli track --type deployment --source "//github.com/$GITHUB_REPOSITORY" --version "$GITHUB_SHA"
  env:
    OPSTRAILS_API_KEY: ${{ secrets.OPSTRAILS_API_KEY }}

Generic CI

npx @opstrails/cli track \
  --type deployment \
  --source "//github.com/org/repo" \
  --version "$BUILD_VERSION" \
  --subject production \
  --severity LOW \
  --description "Deployed by CI" \
  --json

Exit code is 0 on success, 1 on failure.

Error Handling

| Error | Cause | |-------|-------| | OPSTRAILS_API_KEY environment variable is required | API key not set | | Invalid severity | Severity not one of LOW, MINOR, MAJOR, CRITICAL | | Invalid JSON in --data flag | --data value is not valid JSON | | UNAUTHORIZED | Invalid API key | | FORBIDDEN | API key lacks write permission (read-only otr_ key) | | VALIDATION_ERROR | Request payload validation failed | | QUOTA_EXCEEDED | Monthly event quota reached |

Programmatic Usage

For programmatic access, use the @opstrails/sdk package:

import { OpsTrailsClient } from '@opstrails/sdk'

const client = new OpsTrailsClient({ apiKey: 'ot_your_api_key' })
await client.trackEvent({ type: 'deployment', source: '//github.com/org/repo' })

License

MIT