行家越用越順手的 CLI

CLI 一片黑壓壓的文字主控台,沒有任何提示跟選單,只有不斷閃爍的游標跟當前目錄位置
一般人或者系統管理新手可能會馬上望而卻步,轉身去找有 GUI 圖形介面的 App 版本但是只要累積使用一段時間,就會發現以下問題:
- 想做一件事,需要很多層很多次點擊,才能達成目的
- 有時會忘記某個功能是放在哪個選單或者子選單裡
- 然後,App 不小心一改版重構之後,選單整理邏輯改變後,又要重複上述學習適應流程一次
轉頭看隔壁的行家工程師,在黑壓壓的主控台下一串指令之後,馬上可以查出需要的結果。沒有繁瑣的多層操作跟選單邏輯。
進階版還能彼此串接,湊成 PIPELINE 流程,把複雜的動作一氣呵成,所以一旦碰過就會知道真的香讓人愛不釋手!
AI Agent 愛看愛用的 CLI
進到 AI Agent 時代,除了血肉之軀的真實人類,多出 AI Agent 這種只看數據進出,不管 UIUX 介面美觀跟使用者體驗的無情機器人,CLI 的優勢更加明顯,幫用戶省時間,也省 token 消耗,原理類似之前提過的 agent-browser ,所以各大資料平台也轉向提供 CLI 讓 AI Agent 串接更順利
各大平台擁抱 CLI
Google Gemini CLI
專案 Repo: https://github.com/google-gemini/gemini-cli
教學文:https://codelove.tw/@tony/post/qvpDJ3
Lark CLI
專案 Repo: https://github.com/larksuite/cli
以下展開使用介紹
Lark CLI 設定
中文說明:https://github.com/larksuite/cli/blob/main/README.zh.md
按圖說故事
先裝 CLI
/Users/soctt.h/PycharmProjects/ts_g101_proto_server_v1/logs
➜ logs git:(master) ✗ cd ~/Downloads/
➜ logs git:(master) ✗ npm install -g @larksuite/cli
再裝 原廠 Skills
➜ logs git:(master) ✗ npx skills add larksuite/cli -y -g
Need to install the following packages:
skills@1.4.9
Ok to proceed? (y)
███████╗██╗ ██╗██╗██╗ ██╗ ███████╗
██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝
███████╗█████╔╝ ██║██║ ██║ ███████╗
╚════██║██╔═██╗ ██║██║ ██║ ╚════██║
███████║██║ ██╗██║███████╗███████╗███████║
╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚══════╝
┌ skills
│
◇ Source: https://github.com/larksuite/cli.git
│
◇ Repository cloned
│
◇ Found 20 skills
│
● Installing all 20 skills
│
◇ 45 agents
│
● Installing to: Antigravity, Claude Code, Codex, Cursor, Gemini CLI
...
│ ✓ ~/.agents/skills/lark-workflow-meeting-summary │
│ universal: Antigravity, Codex, Cursor, Gemini CLI, Amp +7 more │
│ symlinked: Claude Code │
│ ✓ ~/.agents/skills/lark-workflow-standup-report │
│ universal: Antigravity, Codex, Cursor, Gemini CLI, Amp +7 more │
│ symlinked: Claude Code │
│ │
├────────────────────────────────────────────────────────────────────╯
│
└ Done! Review skills before use; they run with full agent permissions.
初始化設定

打开以下链接配置应用:
https://open.larksuite.com/page/cli?user_codexxxx-xxxx&lpv=1.0.4&ocv=1.0.4&from=cli
等待配置应用...
OK: 应用配置成功! App ID: cli_xxxxx
待 CLI App 接入審核通過後,完成登入授權
➜ logs git:(master) ✗ lark-cli auth login --recommend
在浏览器中打开以下链接进行认证:
https://accounts.larksuite.com/oauth/v1/device/verify?flow_id=xxxx-xxxx-xxxx&user_code=xxxx-xxxx
等待用户授权...
{
"ok": false,
"error": {
"type": "auth",
"message": "authorization failed: Unable to authorize. The app is pending approval."
}
}
➜ logs git:(master) ✗ lark-cli auth login --recommend
在浏览器中打开以下链接进行认证:
https://accounts.larksuite.com/oauth/v1/device/verify?flow_id=xxxx-xxxx&user_code=xxxx-xxxx
等待用户授权...
[lark-cli] device-flow: token obtained successfully
授权成功,正在获取用户信息...
OK: 登录成功! 用户: Scott (xxx)
已授权 scopes: auth:user.id:read base:app:copy base:app:create base:app:read base:app:update base:dashboard:create base:dashboard:delete base:dashboard:read base:dashboard:update base:field:create base:field:delete base:field:read base:field:update base:form:create base:form:delete base:form:read base:form:update base:history:read base:record:create base:record:delete base:record:read base:record:update base:role:create base:role:delete base:role:read base:role:update base:table:create base:table:delete base:table:read base:table:update base:view:read base:view:write_only base:workflow:create base:workflow:read base:workflow:update board:whiteboard:node:create board:whiteboard:node:delete board:whiteboard:node:read calendar:calendar.event:create calendar:calendar.event:delete calendar:calendar.event:read calendar:calendar.event:update calendar:calendar.free_busy:read calendar:calendar:create calendar:calendar:delete calendar:calendar:read calendar:calendar:update contact:user.base:readonly contact:user.basic_profile:readonly contact:user:search docs:document.comment:create docs:document.comment:delete docs:document.comment:read docs:document.comment:update docs:document.comment:write_only docs:document.content:read docs:document.media:download docs:document.media:upload docs:document:copy docs:document:export docs:document:import docs:event:subscribe docs:permission.member:auth docs:permission.member:create docs:permission.member:transfer docx:document:create docx:document:readonly docx:document:write_only drive:drive.metadata:readonly drive:file:download drive:file:upload drive:file:view_record:readonly im:chat.members:read im:chat.members:write_only im:chat:read im:chat:update im:message im:message.group_msg:get_as_user im:message.p2p_msg:get_as_user im:message.pins:read im:message.pins:write_only im:message.reactions:read im:message.reactions:write_only im:message:readonly mail:event mail:user_mailbox.mail_contact:read mail:user_mailbox.mail_contact:write mail:user_mailbox.message.address:read mail:user_mailbox.message.body:read mail:user_mailbox.message.subject:read mail:user_mailbox.message:modify mail:user_mailbox.message:readonly mail:user_mailbox:readonly sheets:spreadsheet.meta:read sheets:spreadsheet.meta:write_only sheets:spreadsheet:create sheets:spreadsheet:read sheets:spreadsheet:write_only space:document:move space:folder:create task:comment:write task:task:read task:task:write task:tasklist:read task:tasklist:write vc:meeting.meetingevent:read vc:meeting.search:read vc:note:read wiki:node:copy wiki:node:create wiki:node:read wiki:node:retrieve wiki:space:read wiki:space:retrieve offline_access
整合 Claude Code / OpenAI Codex 使用 Lark
以下展示如何把 Lark 資訊透過 Claude Code 取得


以上只是小小例子,打開潘多拉的盒子之後,加上 AI Agent 的能力,可以玩的事情就很多了
參考資訊
https://www.youtube.com/watch?v=5rAIU0GBjII






















