zai-cli

numman-ali's avatarfrom numman-ali

Z.AI CLI providing:- Vision: image/video analysis, OCR, UI-to-code, error diagnosis (GLM-4.6V)- Search: real-time web search with domain/recency filtering- Reader: web page to markdown extraction- Repo: GitHub code search and reading via ZRead- Tools: MCP tool discovery and raw calls- Code: TypeScript tool chainingUse for visual content analysis, web search, page reading, or GitHub exploration. Requires Z_AI_API_KEY.

⭐8stars🔀0forks📁View on GitHub🕐Updated Dec 29, 2025

When & Why to Use This Skill

ZAI CLI is a comprehensive AI-powered command-line interface that integrates multimodal vision analysis, real-time web search, and GitHub repository exploration into a single developer workflow. By leveraging GLM-4.6V and MCP tool discovery, it enables developers to perform complex tasks like UI-to-code conversion, visual error diagnosis, and automated web-to-markdown extraction directly from the terminal, significantly enhancing productivity and context-gathering efficiency.

Use Cases

  • Visual Debugging & UI-to-Code: Transform UI screenshots into functional code snippets or use vision-based analysis to diagnose front-end errors and layout issues.
  • Real-time Web Research & Extraction: Perform filtered web searches and instantly convert complex web pages into clean markdown for documentation or LLM context feeding.
  • GitHub Repository Intelligence: Search and read code across GitHub repositories to understand library structures, find specific implementations, or explore new codebases without leaving the CLI.
  • Agentic Tool Orchestration: Utilize TypeScript tool chaining and MCP (Model Context Protocol) discovery to build and execute complex automated workflows and raw tool calls.
namezai-cli
description|
- Visionimage/video analysis, OCR, UI-to-code, error diagnosis (GLM-4.6V)
- Searchreal-time web search with domain/recency filtering
- Readerweb page to markdown extraction
- RepoGitHub code search and reading via ZRead
- ToolsMCP tool discovery and raw calls
- CodeTypeScript tool chaining

ZAI CLI

Access Z.AI capabilities via npx zai-cli. The CLI is self-documenting - use --help at any level.

Setup

export Z_AI_API_KEY="your-api-key"

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

Commands

Command Purpose Help
vision Analyze images, screenshots, videos --help for 8 subcommands
search Real-time web search --help for filtering options
read Fetch web pages as markdown --help for format options
repo GitHub code search and reading --help for tree/search/read
tools List available MCP tools
tool Show tool schema
call Raw MCP tool invocation
code TypeScript tool chaining
doctor Check setup and connectivity

Quick Start

# Analyze an image
npx zai-cli vision analyze ./screenshot.png "What errors do you see?"

# Search the web
npx zai-cli search "React 19 new features" --count 5

# Read a web page
npx zai-cli read https://docs.example.com/api
npx zai-cli read https://docs.example.com/api --with-images-summary --no-gfm

# Explore a GitHub repo
npx zai-cli repo search facebook/react "server components"
npx zai-cli repo search openai/codex "config" --language en
npx zai-cli repo tree openai/codex --path codex-rs --depth 2

# Check setup
npx zai-cli doctor

Output

Default: data-only (raw output for token efficiency). Use --output-format json for { success, data, timestamp } wrapping.

Advanced

For raw MCP tool calls (tools, tool, call), Code Mode, and performance tuning (cache/retries), see references/advanced.md.