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

zai-cli

v1.1.0

Published

CLI for Z.AI capabilities: vision analysis, web search, web reader, and GitHub repo exploration

Downloads

378

Readme

Found this useful? Follow @nummanali for more AI tooling!


Features

  • Vision - Analyze images, screenshots, diagrams, charts, videos using GLM-4.6V
  • Search - Real-time web search with domain and recency filtering
  • Reader - Fetch and parse web pages to markdown
  • Repo - Search and read GitHub repository code via ZRead
  • Tools - MCP tool discovery, schemas, and raw calls
  • Code Mode - TypeScript tool chaining for agent automation

Quick Start

export Z_AI_API_KEY="your-api-key"

npx zai-cli --help
npx zai-cli vision analyze ./screenshot.png "What errors do you see?"
npx zai-cli search "React 19 new features" --count 5

Get your API key at: https://z.ai/manage-apikey/apikey-list

Installation

As an Agent Skill

OpenSkills (universal - works with any AI coding agent):

npx openskills install numman-ali/zai-cli

Claude Code (native skill marketplace):

claude skill install numman-ali/zai-cli --skill zai-cli

As a CLI Tool

npm i -g zai-cli
zai-cli --help

Or use directly with npx:

npx zai-cli --help

Usage

The CLI is self-documenting. Use --help at any level:

zai-cli --help              # All commands
zai-cli vision --help       # Vision commands
zai-cli search --help       # Search options
zai-cli repo --help         # GitHub repo commands

Examples

# Vision - analyze images
zai-cli vision analyze ./image.png "Describe this"
zai-cli vision ui-to-code ./design.png --output code
zai-cli vision extract-text ./screenshot.png --language python
zai-cli vision diagnose-error ./error.png

# Search - web search
zai-cli search "TypeScript best practices" --count 10
zai-cli search "security news" --recency oneDay

# Reader - fetch web content
zai-cli read https://docs.example.com/api
zai-cli read https://blog.example.com --format text

# Repo - GitHub exploration
zai-cli repo tree facebook/react
zai-cli repo search vercel/next.js "app router"
zai-cli repo read anthropics/anthropic-sdk-python README.md
zai-cli repo search openai/codex "config" --language en
zai-cli repo tree openai/codex --path codex-rs --depth 2

# Doctor - check setup
zai-cli doctor
zai-cli doctor --no-vision

Output Format

Default output is data-only for token efficiency. Use --output-format json for structured responses:

{
  "success": true,
  "data": "...",
  "timestamp": 1234567890
}

Notes

  • repo search defaults to English results. Use --language zh for Chinese.
  • repo tree supports --path (directory scope) and --depth (expand subtrees).
  • tools, tool, call, doctor accept --no-vision to speed startup when vision tools are not needed.
  • read supports --with-images-summary, --no-gfm, and --keep-img-data-url for richer parsing control.
  • Vision tool calls automatically retry transient 5xx/network errors (default: 2 retries). Configure with ZAI_MCP_VISION_RETRY_COUNT (or ZAI_MCP_RETRY_COUNT for all tools).
  • Tool discovery can be cached to speed tools/tool/doctor (default: on, 24h TTL). Configure with ZAI_MCP_TOOL_CACHE, ZAI_MCP_TOOL_CACHE_TTL_MS, ZAI_MCP_CACHE_DIR.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Performance

Benchmark tool discovery (cache on/off):

node scripts/bench-tools.mjs

License

MIT - see LICENSE.

Links