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

@anyr/cli

v0.2.8

Published

AnyRouter CLI — one key launches Claude Code, Codex, Grok Build, and more through the gateway. `npx @anyr/cli <tool>`

Readme

@anyr/cli

The AnyRouter CLI — one key points your favorite AI coding tools at the gateway. Launch Claude Code, Codex, Grok, opencode, or Poolside through AnyRouter, or export a ready-to-paste config for Cursor, Cline, and Windsurf.

npx @anyr/cli            # no arg → animated onboarding TUI
npx @anyr/cli chat       # chat with any model right in your terminal
npx @anyr/cli claude     # launch Claude Code through the gateway
npx @anyr/cli codex      # launch Codex
npx @anyr/cli pool       # launch Poolside through the gateway
npx @anyr/cli opencode   # launch opencode

The package installs three bin aliases — use whichever you like:

npx @anyr/cli claude
anyr claude
anyrouter claude
ar claude

First run sets you up once (paste an sk-ar- key or log in at anyrouter.dev/cli/authorize). Config is saved to ~/.anyrouter/config.yaml (a one-time migration copies any older ~/.config/anyrouter/config.yaml forward).

Targets

Run npx @anyr/cli <target>. There are two kinds:

Built-in targets run inside the CLI and call the gateway directly (no child process). Pick them from the launcher menu (npx @anyr/cli, then ‹ › on the Launch row to switch target):

| Target | What | |--------|------| | AnyRouter Chat | Streaming chat TUI (also npx @anyr/cli chat) | | AnyRouter Agent | Autonomous agents + cloud skills (coming soon) |

Spawn targets launch the tool as a child process pointed at the gateway:

| Target | Tool | Command | |--------|------|---------| | claude | Claude Code | npx @anyr/cli claude | | codex | Codex | npx @anyr/cli codex | | grok | Grok Build | npx @anyr/cli grok | | pool | Poolside | npx @anyr/cli pool | | opencode | opencode | npx @anyr/cli opencode |

Editor targets can't be launched from a terminal, so the CLI shows a copy-paste config block (base URL + key) to drop into the editor's settings:

| Target | Editor | |--------|--------| | cursor | Cursor | | cline | Cline | | windsurf | Windsurf |

Chat in your terminal

npx @anyr/cli chat                       # pick up your saved key, start chatting
npx @anyr/cli chat --model z-ai/glm-5.2  # start on a specific model
npx @anyr/cli chat --effort high         # turn on extended reasoning

chat is a streaming REPL built straight on @anyr/sdk (no extra dependencies). It auto-connects with your saved key — or, on a fresh machine, runs the same one-time setup as the launchers (paste a key, browser login, or --device-code for SSH). Features:

  • Streaming replies with live reasoning rendering (dimmed, when the model emits it — reasoning or reasoning_content).
  • Switch models mid-chat (/model opens a fuzzy picker, or /model <id>).
  • Tune reasoning with /effort low|medium|high|xhigh|max|off and toggle the reasoning display with /reasoning.
  • Automatic context compaction — older turns are summarized as you approach the model's context window (re-sized when you switch models); force it with /compact.
  • Slash commands (Tab-completes): /help /model /effort /reasoning /system /compact /clear /retry /tokens /models /save /exit.
  • Controls: Ctrl-C stops a streaming reply, Ctrl-D quits.

How it routes your tools

The CLI never edits a tool's own config files or stores credentials inside them. For spawn targets it sets the gateway base URL and auth token only in the environment of the child process it launches — e.g. ANTHROPIC_BASE_URL for Claude Code, OPENAI_BASE_URL for Codex and opencode, GROK_MODELS_BASE_URL for Grok. The override lives only for that session; quit the tool and nothing about your global setup has changed.

Editor targets get the same values rendered as a KEY=VALUE block you paste into the editor yourself — nothing is written on your behalf.

The TUI

Running with no target opens an animated onboarding flow, then a menu. It's a raw-ANSI terminal UI with zero runtime dependencies (network calls go through @anyr/sdk), so it starts fast and adds nothing to your node_modules.

  • Animated onboarding — a progressive logo reveal and a braille spinner for async steps. Honors NO_COLOR and non-TTY terminals: in those it renders plainly with no animation.
  • Adaptive settings panel — the settings shown change per target. Claude Code and Codex expose model, reasoning effort, and routing preset; Grok exposes model and base URL; editor targets expose base URL and key for the config export. You only see the knobs a given target actually has.

Flags

npx @anyr/cli claude --model auto --effort high -- --resume
npx @anyr/cli claude --model "anthropic/claude-sonnet-4.6"
npx @anyr/cli codex --effort xhigh
npx @anyr/cli claude --dry-run        # print child command + env (secrets redacted)

Commands

| Command | Description | |---------|-------------| | npx @anyr/cli chat | Chat with any model in your terminal (streaming TUI) | | npx @anyr/cli claude | Launch Claude Code | | npx @anyr/cli cc | Alias of claude | | npx @anyr/cli codex | Launch Codex | | npx @anyr/cli grok | Launch Grok Build | | npx @anyr/cli pool | Launch Poolside | | npx @anyr/cli opencode | Launch opencode | | npx @anyr/cli setup | Save a local profile | | npx @anyr/cli models | List catalog model ids | | npx @anyr/cli config | Inspect or switch profiles |

Config

npx @anyr/cli config get       # redacted summary
npx @anyr/cli config get --json # redacted config as JSON
npx @anyr/cli config path      # config file location
npx @anyr/cli config use work
npx @anyr/cli models           # catalog ids for --model
npx @anyr/cli models --json    # catalog as { auto, preset, models[] } JSON

What's new

See CHANGELOG.md for the release history. Highlights: animated onboarding TUI with NO_COLOR / non-TTY fallbacks, an adaptive per-target settings panel, nine targets (six spawn + three editor config-export), runtime-env-only routing (the tool's own config is never touched), and all gateway calls centralized through @anyr/sdk so the CLI stays dependency-free.

Deprecated packages

Per-tool launcher packages (@anyr/claude, @anyr/codex, @anyrouterdev/cc, etc.) are deprecated. They still work via shims that forward to @anyr/cli <tool> but will be removed in a future release.

Docs: https://anyrouter.dev/docs/cli