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

openlap

v0.1.11

Published

Request-lapping wrapper for the OpenCode CLI

Readme

Note: openlap is an independent community project related to OpenCode. It is not built by the OpenCode team and is not officially affiliated with OpenCode.


Installation

Recommended (release artifact + PATH fix):

curl -fsSL https://openlap.dev/install.sh | bash -s -- --channel release --fix-path

Install from npm:

npm install -g openlap

Install from source:

npm install
npm run build
npm link

Quick Start

# inline prompt
openlap "Review this repository for launch readiness"

# prompt selector from configured paths
openlap prompt

# prompt from file
openlap --file ./prompt.md

# prompt from file with extra instruction
openlap --file ./prompt.md --instruction "Prioritize docs and tests"

# built-in examples
openlap --list-examples
openlap --example explain

# open the OpenTUI input view with a loaded prompt file
npm run test:load-ppropt

# stdin / clipboard modes
echo "Audit security config" | openlap
openlap --copy

# CI-safe one-shot JSON output
openlap --no-interactive --output-format json-final --file ./prompt.md

# launch directly into OpenCode TUI with combined prompt text
openlap --launch-tui --file ./prompt.md --instruction "Prioritize risk and rollout steps"

How It Works

  • Choose one input source: inline text, --file, or --example
  • Run once from terminal/scripts/CI
  • In TTY terminals, openlap automatically hands off to interactive OpenCode for the same session

One-shot mode (no handoff):

openlap --no-interactive "Audit this repository and suggest refactors"

JavaScript API

import lap from 'openlap';

await lap({
  promptFilePath: './prompt.md',
  cwd: process.cwd(),
  showToolOutput: true,
});

Common Flags

  • --model <name> set model id
  • --input append extra input after your primary prompt source (interactive prompt or piped stdin)
  • --input interactive mode now uses an OpenTUI editor; submit with Ctrl+D (or Cmd/Ctrl+Enter), cancel with Esc
  • --output-format <pretty|raw|json-events|json-final|jsonl> set output shape
  • --launch-tui launch OpenCode TUI directly via opencode --prompt with your fully combined prompt
  • --show-tool-output print tool output lines
  • --print-logs --log-level <DEBUG|INFO|WARN|ERROR> include OpenCode logs
  • --status-json emit one machine-readable run-end status JSON object to stderr
  • --question-policy <fail-fast|default-answer|abort> control behavior when a run calls a question tool in non-interactive mode
  • --question-default-answer <text> default answer text used with --question-policy default-answer
  • --thinking-models <csv> and --thinking-color <yellow|cyan|magenta|blue|gray> style thinking output
  • --completions <bash|zsh|fish> print shell completion script
  • --doctor run environment diagnostics

Use openlap --help for the full option list.

CI example using --status-json:

if ! openlap --no-interactive --status-json --output-format json-final --file ./prompt.md 2>status.log >result.json; then
  exit 1
fi

status=$(jq -r 'select(.type=="openlap.run.terminal_state") | .status' status.log | tail -n 1)
if [ "$status" != "completed" ]; then
  echo "openlap run ended with status: $status" >&2
  exit 1
fi

Configuration

Set defaults in either:

  • openlap.json
  • .openlap.json
  • package.json under openlap

Supported keys:

  • model
  • thinking-models
  • thinking-color
  • no-interactive
  • prompt-search-paths (string or array of paths/aliases to markdown prompt files)

When prompt-search-paths is configured, run openlap prompt to open a prompt selector TUI and choose a markdown prompt before running.

Example openlap.json:

{
  "prompt-search-paths": ["@prompt-templates/", "./prompts/"]
}

Environment variable overrides:

  • OPENLAP_MODEL
  • OPENLAP_CWD
  • OPENLAP_THINKING_MODELS
  • OPENLAP_NO_INTERACTIVE
  • OPENLAP_PROMPT_SEARCH_PATHS

Development

npm install
npm run lint
npm run build
npm test

Useful scripts:

  • npm run dev run CLI from source (tsx src/cli.ts)
  • npm run typecheck run TypeScript checks only
  • npm run web start website dev server
  • npm run release:patch|minor|major bump version, tag, and push

Git hooks:

  • pre-commit: runs npm run check:precommit (lint)
  • pre-push: runs npm run check:prepush (test + build)

Release process:

  • See RELEASING.md for version/tag/publish workflow.

Website (web/)

This repo includes the Astro site used for openlap.dev.

npm run web:install
npm run web:dev
npm run web:build
npm run web:preview

Deploy to Cloudflare Pages:

npm run web:deploy

Direct Wrangler CLI deploy (uses web/wrangler.toml):

npx wrangler pages deploy --config ./web/wrangler.toml

Troubleshooting

  • openlap not found: run openlap --doctor and verify your npm global bin is in PATH
  • opencode not found: install/link OpenCode CLI so opencode is available
  • Invalid --file or --cwd: verify paths exist and are accessible