lark-oauth

Manages Feishu user authorization via Device Authorization Flow for lark-cli commands.

8|2|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/luojiaaoo/xpeech --skill lark-oauth-luojiaaoo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lark-oauth
Source: https://github.com/luojiaaoo/xpeech/tree/main/xpeech/agent/skills/buildin/lark-oauth
Command: npx skills add https://github.com/luojiaaoo/xpeech --skill lark-oauth-luojiaaoo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When using lark-cli to operate the Feishu Open Platform, user-identity tokens must be obtained and refreshed correctly. This Skill governs the entire lark-oauth authorization flow so lark-cli commands can execute with valid user credentials without manual token handling. ## Core Features & Use Cases - Device Authorization Flow handling: Detects authorization URLs in command output, relays them to the user, and polls with the saved device_code (up to 60 seconds, max 2 attempts) until the token is issued. - Token lifecycle management: Reuses cached access tokens, silently refreshes expired ones with single-rotation refresh tokens, and falls back to re-authorization on Feishu error codes 20026/20037/20064/20073. - Batch scope authorization: Collects all missing_scopes across a task and authorizes them in one lark-oauth --scope call, so the user only clicks the authorization link once. - Use Case: An agent needs to read a Bitable table and send a message via lark-cli. It runs the commands, collects missing scopes like base:record:read and im:message, executes one lark-oauth --scope command, sends the URL to the user, then reruns the blocked commands after authorization completes. ## Quick Start Authorize lark-cli with lark-oauth using the required scopes, then rerun my Feishu command once the token is ready.

Frequently Asked Questions about lark-oauth

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

FAQPage Schema
How do I authorize lark-cli with Feishu user identity?▼

Run lark-oauth with the required scopes, which starts a Device Authorization Flow and outputs an authorization URL. Send the URL to the user, then rerun the same command to poll with the saved device_code until the token is issued.

How to handle missing_scopes errors from lark-cli commands?▼

Collect all missing scopes reported across the task, merge them into one space-separated string, and run a single lark-oauth --scope command. After the user authorizes via the URL, rerun the blocked commands with the same scope set.

Can I use lark-cli auth login instead of lark-oauth?▼

No. The build uses a custom Credential Provider, so tokens saved by lark-cli auth login or manual profiles are not picked up. Only lark-oauth manages the user token cache that lark-cli commands consume.

Why does lark-oauth say user not authorized after polling?▼

Polling waits at most 60 seconds per attempt and allows only two attempts per device_code. If the user has not completed authorization or the device_code expired or was denied, the pending state is deleted and a new authorization URL is generated on the next run.

Where are lark-oauth token and device flow files stored?▼

State lives in the xpeech config directory ($XDG_CONFIG_HOME/xpeech/ or ~/.config/xpeech/) with 0700 directory and 0600 file permissions. It contains lark-cli-user-token.json for tokens and lark-cli-oauth-pending.json for in-progress device authorization.