Why CLI Tools Are Making a Comeback in the AI Agent Era: Insights from Feishu’s Open-Source lark-cli
In the age of AI Agents, we’re witnessing a fascinating revival: command-line tools (CLI) are gaining popularity again. Feishu recently open-sourced its lark-cli, enabling AI Agents to directly operate Feishu for tasks like sending messages, checking calendars, creating documents, and more. Similarly, Google open-sourced gws to let AI Agents handle Google Workspace. This trend raises a question: Why are everyone building CLI tools in the AI Agent era? Based on Feishu’s open-source content, this article breaks down the reasons in plain English, offering practical insights for readers with at least a college education. We’ll explore what CLI is, why it’s resurging, how it compares to alternatives like MCP and skills, and how to design a CLI for AI Agents—all while keeping the content engaging and human-like.
What Is a Command-Line Interface (CLI)?
A command-line interface (CLI) is a way to interact with computers by typing text commands in a terminal window. Imagine opening a black-screen terminal, typing a command, hitting Enter, and letting the computer do the work—this is the essence of CLI.
Key Characteristics of CLI
-
Text-Based Interaction: No buttons, icons, or graphical elements; everything is done through text. -
Historical Context: CLI predates graphical user interfaces (GUI) by over two decades but faded during the Windows era. -
Modern Revival: In the AI Agent era, CLI is making a comeback due to its unique advantages for AI.
Simple Example
For instance, instead of opening the Feishu app to check your calendar, you can simply type in the terminal:
lark-cli calendar +agenda
And your schedule appears instantly. This directness makes CLI efficient, especially for AI Agents.
Why Is CLI复兴 in the AI Agent Era?
AI Agents need to perform tasks like booking meetings, organizing data, or deploying code, which requires access to external tools. While APIs can serve this purpose, CLI offers distinct benefits that make it ideal for AI.
CLI’s Self-Descriptive Nature
-
Easy for AI to Understand: When an AI encounters a new CLI, it can run --helpto see all capabilities, usage, and parameters—this is like having a built-in manual. -
API Limitations: Using APIs requires AI to first obtain documentation, understand endpoints, and handle authentication, which is more complex.
Text-Based Advantage for AI
-
Input and Output Are Text: AI excels at processing text, making CLI a natural fit. -
Contrast with GUI: Operating a graphical interface involves screenshots, button recognition, and mouse simulation—steps that are error-prone. CLI accomplishes tasks in a single command.
AI Agent’s Operational Needs
-
Task Examples: To book a meeting, AI needs calendar access; to organize customer data, it needs to read/write tables; to deploy code, it needs to run commands. -
CLI as a Tool: CLI is the actual tool that executes commands—once installed, it can run tasks like checking calendars or sending messages directly from the terminal.
Comparing MCP, CLI, and Skills
To enable AI Agents to operate external services, three main approaches exist: MCP, CLI, and skills. They are not mutually exclusive but serve different purposes.
Overview Table
| Approach | Role | Advantages | Disadvantages |
|---|---|---|---|
| CLI | Executes commands directly (e.g., check calendar, send messages) | Self-descriptive, text-based, composable | Requires terminal environment |
| MCP | Pre-registers tool lists for AI | Suitable for non-terminal environments (e.g., Cursor, Claude desktop) | Occupies AI’s context window space |
| Skills | Provides instructions for AI on how to use CLI | Increases AI operation success rate | Does not execute tasks; only guides |
Detailed Explanation
-
CLI: AI runs commands in the terminal when needed, without occupying context space. It allows composition via pipes and parameters, e.g.: lark-cli calendar agenda --next-week | grep "Zhang San" | wc -lThis command counts meetings with Zhang San next week.
-
MCP: Tool lists remain in AI’s “working memory” (context window), which is limited—even unused tools take up space. -
Skills: Without skills, AI can still use CLI through trial and error; with skills, AI knows exactly how to operate from the start, improving success rates.
In short: CLI is like a hand, MCP is another hand, and skills are muscle memory. Feishu’s open-source project provides both CLI and skills.
How to Design a CLI for AI Agents?
Not every CLI tool works seamlessly with AI. Feishu’s design offers several best practices to ensure AI-friendly CLI.
1. Prioritize Help Text
-
Help is Critical: When AI encounters an unknown CLI, the first step is running --help. This text serves as a manual, parameter specification, and usage guide. -
Feishu’s Approach: Avoid vague help like “Usage: myctl deploy [flags]”. Instead, detail each parameter’s purpose, when to use it, and defaults. Feishu’s schemacommand lets AI quickly query API method parameters, request/response structures, and permissions. -
Tip: Write help text that AI can parse easily, using clear language and examples.
2. Support Dry-Run Mechanisms
-
What is Dry-Run?: A preview feature where AI simulates an operation and returns results for user confirmation before actual execution. -
Example: When deleting expired data from a Feishu multi-dimensional table, using --dry-runshows: “Will delete 47 records: 23 expired tasks from May 2025, 24 archived projects. No actual changes made.” User confirms before real execution. -
Safety Net: Google’s gws implements this too, with skills files mandating dry-run for all write and delete operations.
3. Design Error Messages for Guidance
-
AI’s Confusion: Humans see “Permission denied” and search docs; AI might get stuck. -
Feishu’s Method: Error messages should include three elements: which parameter failed, specific error, and next command to fix it. For example: lark-cli auth login --scope "calendar:calendar:readonly"This lets AI self-correct and continue tasks.
4. Return Structured Data and Control Output
-
Output Formats: Feishu CLI supports JSON, CSV, table, etc. JSON is more reliable for AI. -
Control Output Volume: AI has limited context windows; avoid returning thousands of lines. Feishu provides pagination ( --page-limit) and filtering parameters so AI gets only needed data.
Steps to Design an AI-Friendly CLI
-
Write detailed help text with parameter explanations and examples. -
Implement dry-run for safety. -
Create error messages that guide next steps. -
Support structured output and manage data volume.
Installation and Usage Examples of Feishu CLI
Feishu CLI is simple to install and use, making it easy for AI Agents to integrate.
Installation Steps
-
Install CLI Tool: Run in terminal: npm install -g @larksuite/cli -
Install Skills File: Run: npx skills add github.com/larksuite/cli -y -g -
AI Auto-Installation: You can even send the project URL to AI, and it will install and learn to use it itself.
Usage Scenarios
-
Scenario 1: Organizing Meeting To-Dos
After a meeting, tell AI: “Extract all to-dos from the meeting, send documents where needed, and create tasks.”
AI will:-
Read meeting notes and break down to-dos. -
Use lark-cli doc createto build documents. -
Use lark-cli task createto create and assign tasks. -
Use lark-cli im sendto notify groups.
You only speak once; AI runs a series of commands. Dry-run lets you preview before execution.
-
-
Scenario 2: Scheduling Cross-Time-Zone Meetings
Tell AI: “Find available times next week for everyone.”
AI checks calendars and time zones, recommends slots, and books the meeting once you choose. -
Scenario 3: Collaborative Document Editing
Let AI draft a document in Feishu; you leave comments, and AI reads and revises them—all within Feishu.
The Return of CLI and Future Outlook
Over the past decades, computer interfaces evolved from CLI to GUI, from text to icons, making them more user-friendly. But in the AI Agent era, the direction reverses: software users are now AI Agents. CLI, designed for the text world, is naturally suited for AI.
Why Did Feishu Open-Source CLI?
-
Mature Enterprise Collaboration: Feishu excels in messaging, documents, calendars, approvals, etc. Opening these via CLI creates an AI-friendly enterprise entry point. -
Infrastructure Value: It’s not just a tool but building infrastructure for the Agent era, exposing permissions, auditing, and organizational capabilities to the ecosystem.
Challenges and Exploration
-
Permission Issues: High AI permissions risk irreversible actions; dry-run mitigates some risks, but permission systems and auditing are still evolving. -
Gradual Progress: Like moving from physical safes to online banking or paper contracts to e-signatures, CLI and dry-run are first steps.
FAQ: Predicting Common User Questions
Q1: What is CLI, and why is it better suited for AI than GUI?
CLI is a command-line interface that operates computers via text commands. It’s self-descriptive and text-based, so AI can understand it with --help, whereas GUI requires screenshots and simulations, which are more steps and error-prone.
Q2: Why are everyone building CLI tools in the AI Agent era?
AI Agents need to operate tools for tasks, and CLI provides a direct interface. Its self-descriptive and text advantages make it easy for AI to use, unlike APIs that require extra documentation.
Q3: What are the differences between MCP, CLI, and skills?
CLI executes commands, MCP pre-registers tool lists, and skills provide usage instructions. CLI suits terminal environments, MCP fits non-terminal settings, and skills boost AI success rates.
Q4: How to install Feishu CLI?
Steps: 1. Run npm install -g @larksuite/cli to install CLI; 2. Run npx skills add github.com/larksuite/cli -y -g to install skills. AI can also auto-install.
Q5: What should I consider when designing a CLI for AI?
Focus on help text, dry-run support, error message guidance, and structured output with volume control. Feishu’s design offers a reference.
Q6: What is the future of CLI?
CLI is reviving as the primary interface for AI to operate software. Enterprises open-sourcing CLI push AI Agent adoption, but permission management needs further exploration.
Conclusion
In the AI Agent era, the revival of command-line tools is no coincidence. CLI’s self-descriptive nature, text-based interaction, and composability make it an ideal interface for AI to access external services. Feishu’s open-source lark-cli not only provides a tool but also builds enterprise-grade infrastructure for the Agent era. By understanding these insights, you can apply CLI design principles in practice. Remember: always let AI dry-run before execution—this could be the first step toward secure AI collaboration.
