AgentSkillsCN

zai-cli

Z.AI CLI提供: - 视觉:图像/视频分析、OCR、UI转代码、错误诊断(GLM-4.6V) - 搜索:支持域名与时效性筛选的实时网络搜索 - 阅读器:网页转Markdown提取 - 仓库:通过ZRead进行GitHub代码搜索与阅读 - 工具:MCP工具发现与原始调用 - 代码:TypeScript工具链式调用 适用于视觉内容分析、网络搜索、页面阅读,或GitHub探索。

SKILL.md
--- frontmatter
name: zai-cli
description: |
  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 chaining
  Use for visual content analysis, web search, page reading, or GitHub exploration.

ZAI CLI

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

Credentials

bash
echo $Z_AI_API_KEY

Commands

CommandPurposeHelp
visionAnalyze images, screenshots, videos--help for 8 subcommands
searchReal-time web search--help for filtering options
readFetch web pages as markdown--help for format options
repoGitHub code search and reading--help for tree/search/read
toolsList available MCP tools
toolShow tool schema
callRaw MCP tool invocation
codeTypeScript tool chaining
doctorCheck setup and connectivity

Quick Start

bash
# 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

# Explore a GitHub repo
npx zai-cli repo search facebook/react "server components"

# Check setup
npx zai-cli doctor

Output

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