BY baoyu.io — Bilingual Study Editionbaoyu.io 最新 50 篇精读
All ↩目录 ↩
#34baoyu.io宝玉 · 2026-03-28 · baoyu.io

Feishu Open-Sourced a CLI — Why Is Everyone Building Command-Line Tools for the AI Agent Era?飞书 CLI 开源了,为什么 AI Agent 时代,大家都在做命令行工具?

Why AI agents are bringing the command line back from the deadAI Agent 让命令行重新回到舞台中央

01

Concise Summary简洁概述

CLIs are making a comeback because AI agents, unlike humans, find them the most natural interface: self-describing via --help, text-in/text-out, and composable through pipes without the multi-step detour GUI automation requires.

Feishu's lark-cli and Google's gws exemplify a broader shift: as agents become the new 'users' of software, vendors are shipping AI-native CLIs (with dry-run safety, structured JSON output, and instructive errors) as the standard integration layer, alongside MCP and Skills.

CLI 正在复兴,因为对 AI Agent 而言它比 GUI、API 都更顺手:靠 --help 自描述、文本进文本出、还能用管道自由组合,不像操作图形界面那样要截图识别再模拟点击。

飞书的 lark-cli 和 Google 的 gws 代表了一个更大的趋势:当 Agent 成为软件新用户,厂商开始把 AI 原生 CLI(配 dry-run 安全机制、结构化 JSON 输出、可操作报错)当作标准接入层,与 MCP、技能配合使用。

02

Infographic信息图

3 种
CLI / MCP / Skills — three complementary access layers
CLI/MCP/技能——三种互补的接入方式
3周
Google's gws (Workspace CLI) preceded lark-cli by about three weeks
Google 的 gws 比 lark-cli 早约三周开源
4 条
Four concrete CLI design rules distilled from lark-cli's build
从 lark-cli 设计中提炼出的四条 CLI 设计准则
🖥️

CLI is self-describing

CLI 自带说明书

A CLI exposes its whole capability surface via --help, so an AI agent can learn to use an unfamiliar tool in one call. APIs require external docs, endpoint discovery, and auth setup before a single request can be made — a much higher bootstrap cost for an agent working autonomously.

CLI 靠 --help 就能把全部能力暴露给 AI,一次调用就能学会怎么用。API 则要先拿文档、搞懂端点和认证方式才能发出第一个请求,对自主运行的 Agent 来说启动成本高得多。

🔀

CLI, MCP, Skills — three different jobs

CLI、MCP、技能:分工不同

CLI does the actual work and costs zero context when idle; MCP registers a tool list that stays resident in the context window even unused, but is the only option where a terminal isn't reachable (e.g. Cursor); Skills are static instructions telling the agent when/how to call the CLI — the article's 'hand / another hand / muscle memory' framing.

CLI 负责真正执行,空闲时不占上下文;MCP 提前注册工具清单,即使不用也常驻上下文窗口,但在无终端环境(如 Cursor)里是唯一选择;技能是静态说明书,告诉 Agent 何时怎么调用 CLI——文章用「手/另一只手/肌肉记忆」来比喻三者分工。

🧪

dry-run as a safety net

dry-run 是安全网

Because an agent can misread intent and act on the wrong data, a --dry-run flag lets it preview exactly what would change (e.g. '47 records would be deleted') before committing. Google's gws goes further, hard-coding a rule that every write/delete must dry-run first.

Agent 可能理解错意图、动到不该动的数据,--dry-run 让它先预览会发生什么(如「将删除 47 条记录」)再真正执行。Google 的 gws 做得更狠,直接在技能文件里写死规则:所有写入删除操作必须先 dry-run。

🧭

Errors that tell the agent what to do next

报错要指路

A human facing 'Permission denied' goes looking for docs; an agent just stalls. Good AI-facing CLIs bundle three things in every error: which parameter failed, why, and the exact next command to fix it — e.g. printing the auth command with the missing scope.

人看到「权限不足」会去查文档,Agent 看到就卡住。面向 AI 的 CLI 每条报错都该包含三要素:哪个参数出问题、具体原因、修复用的下一条命令——比如直接给出带缺失 scope 的授权命令。

