Skip to content
Back to search

zai-cli

MCP-native command line interface for Z.AI capabilities: vision analysis, web search, web reader, and GitHub repo exploration.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/numman-ali--zai-cli/badge.svg)](/listings/numman-ali--zai-cli)

HTML

<a href="/listings/numman-ali--zai-cli"><img src="/api/listings/numman-ali--zai-cli/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 18 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "zai-skills",
  3. "owner": "Numman Ali <numman.ali@gmail.com>",
  4. "metadata": {
  5. "version": "1.0.0",
  6. "description": "Z.AI capabilities for AI agents - vision, search, reader, and GitHub repo exploration"
  7. },
  8. "plugins": [
  9. {
  10. "name": "zai-cli",
  11. "description": "Z.AI vision, search, reader, and repo tools via zai-cli",
  12. "skills": [
  13. "./skills/zai-cli"
  14. ],
  15. "strict": false
  16. }
  17. ]
  18. }
README.md · README · 160 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center">
  2. <img src="assets/zai-logo.svg" alt="Z.AI Logo" width="120" height="120">
  3. </p>
  4. <h1 align="center">ZAI CLI</h1>
  5. <p align="center">
  6. MCP-native command line interface for Z.AI capabilities: vision analysis, web search, web reader, and GitHub repo exploration.
  7. </p>
  8. <p align="center">
  9. <a href="https://www.npmjs.com/package/zai-cli"><img src="https://img.shields.io/npm/v/zai-cli.svg" alt="npm version"></a>
  10. <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
  11. </p>
  12. > **Found this useful?** Follow [@nummanali](https://x.com/nummanali) for more AI tooling!
  13. ---
  14. ## Features
  15. - **Vision** - Analyze images, screenshots, diagrams, charts, videos using GLM-4.6V
  16. - **Search** - Real-time web search with domain and recency filtering
  17. - **Reader** - Fetch and parse web pages to markdown
  18. - **Repo** - Search and read GitHub repository code via ZRead
  19. - **Tools** - MCP tool discovery, schemas, and raw calls
  20. - **Code Mode** - TypeScript tool chaining for agent automation
  21. ## Quick Start
  22. ```bash
  23. export Z_AI_API_KEY="your-api-key"
  24. npx zai-cli --help
  25. npx zai-cli vision analyze ./screenshot.png "What errors do you see?"
  26. npx zai-cli search "React 19 new features" --count 5
  27. ```
  28. Get your API key at: https://z.ai/manage-apikey/apikey-list
  29. ## Installation
  30. ### As an Agent Skill
  31. **OpenSkills** (universal - works with any AI coding agent):
  32. ```bash
  33. npx openskills install numman-ali/zai-cli
  34. ```
  35. **Claude Code** (native skill marketplace):
  36. ```bash
  37. claude skill install numman-ali/zai-cli --skill zai-cli
  38. ```
  39. ### As a CLI Tool
  40. ```bash
  41. npm i -g zai-cli
  42. zai-cli --help
  43. ```
  44. Or use directly with npx:
  45. ```bash
  46. npx zai-cli --help
  47. ```
  48. ## Usage
  49. The CLI is self-documenting. Use `--help` at any level:
  50. ```bash
  51. zai-cli --help # All commands
  52. zai-cli vision --help # Vision commands
  53. zai-cli search --help # Search options
  54. zai-cli repo --help # GitHub repo commands
  55. ```
  56. ### Examples
  57. ```bash
  58. # Vision - analyze images
  59. zai-cli vision analyze ./image.png "Describe this"
  60. zai-cli vision ui-to-code ./design.png --output code
  61. zai-cli vision extract-text ./screenshot.png --language python
  62. zai-cli vision diagnose-error ./error.png
  63. # Search - web search
  64. zai-cli search "TypeScript best practices" --count 10
  65. zai-cli search "security news" --recency oneDay
  66. # Reader - fetch web content
  67. zai-cli read https://docs.example.com/api
  68. zai-cli read https://blog.example.com --format text
  69. # Repo - GitHub exploration
  70. zai-cli repo tree facebook/react
  71. zai-cli repo search vercel/next.js "app router"
  72. zai-cli repo read anthropics/anthropic-sdk-python README.md
  73. zai-cli repo search openai/codex "config" --language en
  74. zai-cli repo tree openai/codex --path codex-rs --depth 2
  75. # Doctor - check setup
  76. zai-cli doctor
  77. zai-cli doctor --no-vision
  78. ```
  79. ## Output Format
  80. Default output is **data-only** for token efficiency. Use `--output-format json` for structured responses:
  81. ```json
  82. {
  83. "success": true,
  84. "data": "...",
  85. "timestamp": 1234567890
  86. }
  87. ```
  88. ## Notes
  89. - `repo search` defaults to English results. Use `--language zh` for Chinese.
  90. - `repo tree` supports `--path` (directory scope) and `--depth` (expand subtrees).
  91. - `tools`, `tool`, `call`, `doctor` accept `--no-vision` to speed startup when vision tools are not needed.
  92. - `read` supports `--with-images-summary`, `--no-gfm`, and `--keep-img-data-url` for richer parsing control.
  93. - 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).
  94. - 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`.
  95. ## Repository Layout
  96. ```
  97. ├── packages/zai-cli/ # npm package source
  98. ├── skills/zai-cli/ # Agent skill (SKILL.md)
  99. └── .claude-plugin/ # Claude Code marketplace config
  100. ```
  101. ## Development
  102. ```bash
  103. cd packages/zai-cli
  104. npm install
  105. npm run build
  106. npm test
  107. node scripts/bench-tools.mjs
  108. ```
  109. ## Contributing
  110. See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
  111. ## License
  112. MIT - see [LICENSE](LICENSE).
  113. ## Links
  114. - [npm package](https://www.npmjs.com/package/zai-cli)
  115. - [OpenSkills](https://github.com/numman-ali/openskills)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.