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

@camelai/tldr

v0.1.1

Published

CLI to summarize text with OpenAI, Anthropic, or OpenRouter

Readme

tldr

A tiny CLI that summarizes text using OpenAI, Anthropic, or OpenRouter.

Install

Run locally

npm install
node ./bin/tldr.js --help

Install globally from npm

npm install -g @camelai/tldr

Install from this repo

npm install -g github:qaml-ai/tldr

Usage

As a JavaScript library

import { summarize, resolveConfig } from '@camelai/tldr';

const config = resolveConfig({ provider: 'openai' });
const summary = await summarize('Long text to summarize...', config);

console.log(config.provider, config.model);
console.log(summary);

You can also pass options directly:

import { summarize } from '@camelai/tldr';

const summary = await summarize('Long text to summarize...', {
  provider: 'openrouter',
  model: 'google/gemini-3.1-flash-lite-preview',
  system: 'Summarize in 3 bullet points.'
});

The library uses the same environment variables as the CLI for API keys and default model selection.

Summarize a prompt:

tldr "Summarize the key points from this meeting note..."

Summarize stdin:

cat notes.txt | tldr

Choose a provider explicitly:

tldr --provider openai "text"
tldr --provider anthropic "text"
tldr --provider openrouter "text"

Override the model:

tldr --provider openai --model gpt-5.4-nano "text"
tldr --provider anthropic --model claude-4-haiku-20250305 "text"
tldr --provider openrouter --model google/gemini-3.1-flash-lite-preview "text"

Override the system prompt:

tldr --system "Summarize in 3 bullet points." "text"

Options

  • -p, --provider <name>: openai, anthropic, or openrouter
  • -m, --model <model>: override the model
  • -s, --system <prompt>: override the summarization system prompt
  • -h, --help: show help

Environment variables

API keys:

  • OPENAI_API_KEY
  • ANTHROPIC_API_KEY
  • OPENROUTER_API_KEY

Defaults:

  • TLDR_SYSTEM_PROMPT
  • TLDR_OPENAI_MODEL default: gpt-5.4-nano
  • TLDR_ANTHROPIC_MODEL default: claude-4-haiku-20250305
  • TLDR_OPENROUTER_MODEL default: google/gemini-3.1-flash-lite-preview

Legacy env vars are also supported:

  • SUMMARIZE_SYSTEM_PROMPT
  • SUMMARIZE_OPENAI_MODEL
  • SUMMARIZE_ANTHROPIC_MODEL
  • SUMMARIZE_OPENROUTER_MODEL

Default model selection

If --provider is omitted, tldr picks the first available provider in this order:

  1. OPENAI_API_KEY
  2. ANTHROPIC_API_KEY
  3. OPENROUTER_API_KEY

Library API

summarize(input, options)

Returns a summary string.

Options:

  • provider: openai, anthropic, or openrouter
  • model: optional model override
  • system: optional system prompt override
  • apiKey: optional explicit API key override

resolveConfig(options)

Resolves the effective provider, model, and system prompt using arguments and environment defaults.

detectProvider(explicitProvider)

Returns the selected provider based on an explicit provider or env-var priority.

getDefaultModel(provider)

Returns the default model for a provider.

Publish to npm

When you're ready:

npm publish

Because publishConfig.access is set to public, this package is ready for public npm publishing.

License

MIT