The argument, step by step
论证推进链条
1
Feishu open-sources lark-cli, letting an AI agent operate Feishu (messaging, calendar, docs, bases, tasks) purely via terminal commands.
飞书开源 lark-cli,让 AI Agent 能通过终端命令直接操作飞书:发消息、查日历、写文档、建多维表格、管任务。
2
This is part of a pattern — Google's gws did the same for Workspace three weeks earlier — signalling that CLIs are becoming the default AI-Agent integration point in 2026.
这不是孤例——三周前 Google 的 gws 已对 Workspace 做了同样的事,说明 2026 年 CLI 正成为 AI Agent 接入的默认方式。
3
The core reason: CLIs are self-describing (--help) and text-native, matching how agents actually consume information — unlike APIs (need external docs) or GUIs (need vision models and simulated clicks).
核心原因:CLI 靠 --help 自描述、天然文本交互,正合 Agent 处理信息的方式——不像 API 需要外部文档,也不像 GUI 需要视觉模型识别再模拟点击。
4
CLI, MCP and Skills are complementary, not competing: CLI executes, MCP registers tools for terminal-less environments at a context-window cost, Skills teach the agent how/when to use the CLI.
CLI、MCP、技能三者互补而非竞争:CLI 负责执行,MCP 面向无终端环境但要占用上下文,技能负责教会 Agent 何时怎么用 CLI。
5
The article distills four design rules from lark-cli: rich --help/schema docs, --dry-run previews, errors that specify the fix command, and structured/paginated JSON output to avoid blowing the context window.
文章从 lark-cli 提炼出四条设计准则:详尽的 --help/schema 文档、--dry-run 预览、报错自带修复命令、结构化分页的 JSON 输出以避免撑爆上下文。
6
The piece closes on the open problem: as agents become software's new users, permission scoping, audit trails, and human-agent boundaries remain unsolved — dry-run is framed as just the first step of that infrastructure.
文章最后指出悬而未决的问题:当 Agent 成为软件新用户,权限授予、审计追踪、人机协作边界仍在摸索中——dry-run 只是这套企业级基础设施的第一步。
03

Detailed Summary详细解读

The piece opens with a concrete artifact — lark-cli — rather than an abstract thesis, and immediately generalizes it: Google's gws shipped three weeks prior for Google Workspace, so this isn't a Feishu quirk but a dated trend ('2026年了,所有想接入 AI Agent 的产品,都在做 CLI'). The move from anecdote to trend claim is doing real argumentative work — it reframes a product launch as evidence of an industry-wide interface shift, decades after CLIs were considered obsolete relative to GUIs.

The causal mechanism is spelled out precisely: agents need to act, and CLIs beat both APIs and GUIs as the acting surface because (a) they are self-describing via --help/schema, removing the docs-fetch step APIs require, and (b) they are text-native, matching what LLMs process best, whereas GUI automation requires screenshotting, vision-model button detection, and simulated clicks — turning one command into four failure-prone steps. This is the article's strongest technical argument because it names the exact mechanical cost GUI automation adds.

Rather than treating CLI as a silver bullet, the piece carefully triangulates it against MCP and Skills with a division-of-labor framing ('CLI 是手,MCP 是另一种手,技能是肌肉记忆'). It concedes MCP's genuine advantage — terminal-less environments like Cursor's desktop client — avoiding the strawman of 'CLI replaces MCP'. This nuance matters because much of the AI-tooling discourse treats these as competing standards rather than complementary layers.

The four design rules (rich help/schema, dry-run, actionable errors, structured/paginated output) are the article's most exportable content — they read as a checklist any team building an agent-facing CLI could apply directly, each illustrated with a lark-cli or gws example (e.g. the exact --dry-run output format, the auth-scope error example). This is where the piece earns its 'how-to' value beyond the news hook.

The closing section pivots from mechanism to open risk: permission scoping for agents is unsolved — too little access and agents can't act, too much and a misread intent becomes irreversible. The historical analogy (moving company funds from a safe to online banking, contracts from paper to e-signature) frames dry-run as an early, partial mitigation rather than a solved problem, which tempers the otherwise celebratory tone of the piece.

A subtle strategic point the article makes near the end deserves emphasis: Feishu's advantage isn't the CLI itself but that its underlying enterprise capabilities (messaging, docs, calendar, approvals, bases, tasks) were already mature before this launch — the CLI is a distribution mechanism for pre-existing infrastructure, not new capability. This explains why the move is hard for smaller competitors to replicate quickly.

文章先给出一个具体案例 lark-cli,再迅速把它泛化:Google 的 gws 三周前刚为 Workspace 做了同样的事,所以这不是飞书的个案,而是一个有时间锚点的行业趋势(「2026 年了,所有想接入 AI Agent 的产品都在做 CLI」)。从个案到趋势的跳跃是文章的关键论证动作——它把一次产品发布重新框定为界面范式转移的证据,而 CLI 在 GUI 时代早已被认为过时。

因果机制交代得很清楚:Agent 要干活,CLI 比 API 和 GUI 都更适合作为执行界面,原因有二:其一,CLI 靠 --help/schema 自描述,省掉了 API 需要的取文档步骤;其二,CLI 天然文本交互,正合 LLM 所长,而 GUI 自动化要截图、用视觉模型找按钮、模拟点击,把一条命令拆成四步、每步都可能出错。这是全文最扎实的技术论证,因为它精确点出了 GUI 自动化多出来的机械成本。

