Lark CLI Skill: Shared — Auth, Config & Security
Lark/Feishu CLI shared foundation skill. App config, auth login, identity switching, scope management, and security rules.
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.
Frequently Asked Questions
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.
Citations (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
Related on TokRepo
Source & Thanks
Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars
Part of the Lark CLI Official Skills Collection on TokRepo.
Discussion
Related Assets
Claude-Flow — Multi-Agent Orchestration for Claude Code
Layers swarm and hive-mind multi-agent orchestration on top of Claude Code with 64 specialized agents, SQLite memory, and parallel execution.
ccusage — Real-Time Token Cost Tracker for Claude Code
CLI that reads ~/.claude logs and breaks down Claude Code token spend by day, session, and project — pluggable into your statusline.
SuperClaude — Workflow Framework for Claude Code
Adds 16+ slash commands, 9 cognitive personas, and a smart flag system to Claude Code in one pipx install.