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

@sleepwalkerai/cli

v0.3.1

Published

Command-line client for the Sleepwalker API.

Readme

Sleepwalker CLI

Command-line client for the Sleepwalker API.

Most commands are a thin client over the hosted API and do not run Sleepwalker analysis locally. The exception is okf export, which is free and runs entirely on your machine.

Public package:

@sleepwalkerai/cli

Install

npm install -g @sleepwalkerai/cli
sleepwalker init
sleepwalker auth key set sw_api_live_...
sleepwalker menu
sleepwalker doctor
sleepwalker commands

One-off usage:

npx @sleepwalkerai/cli doctor

Local usage

From the root of this repository:

node packages/cli/bin/sleepwalker.js
node packages/cli/bin/sleepwalker.js menu
node packages/cli/bin/sleepwalker.js init
node packages/cli/bin/sleepwalker.js commands

With an API key:

export SLEEPWALKER_API_KEY=sw_api_live_...
node packages/cli/bin/sleepwalker.js credits

Or store the key locally:

node packages/cli/bin/sleepwalker.js auth key set sw_api_live_...
node packages/cli/bin/sleepwalker.js doctor

To point the CLI at a non-production API base:

node packages/cli/bin/sleepwalker.js config set api-base-url https://api.sleepwalker.ai
node packages/cli/bin/sleepwalker.js config show

Examples

sleepwalker init
sleepwalker menu
sleepwalker doctor
sleepwalker page serialize https://www.sleepwalker.ai
sleepwalker reports by-url https://www.sleepwalker.ai
sleepwalker visibility run https://www.sleepwalker.ai --brand Sleepwalker --prompt "What are the best AI visibility tools?" --platform perplexity --watch
sleepwalker ci score https://www.sleepwalker.ai
sleepwalker ci run https://www.sleepwalker.ai --depth full --watch
sleepwalker activity list
sleepwalker okf export https://www.sleepwalker.ai

okf export is free, open source (MIT, like the rest of this CLI), and runs entirely on your machine. It fetches the page and writes an Open Knowledge Format bundle (agent-ready markdown) to a local directory. No account, no API key, no credits. Use --out <dir> to choose the destination and --force to overwrite. Hostile page content is sanitized (control characters, ANSI escapes, and bidi overrides are stripped), fetches time out after 30 seconds, and oversized pages are truncated with a note in log.md.

Add --json to print raw API responses.

Pick the AI model per run

Every platform runs its default model unless you choose another one. List the options and prices, then pin a model with --model:

sleepwalker visibility models
sleepwalker visibility run https://www.sleepwalker.ai \
  --brand Sleepwalker \
  --prompt "What are the best AI visibility tools?" \
  --platform openai \
  --model latest

--model takes a model id from visibility models, or one of the keywords latest, prior, and default, which resolve to the platform's current model for that role. With several platforms, scope each value: --model openai=latest --model perplexity=sonar-pro. Every model has its own per-probe price, defaults included (run sleepwalker visibility models to see them; most platform defaults cost 1 credit). Run results record the exact model that answered.

For retryable scripts, pass your own idempotency key on persisted run creation:

sleepwalker visibility run https://www.sleepwalker.ai \
  --brand Sleepwalker \
  --prompt "What are the best AI visibility tools?" \
  --platform perplexity \
  --idempotency-key visibility-sleepwalker-homepage-001

--watch polls for completion and stops after 15 minutes by default. Override that with --max-wait-seconds <seconds> when a workflow needs a shorter or longer wait.

Smoke tests

Local command smoke:

npm run smoke

Read-only live smoke with a real API key:

export SLEEPWALKER_API_KEY=sw_api_live_...
npm run smoke:live

The live smoke does not run billable actions by default. To include one intentional serialization action:

SLEEPWALKER_CLI_SMOKE_WRITE=1 npm run smoke:live

Terminal color

Human output uses Sleepwalker-inspired terminal color when the terminal supports it:

  • green for successful AI Visibility / completed states;
  • purple for Content Intelligence;
  • cyan/blue for IDs, URLs, and API paths;
  • yellow/red for queued, blocked, or failed work.

Colors are never added to --json output. Set NO_COLOR=1 to disable styling or FORCE_COLOR=1 to force it in supported terminals.

If your current shell exports NO_COLOR, remove it while previewing:

env -u NO_COLOR FORCE_COLOR=1 node packages/cli/bin/sleepwalker.js --help