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

@2kw/ai

v6.1.0

Published

CLI for 2kw.ai — schema-driven document extraction, an OpenAI-compatible EU LLM gateway, transcription, prompts, datasets, and experiments from your terminal or agentic workflows. Ships as 2kw, backbone, and bb.

Readme

2kw.ai CLI

The command-line interface for 2kw.ai — the EU-hosted AI integration platform. Run schema-driven document extraction, route LLM calls through an OpenAI-compatible gateway, transcribe audio, and manage prompts, datasets, and experiments — from your terminal or inside agentic workflows.

Installs three equivalent binaries: 2kw, backbone, and bb.

Installation

# Latest stable release
npm install -g @2kw/ai

# Pre-release (dev channel)
npm install -g @2kw/ai@dev

The CLI notifies you when a newer version is available.

Quick Start

# Authenticate — opens your browser, no API key needed (7-day free trial)
2kw auth login

# Define a schema and run an extraction
2kw schemas create -n "Invoice"
2kw extractions create --schema <id> -m gpt-4o --text "Invoice #123, Total: €500"

# Convert and transcribe
2kw convert file report.docx --format md
2kw transcribe call.mp3 --format srt

# Chat through the gateway
2kw ai chat -m gpt-4o --message "Draft a summary of this quarter's extraction volume"

All commands work identically as bb for quick access — e.g. bb schemas list.

Authentication

Sign in via the browser (recommended):

2kw auth login

This opens your browser, asks you to confirm a short code, and signs the CLI in with your user account — no API key to copy. Your session lasts 7 days of inactivity and renews itself while you keep using the CLI. If you belong to several organizations you pick one at login, and can switch any time with 2kw context set-org — no re-login needed. 2kw auth logout clears the local credentials and signs the session out server-side (best-effort).

For CI, scripts, or air-gapped machines, store an org API key instead (create one under Settings → API Keys in the web app):

2kw auth login --api-key sk_...   # save a key directly
2kw auth login --manual           # prompted setup (legacy flow)

Explicit API keys always take priority over a stored browser session (highest priority first):

| Method | Example | |--------|---------| | CLI flags | --api-key sk_... --base-url https://... | | Environment variables | AI_2KW_API_KEY, AI_2KW_BASE_URL (legacy: BACKBONE_*) | | Local .2kw file | JSON file in the current directory (legacy: .backbone) | | Config store | Set via 2kw auth login (browser session or saved key) |

2kw auth status    # Verify credentials (works for both auth types)
2kw auth logout    # Clear credentials and send a server-side sign-out

Note: config get apiKey --json returns a masked value — stored secrets do not round-trip through stdout. Scripts needing the raw key should use AI_2KW_API_KEY or read the config file (path shown by config list).

Contexts

kubectl-style contexts switch between organizations and environments:

2kw context list              # List all contexts
2kw context use acme-corp     # Switch active context
2kw context create staging    # Create a new context

Commands

| Command | Description | |---------|-------------| | auth | Login, logout, and check auth status | | config | Get, set, and list configuration values | | context | Manage contexts for multiple orgs/environments | | schemas | Manage schemas, versions, labels, validation, and testing | | prompts | Versioned prompt management, labels, compilation, testing | | extractions | Create extractions (text, file, images), list, re-run, estimate tokens | | convert | Convert PDF, DOCX, XLSX, images, and 20+ formats to Markdown/text/HTML/JSON | | ai | Chat completions, Responses (agent or direct model, streaming), and model listing via the OpenAI-compatible gateway | | transcribe | Transcribe audio (FLAC, MP3, MP4, OGG, WAV, WebM) | | datasets | Build datasets and dataset versions for evaluation | | experiments | Run experiments against datasets | | evaluators | Manage evaluator templates | | scores | Record and inspect quality scores | | tracing | Inspect request traces and tracing settings | | providers | Manage BYOK AI providers | | analytics | Usage analytics: spend, quality, providers, errors | | billing | Check subscription tier and usage limits | | agents | Manage agents, versions, labels, approvals, and tool catalogs | | conversations | Create and manage conversations and their items | | knowledge | Manage knowledge bases, documents, search, and citations | | files | Upload, download, and manage files | | installations | Manage surface installations, keys, origins, and pairing | | docs | Browse API documentation from the terminal |

Global Options

| Flag | Description | |------|-------------| | --api-key <key> | Override the API key | | --base-url <url> | Override the base URL (defaults to the 2kw.ai cloud API) | | --json | Output raw JSON instead of formatted tables — built for scripting and agents | | --no-color | Disable colored output |

Why 2kw.ai

  • EU data residency — built-in models run GDPR-compliant and EU-hosted, operated by Manfred Kunze Development GmbH (Germany)
  • Grounding scores — every extracted value links back to where it came from in the source document
  • One platform — gateway, extraction, transcription, and observability share one API and one bill

Related

License

Proprietary — see LICENSE for details.