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

@ai-digital-factory/lms-cli

v0.1.10

Published

Command-line interface for querying stored application logs

Readme

@ai-digital-factory/lms-cli

Provider-neutral CLI for coding agents and operators to discover streams and Query stored application logs. Application logging still goes through @ai-digital-factory/logging. This package only reads.

Use this README as the contract. Do not infer provider-specific URLs, headers, or admin APIs.

Goal

Given maintainer connection details, list stream names and run SQL Queries over a required time range. Print JSON to stdout. Never print credentials.

Install and run

Node.js 22 or newer.

# one-shot (preferred for agents)
npx --yes @ai-digital-factory/lms-cli help
npx --yes @ai-digital-factory/lms-cli streams
npx --yes @ai-digital-factory/lms-cli query --sql 'SELECT * FROM "STREAM"' --from 2026-09-21T00:00:00Z --to 2026-09-21T01:00:00Z

# or install
pnpm add -g @ai-digital-factory/lms-cli
lms help

The published binary is lms. It reads only process.env. It never loads .env or .env.local. The launcher (npx, CI, a shell, or pnpm cli in this repo) must inject the variables.

Required environment

Ask the logging maintainer for:

| Variable | Meaning | | --- | --- | | LOG_URL | HTTPS origin of the logging destination, covering every stream (example: https://logger.example). An empty path uses organization default. Use /api/{org} only when the organization is not default. HTTP is upgraded to HTTPS except on localhost. | | LOG_CREDENTIAL | Opaque Base64 credential. Query and streams need a search-capable credential, not an ingest-only token. Encode email:password (or email + search token) the same way as pnpm credential. |

Never hard-code, log, or commit either value. If a Query returns 401/403, replace the ingest token with the native logging-destination login used in the UI.

export LOG_URL='https://logger.example'
export LOG_CREDENTIAL='<opaque-credential>'

Agent workflow

Run commands in this order:

  1. lms help — confirm streams and query.
  2. lms streams — JSON array of stream names for SQL FROM.
  3. lms query --sql ... --from ... --to ... — JSON array of matching rows.

Do not call provider consoles, invent extra subcommands, or skip the time range.

Commands

lms help

Exit 0. Human-readable usage on stdout.

lms streams

Exit 0. Stdout is a JSON array of strings:

["lmt_dev","example_server","lmt_local","lmt_prod"]

Use those names in query SQL, usually quoted: SELECT * FROM "lmt_dev".

lms query

Required flags:

| Flag | Value | | --- | --- | | --sql | SQL. Include FROM "<stream>" using a name from streams. | | --from | Range start, UTC ISO-8601 with Z (example: 2026-09-21T12:30:00Z) | | --to | Range end, UTC ISO-8601 with Z, strictly after --from |

Optional: --limit (default 100, maximum 1000).

Exit 0. Stdout is a JSON array of row objects. No matches → [].

npx --yes @ai-digital-factory/lms-cli query \
  --sql 'SELECT * FROM "lmt_dev"' \
  --from 2026-09-21T12:30:00Z \
  --to 2026-09-21T14:00:00Z

Errors

Non-zero exit. Short message on stderr. Messages may include HTTP status and a sanitized destination reason. They must not include credentials, URLs, or the SQL text.

| Symptom | What to do | | --- | --- | | LOG_URL must be configured / LOG_CREDENTIAL must be configured | Export both variables in this process | | --sql / --from / --to missing or invalid | Pass all three; --from/--to must be ...Z UTC instants | | --limit must be at most 1000 | Lower --limit | | 401 / 403 / not authorized to Query | Use a search-capable credential (UI/native login), not an ingest-only token | | 400 | Fix SQL or the time range | | Timeout | Narrow --from / --to | | Unexpected result / not JSON | Maintainer/destination problem; retry later |

Do not

  • Load .env inside the published CLI
  • Pass --from/--to without Z
  • Assume a default time window
  • Treat ingest-only SDK tokens as sufficient for streams or query
  • Expect table-formatted output, pagination, ingest, or tail
  • Print LOG_CREDENTIAL or LOG_URL in agent traces