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

apiflux-cli

v0.8.1

Published

One-command setup of ApiFlux for local AI coding tools (Claude Code, Codex CLI, OpenCode, Pi, Hermes, OpenClaw)

Readme

apiflux-cli

npm CI license

One-command setup of ApiFlux for your local AI coding tools.

npx apiflux-cli init

Paste your ApiFlux API key when prompted, pick the tools to configure, done. The CLI writes the correct base URL and key into each tool's config, verifies the key with a real request, and tells you exactly what it changed.

Supported tools

| Tool | What gets configured | | --- | --- | | Claude Code | ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN in ~/.claude/settings.json | | Codex CLI | model_providers.apiflux in ~/.codex/config.toml (key stays in the APIFLUX_API_KEY env var, never in the file); with --model, also sets it as the default provider/model | | OpenCode | provider.apiflux in ~/.config/opencode/opencode.json with every model your key can use; key goes to OpenCode's own credential store (~/.local/share/opencode/auth.json, 0600), never into the config file; with --model, also sets it as the default model | | Pi | providers.apiflux in ~/.pi/agent/models.json with every model your key can use; key goes to Pi's own credential store (~/.pi/agent/auth.json, 0600), never into the config file; with --model, also persists it via defaultProvider/defaultModel in settings.json | | Hermes | custom_providers entry in ~/.hermes/config.yaml (comment-preserving YAML edit) with every model your key can use; key goes to ~/.hermes/.env as APIFLUX_API_KEY (0600), never into config.yaml; with --model, also sets model.provider/model.default | | OpenClaw | models.providers.apiflux in ~/.openclaw/openclaw.json with every model your key can use; with --model, also sets agents.defaults.model.primary (existing fallbacks kept). Note: like OpenClaw's own config writes, rewriting strips JSON5 comments; $include configs get a manual snippet instead | | Anything OpenAI-compatible | Prints export OPENAI_BASE_URL / OPENAI_API_KEY (and OPENAI_MODEL if chosen) lines for your shell or .env |

Any model your key can use works in any tool — the ApiFlux gateway converts between the Anthropic and OpenAI protocols. Picking a non-Claude model for Claude Code also pins its small/fast background model so every request stays on your chosen model.

Usage

npx apiflux-cli init                      # interactive: hidden key prompt + tool picker
npx apiflux-cli init --key sk-xxx --yes   # non-interactive (as copied from the ApiFlux console)
npx apiflux-cli init --key -              # read the key from stdin

| Flag | Meaning | | --- | --- | | --key <key\|-> | API key; - reads from stdin; omit for a hidden prompt | | --base-url <url> | Override the API origin (self-hosted / testing) | | --tool <id> | Configure only this tool (repeatable): claude-code, codex, opencode, pi, hermes, openclaw, export | | --model <id> | Default model for the configured tools; omit in a terminal to pick from a list, omit in scripts to keep each tool's default | | --yes | Skip confirmations, overwrite conflicting config | | --skip-verify | Don't send the verification request |

Safety

  • Existing config files are backed up (*.bak.<timestamp>) before any write; merges preserve your other settings; re-running is idempotent.
  • If a different base URL or token is already configured, the CLI asks before replacing it.
  • Your key is never written to logs and is masked (sk-***) in every error message.
  • If you pass --key inline, the CLI reminds you to clear it from shell history; prefer the interactive prompt or --key -.
  • The CLI never touches your ApiFlux account — it only ever holds the API key you give it, by design (ADR-0001).

Requirements

Node.js ≥ 18. macOS and Linux supported; Windows via WSL.

Contributing

Issues and pull requests are welcome — see CONTRIBUTING.md.

License

MIT