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 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install 24871f37-2824-450b-893a-bf2815d8b9fc --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
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.
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.
How to use
- Install the Lark CLI and skill:
npm install -g @larksuite/clithennpx skills add larksuite/cli -y -g. - Initialize configuration:
lark-cli config initto set up your app credentials. - Authenticate:
lark-cli auth login --recommendto start the auth flow with recommended scopes.
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
Related on TokRepo
- AI tools for automation -- CLI automation tools and workflows
- AI tools for API -- API integration and management tools
Common pitfalls
- Not running
config initbefore 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.
常见问题
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.
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.
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.
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.
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)
- Lark CLI GitHub— Lark CLI provides command-line access to Lark/Feishu APIs
- Lark Open Platform Docs— Lark Open Platform API documentation and scopes
- Lark Auth Docs— OAuth 2.0 authentication flow for Lark apps
来源与感谢
Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars
Part of the Lark CLI Official Skills Collection on TokRepo.
讨论
相关资产
Lark CLI Skill: Wiki — Knowledge Base Management
Lark/Feishu CLI skill for knowledge base. Create and manage knowledge spaces, organize document nodes and shortcuts.
Lark CLI Skill: Tasks — Todo & Project Management
Lark/Feishu CLI skill for task management. Create todos, track progress, manage subtasks, assign members, set reminders.
Lark CLI Skill: Mail — Email Management
Lark/Feishu CLI skill for email. Draft, send, reply, forward emails. Manage drafts, folders, labels, contacts, and attachments.
Lark CLI Skill: Calendar — Event & Schedule Management
Lark/Feishu CLI skill for calendar management. View agenda, create events, invite attendees, check free/busy, and get time suggestions.