文章没有把 CLI 捧成万能药,而是用「CLI 是手,MCP 是另一种手,技能是肌肉记忆」的分工框架,把它和 MCP、技能仔细做了区分,也承认了 MCP 的真实优势——在 Cursor 桌面端这类无终端环境里,MCP 是唯一选择。这种克制很重要,因为不少 AI 工具讨论把三者当成互相竞争的标准,而不是互补的分层。

四条设计准则(详尽的帮助/schema、dry-run、可操作报错、结构化分页输出)是全文最具可迁移性的部分——几乎是一份任何团队做 Agent 向 CLI 时都能直接套用的清单,每条都配有 lark-cli 或 gws 的具体例子(如 --dry-run 的具体输出格式、缺权限时报错自带授权命令)。这部分让文章超越了单纯的产品新闻价值,具备了实操指南的分量。

结尾从机制转向开放风险:Agent 的权限授予问题并未解决——权限太少 Agent 什么都做不了,权限太高又怕它理解错意图造成不可逆后果。文章用「把公司资金从保险柜搬到网银、合同从纸质搬到电签」的历史类比,把 dry-run 定位为这一进程中早期、局部的缓解手段,而非已解决的问题,为全文略显乐观的基调加了一层克制。

文章接近结尾处提出一个值得强调的战略观察:飞书的真正优势不在 CLI 本身,而在于消息、文档、日历、审批、多维表格、任务这些企业协作能力早已成熟——CLI 只是把既有基础设施重新包装成一个分发渠道,而非新增能力。这解释了为什么这一步棋不容易被规模较小的竞品短期复制。

04

FAQ常见问答

Why is CLI better for AI agents than the existing API?CLI 相比现成的 API,对 AI Agent 到底好在哪?

A CLI is self-describing — --help and schema commands tell the agent everything it needs on the spot. An API requires the agent to first fetch external docs, learn endpoints, and configure auth before it can act.

CLI 是自描述的,靠 --help 和 schema 命令当场就能告诉 Agent 全部信息;而 API 需要 Agent 先拿到外部文档、搞懂端点、配置好认证方式才能动手,多了一整套前置流程。

Does CLI make MCP obsolete?有了 CLI,MCP 是不是就没用了?

No. MCP remains the only option in environments without terminal access, like Cursor or Claude's desktop app. The article frames them as complementary layers, not competitors — CLI for terminal-capable settings, MCP elsewhere.

不会。在 Cursor、Claude 桌面端这类无法访问终端的环境里,MCP 仍是唯一选择。文章把两者定位为互补而非竞争关系:能用终端就用 CLI 更轻量,不能用终端就靠 MCP。

How does dry-run actually prevent damage, given the agent still decides what to do?dry-run 只是预览,Agent 最终还是自己决定要不要执行,它真能防住风险吗?

Dry-run surfaces a concrete preview (e.g. exact record counts to be deleted) for a human to review before the irreversible action runs. It shifts the final confirmation to a human checkpoint rather than trusting the agent's judgment alone — a partial, not complete, safeguard.

dry-run 会给出具体预览(比如即将删除的记录数和明细),让人在不可逆操作真正执行前有机会审核确认。它把最终把关交还给人类,而不是完全信任 Agent 的判断——是部分而非彻底的安全机制。

Is this trend specific to Feishu, or a broader industry pattern?这是飞书一家的动作,还是整个行业的趋势?

Broader: Google shipped gws for Workspace three weeks before lark-cli, using near-identical design choices (including a hard-coded dry-run rule), suggesting independent convergence on the same interface pattern rather than imitation.

是行业性的:Google 的 gws(面向 Workspace)比 lark-cli 早三周上线,设计选择高度相似(甚至同样把 dry-run 写成硬性规则),说明这是各家独立收敛出的同一种接口范式,而非互相模仿。

What's Feishu's real edge that a competitor can't just copy by shipping their own CLI?如果竞品也做一个类似的 CLI,能追上飞书吗?

Not easily — the CLI only distributes capability that already exists. Feishu's edge is that messaging, docs, calendar, approvals, bases, and tasks were already mature and integrated; a competitor without that breadth gets a thin CLI wrapping fewer real capabilities.

不容易——CLI 只是把已有能力开放出去的分发渠道。飞书的真正优势是消息、文档、日历、审批、多维表格、任务这些能力早已成熟且互通;缺乏这种广度的竞品即便做出 CLI,包裹的实际能力也会薄得多。

05

In-depth Analysis · Pros & Cons深入解读 · 优缺点

