### Install Frontend Dependencies and Start Service Source: https://docs.z.ai/devpack/tool/eigent Install npm dependencies and start the frontend development server for Eigent. ```bash npm install npm run dev ``` -------------------------------- ### Start OpenClaw Configuration Source: https://docs.z.ai/devpack/tool/openclaw Run this command to start the OpenClaw configuration process if it does not begin automatically after installation. It can also be used to reconfigure existing installations. ```bash openclaw onboard --install-daemon ``` -------------------------------- ### Install OpenCode via Script Source: https://docs.z.ai/devpack/tool/opencode Use this command to install OpenCode using the provided installation script. Ensure you have curl installed. ```bash curl -fsSL https://opencode.ai/install | bash ``` -------------------------------- ### Install Coding Tool Helper Globally Source: https://docs.z.ai/devpack/extension/coding-tool-helper Install the Coding Tool Helper globally for frequent use. After installation, you can launch it using the `coding-helper` or `chelper` commands. ```shell npm install -g @z_ai/coding-helper ## Then run coding-helper or chelper coding-helper ``` -------------------------------- ### Install OpenCode GitHub App Source: https://docs.z.ai/devpack/tool/opencode Run this command to install the OpenCode GitHub app, set up the workflow, and configure secrets. ```bash opencode github install ``` -------------------------------- ### Install Claude Code via Cursor Source: https://docs.z.ai/devpack/tool/claude If you use Cursor, you can initiate the Claude Code installation through its interface by entering a specific command. Cursor will guide you through the process. ```bash https://docs.anthropic.com/en/docs/claude-code/overview Help me install Claude Code ``` -------------------------------- ### Install MCP Server with One-Click Command Source: https://docs.z.ai/devpack/mcp/vision-mcp-server Use this command to quickly install the MCP server. Ensure you replace 'your_api_key' with your actual API key. ```bash claude mcp add -s user zai-mcp-server --env Z_AI_API_KEY=your_api_key Z_AI_MODE=ZAI -- npx -y "@z_ai/mcp-server" ``` -------------------------------- ### Install a Skill Pack with ClawHub Source: https://docs.z.ai/devpack/tool/openclaw Download and install a skill pack from ClawHub using the CLI. Replace 'my-skill-pack' with the actual name of the skill pack you wish to install. ```bash clawhub install my-skill-pack ``` -------------------------------- ### Install OpenCode via npm Source: https://docs.z.ai/devpack/tool/opencode Alternatively, install OpenCode globally using npm. This requires Node.js and npm to be installed. ```bash npm install -g opencode-ai ``` -------------------------------- ### Install Crush with Nix Source: https://docs.z.ai/devpack/tool/crush Use this command to install Crush using Nix. ```bash nix run github:numtide/nix-ai-tools#crush ``` -------------------------------- ### Start Eigent Backend Services Source: https://docs.z.ai/devpack/tool/eigent Start the backend services for Eigent using Docker Compose. This requires a .env file to be configured. ```bash cd server cp .env.example .env docker compose up -d ``` -------------------------------- ### Install Crush with NPM Source: https://docs.z.ai/devpack/tool/crush Use this command to install Crush on any platform using NPM. ```bash npm install -g @charmland/crush ``` -------------------------------- ### Install OpenClaw via Installer Script (Windows) Source: https://docs.z.ai/devpack/tool/openclaw Use this PowerShell command to install OpenClaw using the recommended installer script on Windows. Ensure Node.js 22 or newer is installed. ```powershell iwr -useb https://openclaw.ai/install.ps1 | iex ``` -------------------------------- ### Install Claude Code Source: https://docs.z.ai/devpack/quick-start Install Claude Code globally using npm. Ensure Node.js 18 or later is installed. After installation, run 'claude' to start the interactive interface. ```bash npm install -g @anthropic-ai/claude-code cd your-project claude ``` -------------------------------- ### Example Project Rules Source: https://docs.z.ai/devpack/resources/best-practice These are common project rules that should be captured in project-level configuration files rather than repeated in prompts. ```markdown - Project directory structure - Build commands - Test workflow - Coding standards - PR submission process ``` -------------------------------- ### Install OpenClaw via Installer Script (macOS/Linux) Source: https://docs.z.ai/devpack/tool/openclaw Use this command to install OpenClaw using the recommended installer script on macOS or Linux. Ensure Node.js 22 or newer is installed. ```bash curl -fsSL https://openclaw.ai/install.sh | bash ``` -------------------------------- ### Launch OpenCode CLI Source: https://docs.z.ai/devpack/tool/opencode Run this command to start the OpenCode CLI after successful authentication. ```bash $ opencode ``` -------------------------------- ### Verify OpenClaw Installation Source: https://docs.z.ai/devpack/tool/openclaw After installation and configuration, use these commands to check the status and health of your OpenClaw setup. 'doctor' checks for configuration issues, 'status' shows gateway status, and 'dashboard' opens the browser UI. ```bash openclaw doctor ``` ```bash openclaw status ``` ```bash openclaw dashboard ``` -------------------------------- ### Install Factory Droid on Windows Source: https://docs.z.ai/devpack/tool/droid Use this command to download and install the Factory Droid CLI on Windows systems. ```powershell irm https://app.factory.ai/cli/windows | iex ``` -------------------------------- ### Install Crush with Homebrew Source: https://docs.z.ai/devpack/tool/crush Use this command to install Crush on macOS using Homebrew. ```bash brew install charmbracelet/tap/crush ``` -------------------------------- ### Project Memory Structure Example Source: https://docs.z.ai/devpack/resources/memory-mechanism Shows a typical directory structure for storing long-lived project information, including main instructions and specific rule files. ```tree your-project/ ├── .claude/ │ ├── CLAUDE.md # Main project instructions │ └── rules/ │ ├── code-style.md # Code style guide │ ├── testing.md # Testing conventions │ └── security.md # Security requirements ``` -------------------------------- ### Launch Crush Application Source: https://docs.z.ai/devpack/tool/crush Run this command to start the Crush application and access its interface. ```bash crush ``` -------------------------------- ### Install Claude Code via Script Source: https://docs.z.ai/devpack/quick-start Run this command to download and execute the installation script for Claude Code. This method is recommended for first-time users on macOS and Linux environments. ```bash curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.sh ``` -------------------------------- ### Procedural Memory Workflow Example Source: https://docs.z.ai/devpack/resources/memory-mechanism Illustrates a procedural memory in the form of a debug workflow, outlining step-by-step instructions for completing a task. ```text Debug_Workflow.md 1. read error log 2. locate file 3. write patch 4. run tests ``` -------------------------------- ### Install Crush with AUR Source: https://docs.z.ai/devpack/tool/crush Use this command to install Crush on Arch Linux using yay. ```bash yay -S crush-bin ``` -------------------------------- ### Install MCP Server with Claude Code Source: https://docs.z.ai/devpack/mcp/reader-mcp-server Use this one-click command to install the MCP server for Claude Code. Replace 'your_api_key' with your actual API key. ```bash claude mcp add -s user -t http web-reader https://api.z.ai/api/mcp/web_reader/mcp --header "Authorization: Bearer your_api_key" ``` -------------------------------- ### Automated Task Management Examples Source: https://docs.z.ai/devpack/quick-start Shows examples of one-click fixes for common development tasks. This includes auto-fixing code style issues and generating documentation. ```shell # Auto-fix code style issues Fix all ESLint errors ``` ```shell # Auto-generate documentation Generate detailed documentation for this API ``` -------------------------------- ### Concrete Rule Examples for Agent Memory Source: https://docs.z.ai/devpack/resources/memory-mechanism Prefer specific, verifiable rules over abstract principles for stable agent behavior. These examples demonstrate actionable instructions. ```markdown * Use **2-space indentation** in all new TypeScript files * **Run `pnpm test`** after modifying business logic * Place **all API handlers under `src/api/handlers/`** * Keep React page components **under 300 lines**; split larger ones into hooks or child components ``` -------------------------------- ### Install Factory Droid on macOS/Linux Source: https://docs.z.ai/devpack/tool/droid Use this command to download and install the Factory Droid CLI on macOS and Linux systems. ```bash curl -fsSL https://app.factory.ai/cli | sh ``` -------------------------------- ### Install OpenClaw Globally via npm Source: https://docs.z.ai/devpack/tool/openclaw Install OpenClaw globally using npm. This method requires Node.js 22 or newer. ```bash npm install -g openclaw@latest ``` -------------------------------- ### Install Claude Code via npm Source: https://docs.z.ai/devpack/tool/claude Use this command to install Claude Code globally. Ensure Node.js 18 or newer is installed. Navigate to your project directory afterwards. ```bash npm install -g @anthropic-ai/claude-code cd your-awesome-project claude ``` -------------------------------- ### Install and Run Vision MCP Server on Windows Cmd Source: https://docs.z.ai/devpack/mcp/vision-mcp-server Use this command to install and run the Vision MCP server locally on Windows using the Command Prompt. Ensure your Z_AI_API_KEY is set as an environment variable. ```cmd set Z_AI_API_KEY=your_api_key && npx -y @z_ai/mcp-server ``` -------------------------------- ### Install and Run Vision MCP Server on Linux/macOS Source: https://docs.z.ai/devpack/mcp/vision-mcp-server Use this command to install and run the Vision MCP server locally on Linux or macOS. Ensure your Z_AI_API_KEY is set as an environment variable. ```bash Z_AI_API_KEY=your_api_key npx -y @z_ai/mcp-server ``` -------------------------------- ### Project Conventions Example Source: https://docs.z.ai/devpack/tool/droid This markdown snippet demonstrates how to document project build, test, and coding conventions. Factory Droid automatically adheres to these documented practices. ```markdown # Build & Test - Test: `npm test` - Build: `npm run build` # Conventions - TypeScript strict mode - 100-char line limit - Tests required for features ``` -------------------------------- ### Code Repository Q&A Example Source: https://docs.z.ai/devpack/quick-start Illustrates how to ask natural language questions about a codebase. The AI analyzes the repository to provide detailed explanations and identify relevant files. ```text Q: How is user authentication implemented in this project? A: GLM-5.2 analyzes your codebase and provides detailed explanations of the authentication process and related files. ``` -------------------------------- ### Smart Code Completion Example Source: https://docs.z.ai/devpack/quick-start Demonstrates how AI can auto-complete function implementations based on the function signature. This reduces manual coding and improves efficiency. ```javascript // Type function name, GLM-5.2 auto-completes implementation function calculateTotal(items) { // GLM-5.2 automatically generates complete function implementation } ``` -------------------------------- ### Example Agent Memory Directory Structure Source: https://docs.z.ai/devpack/resources/memory-mechanism This structure organizes project-wide context, topic-specific rules, and local configurations for agent memory. ```directory structure agent-memory/ ├── project.md # Project overview ├── rules/ │ ├── code-style.md # Code style │ ├── testing.md # Testing conventions │ ├── api-design.md # API design guidelines │ ├── security.md # Security requirements │ └── frontend/ │ └── react.md # Frontend-specific rules └── local/ └── developer.local.md ``` -------------------------------- ### Install ClawHub CLI Source: https://docs.z.ai/devpack/tool/openclaw Install the ClawHub command-line interface globally using npm. This tool is used for managing skills for your OpenClaw agent. ```bash npm i -g clawhub ``` -------------------------------- ### Install OpenClaw Globally via pnpm Source: https://docs.z.ai/devpack/tool/openclaw Install OpenClaw globally using pnpm, which is recommended. This method requires Node.js 22 or newer. You may also need to approve builds for related packages. ```bash pnpm add -g openclaw@latest ``` ```bash pnpm approve-builds -g # approve openclaw, node-llama-cpp, sharp, etc. ``` -------------------------------- ### Episodic Memory Example Source: https://docs.z.ai/devpack/resources/memory-mechanism Provides a simple example of episodic memory, recording a past experience like a CI failure and its solution. ```text Episode: CI failure caused by missing dependency Solution: upgrade pip package ``` -------------------------------- ### Claude Code: One-click Install Source: https://docs.z.ai/devpack/mcp/zread-mcp-server Use this command for a one-click installation of the Zread MCP server with Claude Code. Replace 'your_api_key' with your actual API key. ```bash claude mcp add -s user -t http zread https://api.z.ai/api/mcp/zread/mcp --header "Authorization: Bearer your_api_key" ``` -------------------------------- ### Session Memory Example Source: https://docs.z.ai/devpack/resources/memory-mechanism Illustrates the contextual information within a current task, such as conversation history and execution steps. ```text User: Fix this Python bug Agent: Analyze the error Agent: Modify the code Agent: Run tests ``` -------------------------------- ### Update All Installed Skills Source: https://docs.z.ai/devpack/tool/openclaw Update all skills that have been previously installed via ClawHub. This command ensures you are using the latest versions of your skills. ```bash clawhub update --all ``` -------------------------------- ### Install and Run Vision MCP Server on Windows PowerShell Source: https://docs.z.ai/devpack/mcp/vision-mcp-server Use this command to install and run the Vision MCP server locally on Windows using PowerShell. Ensure your Z_AI_API_KEY is set as an environment variable. ```powershell $env:Z_AI_API_KEY="your_api_key"; npx -y @z_ai/mcp-server ``` -------------------------------- ### Install MCP Server with Claude Code CLI Source: https://docs.z.ai/devpack/mcp/search-mcp-server Use this command to add the web-search-prime MCP server using the Claude Code command-line interface. Replace 'your_api_key' with your actual API key. ```bash claude mcp add -s user -t http web-search-prime https://api.z.ai/api/mcp/web_search_prime/mcp --header "Authorization: Bearer your_api_key" ``` -------------------------------- ### Configure MCP Server in OpenCode Source: https://docs.z.ai/devpack/mcp/reader-mcp-server Configure the MCP server for OpenCode. This example uses the 'remote' type and requires the 'Authorization' header. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "web-reader": { "type": "remote", "url": "https://api.z.ai/api/mcp/web_reader/mcp", "headers": { "Authorization": "Bearer your_api_key" } } } } ``` -------------------------------- ### Check Current Claude Code Version Source: https://docs.z.ai/devpack/tool/claude Run this command to display the currently installed version of Claude Code. This is useful for verifying your installation or for support purposes. ```bash claude --version ``` -------------------------------- ### Uninstall and Reinstall MCP Server Source: https://docs.z.ai/devpack/mcp/vision-mcp-server If you need to change your API key after initial installation, uninstall the old MCP server first, then reinstall with the correct key. ```bash claude mcp list claude mcp remove zai-mcp-server ``` -------------------------------- ### Run Coding Tool Helper Directly Source: https://docs.z.ai/devpack/extension/coding-tool-helper Use this command for occasional use without a global installation. It allows you to run the Coding Tool Helper directly from your terminal. ```shell npx @z_ai/coding-helper ``` -------------------------------- ### Initialize Coding Tool Helper Source: https://docs.z.ai/devpack/extension/coding-tool-helper Launches the interactive wizard for setting up the Coding Tool Helper. ```bash coding-helper init ``` -------------------------------- ### System Check and Help Source: https://docs.z.ai/devpack/extension/coding-tool-helper Commands to check the system configuration and view help or version information. ```bash coding-helper doctor ``` ```bash coding-helper --help ``` ```bash coding-helper --version ``` -------------------------------- ### Launch Factory Droid in a Project Source: https://docs.z.ai/devpack/tool/droid Navigate to your project directory and run this command to launch Factory Droid. You will be prompted to sign in via your browser on first launch. ```bash cd /path/to/your/project droid ``` -------------------------------- ### Install Official Voice Call Plugin Source: https://docs.z.ai/devpack/tool/openclaw Install the official Voice Call plugin for OpenClaw. This command adds voice call capabilities to your agent. ```bash openclaw plugins install @openclaw/voice-call ``` -------------------------------- ### Authenticate OpenCode with Z.AI Coding Plan Source: https://docs.z.ai/devpack/tool/opencode If you are subscribed to the Z.AI Coding Plan, select 'Z.AI Coding Plan' during authentication. ```bash $ opencode auth login ┌ Add credential │ ◆ Select provider │ ● Z.AI Coding Plan │ ... └ ``` -------------------------------- ### Clone Eigent Repository Source: https://docs.z.ai/devpack/tool/eigent Clone the Eigent repository to run it locally from source code. Ensure you have Node.js and Python installed. ```bash git clone https://github.com/eigent-ai/eigent.git cd eigent ``` -------------------------------- ### Restart OpenClaw Gateway Source: https://docs.z.ai/devpack/tool/openclaw Restart the OpenClaw gateway service. This action is often necessary after installing or updating plugins to apply the changes. ```bash openclaw gateway restart ``` -------------------------------- ### MCP Server Configuration for Crush Source: https://docs.z.ai/devpack/mcp/vision-mcp-server Set up the MCP server in Crush settings. Replace 'your_api_key' with your actual API key. ```json { "$schema": "https://charm.land/crush.json", "mcp": { "zai-mcp-server": { "type": "stdio", "command": "npx", "args": [ "-y", "@z_ai/mcp-server" ], "env": { "Z_AI_API_KEY": "your_api_key", "Z_AI_MODE": "ZAI" } } } } ``` -------------------------------- ### Configure Frontend Environment Variables Source: https://docs.z.ai/devpack/tool/eigent Modify the .env.development file in the project root to configure frontend proxy settings for Eigent. ```bash VITE_BASE_URL=/api VITE_USE_LOCAL_PROXY=true VITE_PROXY_URL=http://localhost:3001 ``` -------------------------------- ### Authenticate OpenCode with Z.AI Provider Source: https://docs.z.ai/devpack/tool/opencode Log in to OpenCode and select Z.AI as your provider. You will need your Z.AI API key. ```bash $ opencode auth login ┌ Add credential │ ◆ Select provider │ ● Z.AI │ ... └ ``` -------------------------------- ### Manage Language Settings Source: https://docs.z.ai/devpack/extension/coding-tool-helper Commands to display the current language and switch to a different language. ```bash coding-helper lang show ``` ```bash coding-helper lang set en_US ``` ```bash coding-helper lang --help ``` -------------------------------- ### Configure Environment Variables (Windows Cmd) Source: https://docs.z.ai/devpack/quick-start Use these commands in the Windows Command Prompt to set environment variables for Claude Code. Remember to replace `your_zai_api_key` with your API key. ```cmd setx ANTHROPIC_AUTH_TOKEN your_zai_api_key setx ANTHROPIC_BASE_URL https://api.z.ai/api/anthropic ``` -------------------------------- ### Manage Authentication Key Source: https://docs.z.ai/devpack/extension/coding-tool-helper Commands for configuring, setting, revoking, and reloading the API key. ```bash coding-helper auth ``` ```bash coding-helper auth glm_coding_plan_global ``` ```bash coding-helper auth revoke ``` ```bash coding-helper auth reload claude ``` ```bash coding-helper auth --help ``` -------------------------------- ### Semantic Memory Flow Example Source: https://docs.z.ai/devpack/resources/memory-mechanism Depicts the retrieval-augmented generation (RAG) flow for semantic memory, involving query, embedding, vector search, document retrieval, and LLM reasoning. ```text query ↓ embedding ↓ vector search ↓ retrieve documents ↓ LLM reasoning ``` -------------------------------- ### List Loaded Plugins Source: https://docs.z.ai/devpack/tool/openclaw View a list of all plugins currently loaded and active within your OpenClaw environment. This helps in understanding the agent's extended capabilities. ```bash openclaw plugins list ``` -------------------------------- ### Update Default Model Configuration Source: https://docs.z.ai/devpack/latest-model Add or replace these environment variables in your `settings.json` file to configure the default models for Claude Code. This example sets Haiku, Sonnet, and Opus to specific GLM versions. ```json { "env": { "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.7", "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2[1m]", "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2[1m]" } } ``` -------------------------------- ### Manual MCP Server Configuration for Claude Desktop Source: https://docs.z.ai/devpack/mcp/vision-mcp-server Configure the MCP server manually by editing the '.claude.json' file. Replace 'your_api_key' with your actual API key. ```json { "mcpServers": { "zai-mcp-server": { "type": "stdio", "command": "npx", "args": [ "-y", "@z_ai/mcp-server" ], "env": { "Z_AI_API_KEY": "your_api_key", "Z_AI_MODE": "ZAI" } } } } ``` -------------------------------- ### Reference: agents.defaults.model.primary Section Source: https://docs.z.ai/devpack/latest-model This snippet illustrates the updated `agents.defaults.model.primary` configuration, including fallbacks. ```json "model": { "primary": "zai/glm-5.2", "fallbacks": ["zai/glm-4.7"] } ``` -------------------------------- ### Enter Z.AI API Key Source: https://docs.z.ai/devpack/tool/opencode Provide your Z.AI API key when prompted during the OpenCode authentication process. ```bash $ opencode auth login ┌ Add credential │ ◇ Select provider │ Z.AI Coding Plan │ ◇ Enter your API key │ _ ``` -------------------------------- ### Configure MCP Server in OpenCode Source: https://docs.z.ai/devpack/mcp/search-mcp-server Configure the web-search-prime MCP server in OpenCode settings. Ensure the URL and Authorization header are correctly set according to OpenCode's MCP documentation. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "web-search-prime": { "type": "remote", "url": "https://api.z.ai/api/mcp/web_search_prime/mcp", "headers": { "Authorization": "Bearer your_api_key" } } } } ``` -------------------------------- ### Configure Claude Code Settings (macOS/Linux) Source: https://docs.z.ai/devpack/quick-start Manually edit the `~/.claude/settings.json` file to add or modify environment variables for Claude Code. Replace `your_zai_api_key` with your actual API key. ```json { "env": { "ANTHROPIC_AUTH_TOKEN": "your_zai_api_key", "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic", "API_TIMEOUT_MS": "3000000" } } ```