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

@vesely/ai-gateway-cli

v0.2.0

Published

Tiny CLI for generating text and images via the Vercel AI Gateway. One key, hundreds of models.

Readme

ai-gateway

A tiny CLI for generating text, images, and video via the Vercel AI Gateway. One key, hundreds of models, no code required.

ai-gateway "explain quicksort in 3 bullets"
ai-gateway image "a red fox in a snowy forest" -o fox.png
ai-gateway video "a wave crashing on rocks at sunset" --duration 5
cat README.md | ai-gateway "summarize this"

Install

Requires Node 20+.

npm install -g @vesely/ai-gateway-cli

Or with another package manager:

pnpm add -g @vesely/ai-gateway-cli
bun add -g @vesely/ai-gateway-cli

First run

Get an API key from https://vercel.com/ai-gateway and either:

  • Run any command — you'll be prompted to paste it (saved to ~/.config/@vesely/ai-gateway-cli/config.json, chmod 600), or
  • Export it: export AI_GATEWAY_API_KEY=..., or
  • Run ai-gateway config set key sk_...

Commands

| Command | What it does | | --- | --- | | ai-gateway "<prompt>" | Streamed text completion (default command). | | ai-gateway image "<prompt>" | Generate an image, save to disk. | | ai-gateway video "<prompt>" | Generate a video, save to disk. Takes minutes. | | ai-gateway models | List all available models with prices. | | ai-gateway config | Show current config. | | ai-gateway config set <key> <value> | Set key, text-model, image-model, or video-model. |

Defaults

Picked for the best price/quality ratio:

  • Text: xai/grok-4.1-fast-non-reasoning
  • Image: google/imagen-4.0-fast-generate-001
  • Video: xai/grok-imagine-video

Override per-call with -m <model-id>, or persist with ai-gateway config set text-model openai/gpt-5.4.

Examples

# Text with a different model
ai-gateway -m anthropic/claude-opus-4.6 "draft a tweet about CLIs"

# Pipe context in
git diff | ai-gateway "write a commit message for this diff"

# Get raw JSON (no streaming)
ai-gateway --json "hello" | jq .text

# Image with a specific output path
ai-gateway image -m bfl/flux-2-pro -o cover.png "a minimalist mountain logo"

# Multiple images
ai-gateway image -n 4 "abstract wallpaper, blue and gold"

# Multimodal LLMs that generate images (Nano Banana, Gemini 3 Pro Image, GPT-5 image)
ai-gateway image -m google/gemini-2.5-flash-image "a hedgehog wearing a tiny hat"
ai-gateway image -m google/gemini-3-pro-image -o cover.png "minimalist mountain logo"

# Browse models
ai-gateway models --type image
ai-gateway models --search claude
ai-gateway models --json | jq '.[] | select(.type=="language") | .id'

# Video (multi-minute job, shows a spinner)
ai-gateway video "a wave crashing on rocks at sunset" --duration 5
ai-gateway video -m google/veo-3.1-fast-generate-001 --aspect 9:16 --resolution 1080p \
  -o vertical.mp4 "a hummingbird at a flower, slow motion"
ai-gateway video --json --duration 5 "a tiny ripple in water"

Video generation requires a minimum $10 balance on your AI Gateway account.

Claude Code skill

There's a companion Claude Code skill that lets any agent in your terminal use this CLI to generate text or images. Install it with:

npx skills@latest add Vesely/skills/ai-gateway

Source: https://github.com/Vesely/skills/tree/main/ai-gateway.

Key resolution order

  1. --key <value> flag
  2. AI_GATEWAY_API_KEY env var
  3. ~/.config/@vesely/ai-gateway-cli/config.json
  4. Interactive prompt (TTY only)