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

@z_ai/zai-cli

v0.0.3

Published

Z.ai CLI - Terminal-native toolkit for AI agents: chat, media, parse, search, and more

Readme

Z.ai CLI

zai-cli is the official Z.ai terminal-native toolkit for AI agents. It provides atomic, script-friendly CLI commands for chat, media generation, parsing, search, and more. Designed for AI agents, automation pipelines, and developer terminals.

Install

Requires Node.js >=18 and npm. Supports macOS, Linux, and Windows.

npm install -g @z_ai/zai-cli
zai-cli --version

Authentication

zai-cli auth set "your-key" --region china

Get an API key:

| Region | API key page | | --- | --- | | global | https://z.ai/manage-apikey/apikey-list | | china | https://bigmodel.cn/apikey/platform |

Commands

zai-cli chat "What is quantum computing?"
echo "Summarize this text" | zai-cli chat
zai-cli image-gen "a cat floating in space"
zai-cli video-gen "timelapse of a sunrise"
zai-cli task-query <task_id> --wait
zai-cli audio-transcribe ./meeting.mp3
zai-cli web-search "latest AI research"
zai-cli web-read "https://example.com/article"
zai-cli doc-parse ./contract.pdf

All commands output JSON by default and support:

--output json|text|table
--quiet
--verbose
--api-key <key>
--timeout <ms>

Most model-backed commands also support -m, --model <model>.

Agent Skill

The repository includes a concise, single-file AI-agent usage skill at skills/zai-cli. It documents command selection, non-interactive authentication, structured output handling, and async video polling. Use zai-cli <command> --help for the complete runtime flag reference.

Install it with:

npx skills add zai-org/zai-cli

Examples

Chat:

zai-cli chat "Explain quantum computing in one paragraph"
zai-cli chat "What is in this image?" --file ./photo.jpg -m glm-5v-turbo
zai-cli chat "hello" --stream

Image generation:

zai-cli image-gen "cyberpunk cityscape at night" --size 1280x1280 -n 2

Video generation:

zai-cli video-gen "ocean waves crashing" --wait
zai-cli video-gen "make the scene move" --image ./scene.jpg --quality quality

Web tools:

zai-cli web-search "AI news this week" --count 5
zai-cli web-read "https://docs.z.ai/api-reference/"

Document parsing:

zai-cli doc-parse ./contract.pdf --output text
zai-cli doc-parse --url "https://example.com/doc.pdf"

Configuration

zai-cli config list
zai-cli config get default_chat_model
zai-cli config set default_chat_model glm-5.1
zai-cli auth set "your-key" --region china
zai-cli config set base_url https://proxy.example.com/api/paas/v4

region selects the standard API endpoint automatically. Use an HTTPS base_url only as an explicit custom endpoint override. Setting region clears a persisted base_url override.

Supported environment variables:

| Variable | Description | | --- | --- | | ZAI_API_KEY | API key | | ZAI_REGION | china or global; defaults to china | | ZAI_BASE_URL | Override HTTPS API base URL, for example when using a proxy | | ZAI_DEFAULT_MODEL | Default model override | | ZAI_OUTPUT_FORMAT | json, text, or table | | ZAI_TIMEOUT | Request timeout in ms | | ZAI_LOG_DIR | Override API call log directory |

Development

Runtime installation supports Node.js >=18. The Vitest 4 development toolchain requires Node.js ^20, ^22, or >=24.

pnpm install
pnpm run build
pnpm test
pnpm run lint

Smoke Testing

After building, run low-cost real API checks with the configured key:

export ZAI_API_KEY="your-key"
pnpm run build
pnpm run smoke

License

MIT