This piece explains why every AI-Agent-facing product is now shipping a CLI instead of (or alongside) an MCP server, using Feishu's newly open-sourced lark-cli as the case study. It distills concrete design lessons — help text, dry-run, actionable errors, structured output — for anyone building an AI-native command-line tool.

文章以飞书新开源的 lark-cli 为案例,解释为什么 2026 年所有想接入 AI Agent 的产品都在做命令行工具,而不只是 MCP。它把飞书的设计选择提炼成可复用的四条 CLI 设计准则:帮助文本、dry-run、可操作的报错、结构化输出。

Strengths亮点 / 优点
  • Concrete, checkable examples
    例子具体可核验
    Every claim is anchored to an actual command (lark-cli calendar +agenda, the dry-run deletion preview, the auth-scope error), making the piece feel like a field report rather than punditry.
    每个论点都配有真实命令作证据(如 lark-cli calendar +agenda、dry-run 的删除预览、缺权限报错),让文章更像一线实测报告,而非空泛评论。
  • Careful three-way triangulation
    三方关系厘清得细
    Instead of hyping CLI as a replacement, the article precisely scopes CLI, MCP, and Skills to distinct jobs and even names the scenario (terminal-less clients) where MCP still wins — a rarer move than 'X beats Y' takes.
    文章没有把 CLI 捧成替代品,而是精确划定了 CLI、MCP、技能各自的职责边界,并明确指出 MCP 仍占优的场景(无终端环境)——比常见的「X 完胜 Y」论调更审慎。
  • Actionable design checklist
    给出可直接套用的准则
    The four CLI-design rules (help/schema, dry-run, instructive errors, structured/paginated output) are specific enough that a reader could apply them to their own product the same day.
    四条 CLI 设计准则(帮助/schema、dry-run、可操作报错、结构化分页输出)足够具体,读者当天就能直接套用到自己的产品上。
  • Honest about unresolved risk
    直面未解决的风险
    The closing section doesn't pretend permissioning and audit trails are solved — it explicitly names them as open problems, tempering what could have been an uncritically celebratory piece.
    结尾没有假装权限和审计问题已经解决,而是明确点出这些是尚在摸索的开放问题,克制了本可能失之乐观的整体论调。
Limits & Critiques局限 / 批评
  • No hard adoption data
    缺乏采用率数据
    The 'everyone is building CLIs in 2026' claim rests on two examples (Feishu, Google) and general vibe, not on any survey or count of how many products have actually shipped agent-facing CLIs.
    「2026 年大家都在做 CLI」这一判断只靠飞书和 Google 两个案例支撑,并无调研或统计数据证明到底有多少产品真的推出了面向 Agent 的 CLI。
  • Security trade-offs underexplored
    安全权衡讨论不够深
    Dry-run is presented as the main safeguard, but the piece doesn't address scenarios where an agent's dry-run preview itself is misread by the human reviewer, or where high-frequency agent actions make manual review impractical at scale.
    文章把 dry-run 当作主要安全机制,但没有讨论人类审核者本身误读预览结果的情况,也没谈高频 Agent 操作在规模化后人工审核根本跟不上的问题。
  • CLI-vs-GUI framing is somewhat one-sided
    CLI 优于 GUI 的论证略显单边
    The comparison to GUI automation (screenshot → vision model → click) is real but skips over cases where CLIs themselves are poorly documented or inconsistent across vendors, which would erase the self-describing advantage claimed.
    CLI 相较 GUI 自动化的优势论证(截图→视觉模型→点击)确实成立,但没有讨论 CLI 本身文档质量参差、各厂商设计不一致时,「自描述」优势可能荡然无存的情况。
  • Enterprise permissioning framed as inevitable but unproven
    企业级权限体系的乐观预期缺乏依据
    The historical analogy (cash to online banking, paper to e-signature) implies agent permissioning will smoothly mature the same way, but offers no mechanism for why that transition is guaranteed rather than merely hoped for.
    用「现金到网银、纸质到电签」的历史类比暗示 Agent 权限体系也会顺利成熟,但并未给出任何机制说明为什么这一转变是必然发生的,而不只是一种美好期望。
Bottom line
总评

Worth reading for anyone building agent-facing tooling — the four CLI design rules and the CLI/MCP/Skills triangulation are directly applicable. Treat the 'everyone is doing this' framing as a trend observation from two data points, not a market survey, and note that the permissioning/security questions raised at the end remain genuinely unresolved.

适合任何正在为 AI Agent 打造工具接口的人阅读,四条 CLI 设计准则和 CLI/MCP/技能三方分工的梳理都可以直接拿来用。但「大家都在做」的判断只基于两个案例,不是市场调研;文末提到的权限与安全问题也确实还没有答案,读者应带着这层保留去看。

06

Original Text原文

The English text on this side is an AI translation provided for convenience; the authoritative version is the source in the other language.

