lark-shared

Configure lark-cli authentication, identity switching, and permission handling for Feishu API operations.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/TrayMachi/dotfiles --skill lark-shared-traymachi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lark-shared
Source: https://github.com/TrayMachi/dotfiles/tree/main/agents/skills/lark-shared
Command: npx skills add https://github.com/TrayMachi/dotfiles --skill lark-shared-traymachi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up and authenticating lark-cli against the Feishu (Lark) platform involves confusing identity types, OAuth device flows, scope permissions, and high-risk operation gates. This Skill guides an AI agent through correct initialization, login, and error recovery so users avoid common pitfalls like bot/user identity mismatches and permission-denied errors. ## Core Features & Use Cases - Configuration & Authentication: Initializes lark-cli config, runs split-flow device authorization with QR code generation, and switches between user and bot identities via --as. - Permission & Error Recovery: Diagnoses scope errors using permission_violations and console_url, performs incremental scope authorization, and handles exit-code-10 high-risk-write confirmation gates with --yes retry protocol. - Update & Safety Rules: Detects _notice.update fields to prompt CLI updates, enforces secret-handling rules, relative-path constraints, and --dry-run previews for dangerous operations. - Use Case: A user asks the agent to read their Feishu calendar but hits a permission error; the Skill directs the agent to run lark-cli auth login --scope ... --no-wait --json, present the QR code, and complete device-code authorization in a follow-up turn. ## Quick Start Ask the agent to set up lark-cli and log in with the calendar read scope so it can access your Feishu calendar.

Frequently Asked Questions about lark-shared

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate lark-cli with Feishu?

Run lark-cli auth login with either --domain or --scope to specify the authorization range. For agent-driven flows, use --no-wait --json to get a verification_url and device_code, show the user a QR code, then complete with auth login --device-code after they authorize.

What is the difference between bot and user identity in lark-cli?

Bot identity (--as bot) only needs appId and appSecret but cannot access user resources like calendars or personal cloud docs. User identity (--as user) requires both developer-console scopes and user authorization via auth login, and accesses the user's own resources.

How do I fix lark-cli permission denied or scope errors?

Check the error's permission_violations field for missing scopes. For bot identity, open the provided console_url to enable scopes in the developer backend. For user identity, run auth login --scope with the missing scope; scopes accumulate across logins.

Why does lark-cli exit with code 10 on delete operations?

Exit code 10 with confirmation_required means the command is a high-risk write requiring explicit approval. Show the user the risk action, and only after explicit consent retry the original command with --yes appended. Use --dry-run first to preview the request.

How do I resolve a Feishu wiki token to the underlying document?

A /wiki/<token> URL contains a node token, not the object token. Run lark-cli drive +inspect --url with the wiki URL to get the underlying type (docx, sheet, bitable) and canonical token, then route to the appropriate service skill.

Can lark-cli accept absolute file paths for uploads?

No. Path parameters like --file, --output, and @file only accept relative paths under the current working directory; absolute paths return an unsafe file path error. Prefer passing large data via stdin to avoid path and escaping issues.