Skills2026年3月30日·1 分钟阅读

Lark CLI Skill: Shared — Auth, Config & Security

Lark/Feishu CLI shared foundation skill. App config, auth login, identity switching, scope management, and security rules.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
CLI Tool
安装
Stage only
信任
信任等级:Community
入口
Lark CLI Skill: Shared — Auth, Config & Security
安全暂存命令
npx -y tokrepo@latest install 24871f37-2824-450b-893a-bf2815d8b9fc --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
Foundation skill for Lark/Feishu CLI covering app authentication, config management, identity switching, and security rules.
§01

What it is

The Lark CLI Shared Skill is the foundation layer for Lark/Feishu command-line automation. It provides app configuration, authentication login flows, identity switching between multiple Lark apps, scope management for API permissions, and security rules for safe CLI operations.

This skill is for developers and DevOps engineers who automate Lark/Feishu workflows via CLI. If you manage multiple Lark apps, need to switch between identities, or want to script Lark API interactions, this skill provides the authentication plumbing.

§02

How it saves time or tokens

Instead of manually handling OAuth tokens, refresh cycles, and multi-app credential management, this skill provides a single lark-cli auth login command that handles the entire flow. Identity switching lets you move between apps without re-authenticating. Scope management ensures your CLI sessions have the right permissions before making API calls, preventing failed requests and wasted debugging time.

§03

How to use

  1. Install the Lark CLI and skill: npm install -g @larksuite/cli then npx skills add larksuite/cli -y -g.
  2. Initialize configuration: lark-cli config init to set up your app credentials.
  3. Authenticate: lark-cli auth login --recommend to start the auth flow with recommended scopes.
§04

Example

# Install and configure
npm install -g @larksuite/cli
npx skills add larksuite/cli -y -g
lark-cli config init

# Authenticate with recommended scopes
lark-cli auth login --recommend

# Switch between app identities
lark-cli auth switch --app my-production-app

# Check current auth status
lark-cli auth status

# List available scopes
lark-cli auth scopes list
§05

Related on TokRepo

§06

Common pitfalls

  • Not running config init before attempting to authenticate. The CLI needs app credentials (App ID and App Secret) configured before the auth flow can start.
  • Forgetting to request necessary scopes during login. If your script needs specific API permissions, pass them during auth rather than discovering missing scopes at runtime.
  • Storing credentials in version control. The CLI config file contains sensitive tokens. Add the config directory to .gitignore and use environment variables for CI/CD pipelines.

常见问题

What is the difference between Lark and Feishu?+

Lark is the international version and Feishu is the Chinese domestic version of the same collaboration platform by ByteDance. The CLI works with both, but the API endpoints and app registration process differ between the two.

How does identity switching work?+

The CLI stores credentials for multiple Lark apps locally. The auth switch command lets you change which app identity is active for subsequent commands without re-authenticating. This is useful when managing staging and production apps.

Is the CLI suitable for CI/CD pipelines?+

Yes. You can authenticate using environment variables (LARK_APP_ID, LARK_APP_SECRET) instead of interactive login. The CLI supports non-interactive modes for automated pipelines.

What scopes should I request?+

Use the --recommend flag during login to get commonly needed scopes. For specific use cases, check the Lark API documentation for required scopes and pass them explicitly during auth login.

How are credentials stored securely?+

The CLI stores tokens in a local config directory with restricted file permissions. Tokens are refreshed automatically before expiration. For enhanced security, use environment variables and avoid storing credentials in the config file.

引用来源 (3)
🙏

来源与感谢

Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars

Part of the Lark CLI Official Skills Collection on TokRepo.

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产