Feishu (Lark) just open-sourced a command-line tool called lark-cli that lets AI agents directly operate Feishu: send messages, check calendars, write documents, create multi-dimensional tables, send emails, manage tasks. You tell the AI one sentence, and it goes and operates Feishu to get the task done.

There are many similar CLIs. Three weeks ago Google also open-sourced gws, letting AI agents operate Google Workspace. It's 2026, and every product that wants to plug into AI agents is building a CLI.

First, what is a CLI

CLI (Command Line Interface) is when you open a black-background, white-text terminal window on your computer, type a line of command, press enter, and the computer does the work for you.

For example, if you want to check today's schedule, instead of opening the Feishu app and finding the calendar, you type one line:

And the schedule is listed out.

No buttons, no icons, no fancy interface. The CLI predates the graphical interface by more than twenty years, and it gradually fell out of use in the Windows era. But in the AI agent era, it's become popular again.

Why is everyone building CLIs in the AI agent era

For an AI agent to get work done, it needs the ability to operate tools. If you ask an AI to help book a meeting room, it needs access to the calendar system. If you ask it to organize customer data, it needs to be able to read and write spreadsheets. If you ask it to deploy code, it needs to be able to run deployment commands.

There has to be an interface for the AI to call. APIs can do this too, but a CLI has an advantage that an API doesn't: a CLI is self-describing. When an AI encounters an unfamiliar CLI, typing --help tells it what capabilities exist, how to use them, and how to fill in the parameters. Not so with an API — the AI first has to get the documentation, figure out the endpoints, and understand the authentication method before it can act. A CLI comes with its own manual built in; the AI can pick it up and use it right away.

Also, a CLI is naturally text-based in its interaction — input is text, output is text. Text is exactly what AI is best at handling. Conversely, having an AI operate a GUI is a roundabout process: it has to take screenshots, use a vision model to identify where the buttons are, and then simulate mouse clicks — turning something a single command could accomplish into four steps, each of which can go wrong. For AI, the CLI is a naturally suited operating interface.

What about MCP and skills

There are currently three mainstream ways to let an AI agent operate external services: MCP, CLI, and skills. The three aren't substitutes for each other — each handles a different job.

The CLI is the tool that actually does the work. Once it's installed, you can run commands in the terminal — checking calendars, sending messages, creating tables — all executed by the CLI.

