Free GLM-4.7 via iflow-cli: Install & Integrate with VS Code/DevEco Studio
Learn to use the free GLM-4.7 model through Alibaba's iflow-cli terminal AI assistant with step-by-step installation, VS Code and DevEco Studio plugin integration, and a complete command reference for model switching, session management, and development workflows.
This tutorial demonstrates how to access the GLM-4.7 large language model for free using iflow-cli , a terminal-based AI assistant developed by Alibaba's XFlow team. The tool bundles several domestic models including DeepSeek, Qwen, GLM (with GLM-4.7 support), and K2, and can be integrated into mainstream editors such as VS Code and DevEco Studio (IntelliJ-based).
Step 1: Installation (2 minutes)
System Requirements
Node.js 22+
4 GB+ RAM
Internet connection
Quick Install
macOS / Linux
# One-line install script (installs all dependencies)
bash -c "$(curl -fsSL https://gitee.com/iflow-ai/iflow-cli/raw/main/install.sh)"
# If Node.js 22+ already present
npm i -g @iflow-ai/iflow-cli@latestWindows
1. Download Node.js installer from https://nodejs.org/zh-cn/download
2. Run the installer
3. Restart terminal (CMD or PowerShell)
4. Run `npm install -g @iflow-ai/iflow-cli@latest`
5. Run `iflow` to startRecommendation: Use Windows Terminal for better compatibility. Verify install: Run iflow --version to confirm success.
Step 2: First-time Setup (1 minute)
Launch iflow
iflowOn first launch, a browser window opens for login. After successful login, the CLI shows the model selection interface where GLM-4.7 is available. Press Tab to enable "thinking mode" for more intelligent responses.
Step 3: VS Code Integration
In VS Code, search for the iflow-cli extension and install it.
Open any file; an iflow icon appears in the status bar.
Click the icon to open a terminal in the current workspace directory.
Interact with the AI directly in the terminal or select code snippets for context-aware assistance.
Step 4: DevEco Studio Integration (for HarmonyOS development)
Download the offline plugin from https://platform.iflow.cn/cli/features/ide.
In DevEco Studio, install the plugin from the local file.
Restart the IDE; an iflow icon appears in the top menu bar.
Practical Command Reference
iflow-cli provides a rich set of slash commands grouped by function.
System Configuration Commands
/about– Show system info (CLI version, OS, model version). /auth – Configure or change authentication provider. /theme – Customize CLI appearance theme. /model – Switch the active AI model. /editor – Configure preferred external editor. /privacy – Display privacy notice and data handling info. /language – Switch UI language (zh-CN / en-US). /output-style – Set AI output style and format. /output-style:new – Create a new output style from description. /update – Check and update CLI to latest version.
Session Control Commands
/chat– Manage conversations: save, restore, delete checkpoints. /clear – Clear screen and reset conversation history. /compress – Use AI to compress conversation history into a summary. /memory – Interact with CLI's memory system. /restore – Restore to a previous checkpoint state. /resume – Resume a previous conversation session. /quit – Exit CLI and show session statistics. /cleanup-history – Open dialog to clean conversation history. /cleanup-checkpoint – Open dialog to clean conversation checkpoints.
Tool Integration Commands
/ide– Discover and connect to available IDE servers. /mcp – Manage MCP servers, tools, and authentication. /tools – List all built-in CLI tools. /extensions – Show active extensions and versions.
Development Assistance Commands
/init– Analyze project and create tailored configuration file. /setup-github – Configure GitHub Actions workflows. /directory – Manage workspace directories for project context. /export – Export conversation history in various formats. /copy – Copy last AI response to clipboard. /demo – Launch interactive demo and tutorial mode. /qa – Knowledge-base Q&A assistant (aliases: /wenwen, /question, /guide).
Monitoring & Debugging Commands
/stats– Monitor session usage and performance statistics. /log – Show current session log storage location. /bug – Submit bug report with system information. /help – Open comprehensive help dialog. /docs – Open full documentation in browser.
Special Function Commands
/vim– Toggle Vim-style key bindings. /corgi – Toggle Corgi theme UI mode (easter egg). /commands – Manage and install custom commands. /agents – Manage personal, project, and built-in agents. /terminal-setup – Configure terminal key bindings for multi-line input.
Common Usage Scenarios
System Configuration
/about # View system info
/auth # Configure authentication
/model # Switch AI model
/theme # Change themeSession Management
/chat list # List saved conversations
/chat save project-review # Save conversation checkpoint
/chat resume project-review # Restore specific conversation
/chat delete project-review # Delete specific conversation
/memory show # Show current memory content
/memory add "Project uses React" # Add memory info
/memory refresh # Refresh memory content
/memory list # List memory files
/compress # Compress conversation history
/clear # Clear session
/resume # Resume previous sessionDevelopment Assistance
/init # Initialize project config
/ide # Connect IDE
/mcp list # List all MCP servers
/mcp auth <server> # Configure MCP server auth
/mcp online # Browse online MCP servers
/mcp refresh # Refresh MCP server connections
/directory add <path> # Add workspace directory
/directory show # Show current workspace directories
/export clipboard # Export conversation to clipboard
/export file # Export conversation to fileDebugging Support
/stats # View session statistics
/stats model # View model usage stats
/stats tools # View tool usage stats
/log # View log location
/bug "Describe issue" # Submit bug report
/help # Get helpSystem & UI Configuration
/language zh-CN # Switch to Chinese UI
/language en-US # Switch to English UI
/output-style professional # Use professional output style
/output-style:new "Concise style" # Create new output style
/update # Check and update CLI versionConversation & History Management
/cleanup-history # Clean conversation history
/cleanup-checkpoint # Clean conversation checkpoints
/demo # Start demo mode
/qa "How to use MCP?" # Knowledge-base Q&A
/agents list # List all available agents
/agents refresh # Refresh agent list
/agents online # Browse online agent marketplace
/agents install # Install agent
/commands list # List local custom commands
/commands online # Browse online command marketplace
/commands get <id> # Get command by ID
/terminal-setup # Configure terminal for multi-line inputSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
51CTO HarmonyOS Developer Community
The HarmonyOS Developer Community is a learning-oriented community for developers to learn, communicate, ask questions, and share.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