MCP also lets AI operate external services, but in a different way. MCP registers a list of tools with the AI ahead of time, so the AI can call them anytime, but the list itself sits permanently in the context window (think of it as the AI's "working memory," which has limited space). Even if the AI doesn't need a particular tool at the moment, its description still takes up space. With a CLI, the AI goes to the terminal and types a command only when it needs to, then leaves — it doesn't occupy context.

Another difference is composability. A CLI can combine pipes and parameters into operations that were never pre-defined, for example:

One line of command can find out how many meetings you have with Zhang San next week. Every capability in MCP needs to be registered in advance; to achieve the same effect, you'd have to define a separate new tool.

That said, MCP has its own use cases. In environments that don't support the command line (such as Cursor or the Claude desktop app), MCP is the only option. The two each have their strengths: use CLI where terminal access is available, for lighter and more flexible operation; rely on MCP where terminal access isn't available.

Skills are the manual written for the agent to read. They don't do the work themselves, but they tell the agent what commands this CLI has, what parameters to use in which scenarios, and how to handle errors. An agent can still use a CLI without a skill file, by figuring things out through --help on its own. But with a skill file, the agent knows how to operate right from the start, and its success rate is much higher.

Simply put: the CLI is the hand, MCP is another kind of hand, and skills are muscle memory. Feishu's newly open-sourced project provides both the CLI and the skill file together.

How to write a good CLI for AI

You can't just write any old command-line tool and expect AI to use it smoothly. If you want to build an AI-facing CLI for your own product, Feishu's design has a few points worth referencing.

First, the help text is your most important piece of documentation. When an AI encounters an unfamiliar CLI, the first thing it does is run --help. Your help text is three things in one: the tool manual, the parameter specification, and the usage guide. Don't just write something like Usage: myctl deploy [flags] and call it done — spell out clearly what each parameter does, when to use it, and what its default value is. The Feishu CLI also has a schema command that can quickly look up the parameters, request body, response structure, and supported identity and permission scopes for any API method. Once the AI sees this information, it can decide on its own how to make the call.

Second, support dry-run — this is a safety net designed for AI. AI makes its own decisions, and sometimes it misunderstands your intent, or matches data it shouldn't touch. Dry-run functions as a "preview" mechanism.

For example, say you ask AI to help delete last month's expired records in a Feishu multi-dimensional table. If it executes directly, a mistaken deletion is gone for good. Add --dry-run, and the AI will run through it first and return something like: "The following 47 records are about to be deleted: 23 expired tasks from 2025-05, 24 archived projects. No actual changes have been made." You review it, and if it looks fine, you tell it to drop --dry-run and actually execute. Google's gws does the same thing — its skill file even hardcodes a rule: for all write and delete operations, dry-run must be done first.

Third, error messages should guide the next action. When a person sees "Permission denied," they go check the docs themselves. When an AI sees "Permission denied," it gets stuck. Feishu CLI's approach is: tell the AI which permission it's missing, and give it the command to request that permission at the same time. For example, lark-cli auth login --scope "calendar:calendar:readonly". Once the AI sees this, it can fix the problem itself and keep working. For a CLI designed for AI, every error message should contain three elements: which parameter is the problem, exactly what went wrong, and what command to run next to fix it.

Fourth, return structured data and control the output volume. The Feishu CLI supports multiple output formats such as json, csv, and table. For humans, table is easier on the eyes; for AI agents, json is more reliable. A good CLI isn't just one that runs successfully — it should also be easy for other tools to consume. At the same time, output volume needs to be controlled. AI's context window is limited; if a single command returns ten thousand lines of logs, the context blows up. The Feishu CLI provides pagination parameters (--page-limit) and filtering parameters, so the AI can get just the portion of data it needs.

Whether you're the one designing the CLI or the one using it, remember this: before letting the agent take action, have it do a dry run first.

Once installed, you talk, and the agent acts

Once installed, in practice it works like this: you say one sentence, and the agent goes and operates Feishu to get things done.

After a meeting ends, you tell the AI, "Pull out all the action items mentioned in that meeting just now — send documents for the ones that need documents, create tasks for the ones that need tasks." The AI reads the meeting notes, breaks down the action items, and executes them one by one: using lark-cli doc create to create documents in Feishu, using lark-cli task create to create tasks and assign them to the right people, and using lark-cli im send to notify the group of the results. You said just one sentence for the whole process, and the agent ran a string of commands in the terminal. And because there's dry-run, you can have it preview which tasks it's about to create and who they'll go to, and confirm before it actually executes.

If you need to schedule a meeting across five people in different time zones, you tell the AI, "Help me check when everyone is free next week." The AI checks everyone's calendars and time zones, recommends a few time slots, you pick one, and the meeting is set.

You can even have the AI write a first draft directly in a Feishu document for you; you leave comments in the document with your suggestions, and the AI reads the comments and revises on its own. The whole collaborative process never requires leaving Feishu.

Installation is simple too: npm install -g @larksuite/cli installs the CLI, and npx skills add https://github.com/larksuite/cli -y -g installs the skill file. You don't even need to remember these two steps yourself — just send the project address https://github.com/larksuite/cli to the agent and let it install itself and learn how to use it on its own.

The return of the CLI

Over the past forty years, the direction computer interfaces have evolved has consistently gone from CLI to GUI, from text to icons, from keyboard to touchscreen — becoming more and more friendly to humans.

In the AI agent era, the direction has reversed — the user of software has become the AI agent. The CLI, an interface designed for the world of text, happens to be the tool AI finds most natural to use.

Since agents have become software's new source of user growth, it's no surprise that Feishu is providing a CLI. Rather than wait for the community to write an MCP adapter layer, it makes more sense to build an AI-native CLI directly — fully open source, requiring no registration or approval, so that any AI agent can plug in.

This also brings up an unavoidable question: how should an agent's permissions be granted? Without permissions, it can't do anything; with too much permission, there's a risk that the agent misunderstands the intent and does something irreversible.

This also brings up an unavoidable question: how should an agent's permissions be granted? Without permissions, it can't do anything; with too much permission, there's a risk that the agent misunderstands the intent and does something irreversible. After all, we're not yet at the point where an agent can approve things on your behalf or send an all-staff email for you. Dry-run can cover part of the risk, but to truly get agents running at scale within an enterprise, the permission system, audit trails, and the boundaries of human-agent collaboration are all still being figured out.

But looking at it another way, back when we moved company money from the safe to online banking, and moved contracts from paper to electronic signatures, those were also things we figured out step by step. CLI and dry-run may just be the first step in this process.

And Feishu doing this actually has an advantage that others can't easily replicate: it's already mature enough in the enterprise collaboration space — messaging, documents, calendars, approvals, multi-dimensional tables, tasks — these capabilities are all already there. Now, opening up all these capabilities through an AI-native CLI will likely make it the most open and AI-agent-friendly enterprise-level access point domestically. The value of this isn't just one more tool — it's more like genuinely building enterprise-grade infrastructure for the agent era, opening up permissions, auditing, and organizational capabilities to the whole ecosystem. That will be a crucial step for the industry's adoption of AI agents.

飞书刚开源了一个命令行工具 lark-cli,能让 AI Agent 直接操作飞书:发消息、查日历、写文档、建多维表格、发邮件、管任务。你跟 AI 说一句话,它自己去操作飞书完成任务。

类似的 CLI 还很多,三周前 Google 也开源了 gws,让 AI Agent 操作 Google Workspace。2026 年了,所有想接入 AI Agent 的产品,都在做 CLI。

先说 CLI 是什么

CLI(Command Line Interface),就是你在电脑上打开一个黑底白字的终端窗口,敲一行命令,回车,电脑帮你干活。

比如你要查今天的日程,不用打开飞书 App 找日历,敲一行:

lark-cli calendar +agenda

日程就列出来了。

没有按钮,没有图标,没有花哨的界面。CLI 比图形界面早了二十多年,在 Windows 时代逐渐没什么人用了。但 AI Agent 时代,又火起来了。

为什么 AI Agent 时代,大家都在做 CLI

AI Agent 要干活,就得有操作工具的能力。你让 AI 帮你订会议室,它需要能访问日历系统。你让它帮你整理客户数据,它需要能读写表格。你让它帮你部署代码,它需要能跑部署命令。

总得有一个接口让 AI 去调用。API 也能做这件事,但 CLI 有一个 API 不具备的优势:CLI 是自描述的。AI 碰到一个陌生的 CLI,敲一下 --help 就知道有哪些能力、怎么用、参数怎么填。API 不行,AI 得先拿到文档、弄清端点、搞懂认证方式,才能动手。CLI 自带说明书,AI 拿来就能用。

而且 CLI 天然是用文本交互的,输入是文字,输出也是文字。AI 最擅长处理的就是文字。反过来,让 AI 操作 GUI 就绕远了,得截图、用视觉模型识别按钮在哪、再模拟鼠标去点,一行命令能搞定的事拆成四步,每步都可能出错。对 AI 来说,CLI 就是天然的操作界面。

那 MCP 和技能呢

让 AI Agent 操作外部服务,现在主流有三种方式:MCP、CLI、技能(Skills)。三者不是互相替代的关系,各管一件事。

CLI 是实际干活的工具。 装完之后终端里就能跑命令,查日历、发消息、建表格,都是 CLI 在执行。

MCP 也是让 AI 操作外部服务的,但方式不同。 MCP 是提前把工具清单注册给 AI,AI 随时能调用,但清单本身常驻上下文窗口(可以理解为 AI 的“工作记忆”,空间有限)。就算 AI 暂时不用某个工具,它的描述也占着空间。CLI 是 AI 需要的时候自己去终端敲命令,用完就走,不占上下文。

另一个区别是组合能力。CLI 可以靠管道和参数组合出没预设过的操作,比如:

lark-cli calendar agenda --next-week | grep "张三" | wc -l

一行命令就能查出下周和张三有几个会。MCP 的每个能力都需要提前注册,要实现同样的效果,得单独定义一个新工具。

不过 MCP 有自己的适用场景。在不支持命令行的环境里(比如 Cursor、Claude 桌面端),MCP 是唯一选择。两者各有所长:能访问终端的场景用 CLI 更轻量灵活,不能访问终端的场景靠 MCP。

技能是给 Agent 看的说明书。 它不干活,但告诉 Agent 这个 CLI 有哪些命令、什么场景该用什么参数、出错了怎么处理。没有技能文件 Agent 也能用 CLI,靠 --help 自己摸索。有了技能文件,Agent 一上来就知道该怎么操作,成功率高得多。

简单说:CLI 是手,MCP 是另一种手,技能是肌肉记忆。 飞书这次开源的项目,CLI 和技能一起提供。

怎么给 AI 写好一个 CLI

不是随便写个命令行工具 AI 就能顺畅地用。如果你想给自己的产品做一个面向 AI 的 CLI,飞书的设计有几个值得参考的地方。

第一,help 文本是你最重要的文档。 AI 碰到不认识的 CLI,第一件事就是运行 --help。你的 help 文本就是工具说明书、参数规格、使用指南三合一。别写那种 Usage: myctl deploy [flags] 就完事的帮助信息,要写清楚每个参数干什么、什么时候用、有什么默认值。飞书 CLI 还有一个 schema 命令,可以快速查询任何 API 方法的参数、请求体、响应结构、支持的身份和权限范围。AI 看到这些信息就能自己决定怎么调用。

第二,支持 dry-run,这是为 AI 设计的安全网。 AI 会自己做决策,有时候它理解错了你的意图,或者匹配到了不该动的数据。dry-run 相当于一个“预览”机制。

举个例子,你让 AI 帮你删除飞书多维表格里上个月的过期数据。如果直接执行,删错了就没了。加上 --dry-run,AI 会先跑一遍,返回类似这样的结果:“将要删除以下 47 条记录:2025-05 的过期任务 23 条,已归档项目 24 条。未做任何实际修改。”你看了觉得没问题,再让它去掉 --dry-run 真正执行。Google 的 gws 也做了同样的设计,它的技能文件里甚至写死了一条规则:对所有写入和删除操作,必须先 dry-run。

第三,错误信息要能指导下一步操作。 人看到 Permission denied 会自己去查文档。AI 看到 Permission denied 就卡住了。飞书 CLI 的做法是:告诉 AI 你缺了什么权限,顺便把申请权限的命令也给出来。比如 lark-cli auth login --scope "calendar:calendar:readonly"。AI 看到就能自己修复问题,继续干活。为 AI 设计的 CLI,每一条错误信息都应该包含三个要素:哪个参数出了问题、具体错在哪里、下一步应该执行什么命令来修复。

第四,返回结构化数据,控制好输出量。 飞书 CLI 支持 json、csv、table 等多种输出格式。对人来说 table 更顺眼,对 AI Agent 来说 json 更可靠。好的 CLI 不只是能跑通,还要方便被别的工具消费。同时要控制输出量。AI 的上下文窗口有限,如果一个命令返回一万行日志,上下文就炸了。飞书 CLI 提供了分页参数(--page-limit)和过滤参数,让 AI 能拿到它需要的那部分数据就好。

不管你是设计 CLI 的人还是用 CLI 的人,记住这条:让 Agent 动手之前,先让它 dry run 一遍。

装完之后,你动嘴,Agent 动手

装完之后用起来就是:你说一句话,Agent 去操作飞书把事情办了。

你开完会,跟 AI 说“把刚才会议里提到的所有待办都提出来,该发文档的发文档,该建任务的建任务”。AI 读会议纪要,拆解出待办事项,然后逐条执行:用 lark-cli doc create 在飞书里建文档,用 lark-cli task create 建任务并指派给对应的人,用 lark-cli im send 把结果通知到群里。整个过程你只说了一句话,Agent 在终端里跑了一串命令。而且因为有 dry-run,你可以让它先预览一遍要建哪些任务、发给谁,确认没问题再真正执行。

你要约一个五人跨时区的会,跟 AI 说“帮我看看下周大家什么时候有空”。AI 去查每个人的日历和时区,推荐几个时间段,你选一个,会就建好了。

你甚至可以让 AI 在飞书文档里直接帮你写初稿,你在文档里留评论提意见,AI 读完评论自己改。整个协作过程不用离开飞书。

安装也简单,npm install -g @larksuite/cli 装 CLI,npx skills add https://github.com/larksuite/cli -y -g 装技能文件。你甚至不用自己记这两步,把项目地址 https://github.com/larksuite/cli 发给 Agent,让它自己安装、自己学会怎么用。

CLI 的回归

过去四十年,计算机的界面进化方向一直是从 CLI 到 GUI,从文字到图标,从键盘到触屏,对人越来越友好。

AI Agent 时代,方向反过来了,软件的用户变成了 AI Agent。CLI 这个为文字世界设计的接口,恰好是 AI 最顺手的工具。

既然 Agent 成了软件新的用户增长点,那么像飞书提供 CLI 也不稀奇,与其等着社区来写 MCP 适配层,不如直接做一个 AI 原生的 CLI,完全开源,无需注册审批,让所有 AI Agent 都能接入。

这也带来一个绕不开的问题:Agent 的权限怎么给?不给权限,什么都做不了;权限太高,又怕 Agent 理解错意图干出不可逆的事。

这也带来一个绕不开的问题:Agent 的权限怎么给?不给权限,什么都做不了;权限太高,又怕 Agent 理解错意图干出不可逆的事。毕竟还做不到让 Agent 代你审批、代你发全员邮件。dry-run 能兜住一部分风险,但真正要让 Agent 在企业里大规模跑起来,权限体系、审计追踪、人机协作的边界,都还在摸索中。

但换个角度想,当年我们把公司的钱从保险柜搬到网银,把合同从纸质搬到电子签,也都是一步步摸索出来的。CLI 和 dry-run,可能就是这个过程里的第一步。

而飞书做这件事,其实有一个别人不太容易复制的优势:它本身在企业协作领域已经足够成熟,消息、文档、日历、审批、多维表格、任务,这些能力都是现成的。现在把这些能力通过 AI 原生的 CLI 全部开放出来,大概率会成为国内对 AI Agent 最开放、最友好的企业级接入入口。这件事的价值不止是多一个工具,更像是真正在为 Agent 时代搭建企业级基础设施,把权限、审计、组织能力开放给整个生态,对行业落地 AI Agent 会是很关键的一步。


See all posts