The bundle card, its page, and the feishu component row show Feishu's mark from its official site instead of the default artwork.
description, kind
| description | kind |
|---|---|
| Give the model the absolute path of the official Feishu lark-cli, load its embedded skills, and run the account operations the Plugins page drives. | package-reference |
@deepseek-ai/dsh-feishu-cli
English | 中文
Summary
This package is the Host row of the Feishu plugin. It installs a pinned @larksuite/cli, gives the model the absolute path of its lark-cli executable in runtime context, and registers one feishu skill that indexes the guides embedded in that CLI. It registers the account with the CLI account registry, whose Plugins page section checks the default account, links an app and signs in through the CLI's browser flows, signs out, and cancels. The CLI keeps credentials in its default configuration, which the user's own terminal shares. Only macOS is supported.
Table of Contents
- Use this package
- Understand the implementation
- Further Exploration
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
Add it to a profile
Install the Feishu plugin bundle, which inserts this package as the feishu row; that page covers approving the @larksuite/cli install script. Until the executable exists, the plugin fails to load with an error that names the missing path.
What you get
After the plugin loads, one feishu skill joins the skill catalog. The agent loads it with the skill tool, opens the guide it needs, such as lark-doc or lark-shared, with lark-cli skills read, and runs lark-cli by that path through the ordinary Shell tools under the current sandbox and approval policy. When a command reports a missing app configuration or sign-in, the agent asks the user to connect Feishu on the plugin page; it runs the CLI's own setup and sign-in flow only when the user asks to finish it in the conversation. Commands that save sign-in state ask for single-command approval because they write outside the workspace.
Turning the row off in Plugin Manager withdraws the feishu skill and the path from runtime context. The CLI configuration and sign-in stay in place.
Account operations
The Plugins page drives these operations through the CLI account registry, which the Web app loads; a headless profile loads the plugin without it. The Host runs at most one account operation at a time and owns it, so leaving the page does not cancel it. Linking an app and signing in are separate operations, so the page starts each one from its own click.
| Operation | Effect |
|---|---|
check |
Checks the account again; each browser that opens the Web app starts one when no operation runs |
link-app |
Runs config init --new, which replaces the CLI's default configuration, including its sign-ins and any other app, with the app the user creates or chooses; it does not sign in. Replacing a linked app asks first |
sign-in |
Runs auth login --json for the linked app and checks that the same user is signed in |
sign-out |
After the user confirms, runs auth logout --json, which also signs out the user's own terminal, then checks again |
| Cancel | Cancels the operation during app setup or sign-in and waits for its command to exit; other steps are ignored |
A check runs auth status --verify --json. The account reads connected only when the CLI reports an available user that its server verified, signed-out when the user is missing, not configured, or needs a refresh, unconfigured when no app exists, and unverified otherwise, for example when verification cannot reach the server. Every state except unconfigured carries the configured appId. Each link that config init prints and each device-authorization link that auth login reports is offered only when it is an HTTPS address on feishu.cn or larksuite.com. A sign-in that leaves requested permissions ungranted (auth login exits with code 3 and lists them as missing) still succeeds; a command that later needs a missing permission reports it. Results report succeeded, cancelled, or failed. Failures show the command, observed exit code, and recognized CLI error categories on the page and in the Host log; native messages, paths, and authorization data are omitted. A successful Feishu webpage does not confirm that local credentials were saved. The process running DSH needs access to the CLI configuration and system credential storage; DSH_HOME does not relocate either.
Configure
| Field | Default | Meaning |
|---|---|---|
binDir |
the installed @larksuite/cli package's bin |
Absolute directory containing an executable lark-cli, lark-cli.exe on Windows |
commandTimeoutMs |
30000 |
Deadline for one skill command, account check, or sign-out, including executable lookup |
App setup and sign-in wait up to 10 minutes for the user in the browser, and each command keeps at most 1 MiB of stdout; the CLI account library fixes both limits.
The generated config catalog is the exhaustive source of supported fields.
Understand the implementation
Implementation internals — click to expand
src/index.ts is a function plugin. It checks that binDir/lark-cli (lark-cli.exe on Windows) is executable, gives that path to the model in runtime context, and registers the skill provider. src/cli.ts locates lark-cli and parses the JSON output of its commands. The CLI account library registers that runtime context, runs each command by the same path, and runs one account operation at a time. src/account.ts extends that runtime with the Feishu commands, reads setup and sign-in links from their output lines, and classifies failures through src/diagnostic.ts. src/presentation.ts maps each view to the section the registry serves, in the text of src/locales.ts. Disposal cancels the active operation, aborts running commands, and settles after their processes exit.
src/skills.ts lists the feishu skill without running the CLI. Each load runs lark-cli skills list --json and places the DSH guidance, an index of each guide's name and description, and the instructions for opening a guide and the files it references; a failed catalog read fails that load, and the next load reads the catalog again. Guides are embedded in the binary, so the skill's resource base is opaque.
Further Exploration
- Connector packages — the group this application plugin belongs to.
- CLI account library — command execution, the CLI path context, and account operations shared by CLI app plugins.
- Skills — catalog publication, loading, and precedence.
- Feishu plugin — the bundle that inserts this row and the page row.
- CLI account surfaces — the registry and the Plugins page section that drive the account operations.
- Plugin Manager — installation, build-script approval, and enablement.
Model Experience
Skill catalog entry
What the model sees
One feishu entry appears in the skill catalog with the description below.
Catalog description
Feishu (飞书) and Lark through the bundled lark-cli: documents and wiki, Base, sheets, slides, Drive files, messages and group chats, calendar, video meetings and minutes, tasks, approvals, mail, contacts, OKR, attendance, events, and the CLI's app setup and sign-in. Load it before any Feishu or Lark task; it indexes the guides and how to open them.
Token effect
The entry stays in context while the plugin is loaded, at about 350 characters.
KV Cache effect
The entry is fixed. Loading or unloading the plugin changes the catalog, which is republished as a new message and leaves earlier context in place.
Loaded skill body
What the model sees
A skill tool result contains the DSH guidance below, a ## Guides index with one `name`: description line for each guide that lark-cli skills list --json reports, and the opening instructions below. Its resource description reads Embedded lark-cli guides; open them with the skills read command given in the loaded skill.
DSH guidance
# Feishu in DSH
Call this integration the Feishu plugin (飞书插件 in Chinese) in user-facing replies. Run `lark-cli` in the Host Shell by the absolute path that the current runtime context gives for it, not by name; DSH installs the version this plugin pins. It uses the default lark-cli configuration and sign-in shared with the user's own terminal, so do not remove, switch, or sign out of apps or profiles unless the user asks.
When a command reports a missing app configuration or sign-in, first ask the user to connect Feishu on the Feishu plugin page in Plugins. Open the lark-shared guide and run its setup and auth flow yourself only when the user asks to finish it in this conversation. Never ask for or print app secrets or tokens.
Commands that save sign-in state, such as `auth login --device-code` and `config init`, write outside the workspace and use up their one-time authorization even when the save is denied: on the first attempt, set the Shell tool's `sandbox_permissions` to the narrowest mode that can write outside the workspace, with a `justification`. Run other commands in the existing sandbox and set `sandbox_permissions` only when a credential, lock, log, or cache write is denied.
Do not install another lark-cli or run `lark-cli update`.
Opening instructions
## Opening a guide
These guides belong to lark-cli and are not skills: open one with `lark-cli skills read <name>` in the Host Shell, not with the skill tool.
Read a file that a guide references, such as `references/...`, with `lark-cli skills read <name> <relative-path>`. Read a reference to another guide, such as `../lark-foo/...`, with the same command without the leading `../`: `lark-cli skills read lark-foo/...`.
Token effect
Each load adds the fixed guidance, the index, and the opening instructions to the retained tool history. For lark-cli 1.0.97 the index lists 28 guides, and the tool result has about 8,000 characters. Guides and the files they reference arrive as ordinary Shell output when the agent reads them through lark-cli.
KV Cache effect
Loading appends a tool result and does not rewrite earlier context.
CLI path
What the model sees
While the row is loaded, the CLI account library adds one required runtime-context entry with the path of lark-cli in binDir, which defaults to the installed @larksuite/cli package's bin directory.
Runtime-context entry
Feishu CLI: run `lark-cli` by its absolute path "<binDir>/lark-cli"; the bare name may resolve to another installation or to none.
Runtime-context entry on Windows
Feishu CLI: run `lark-cli` by its absolute path with the call operator, & '<binDir>\lark-cli.exe'; the bare name may resolve to another installation or to none.
Token effect
One line of about 110 characters plus the path in each runtime-context snapshot.
KV Cache effect
The system prompt does not change; loading or unloading the row, or a changed path, appends one runtime-context snapshot.
Known Limitations and Deferred Work
- Only macOS and Windows x64 are supported; other platforms are unverified.
- Commands must run on this Host. When a composition runs them elsewhere, such as over SSH, the plugin still loads, and each command that runs
lark-clifails because the path does not exist there. - The plugin uses the CLI's default configuration. Signing in or out from DSH affects the user's own terminal, and there is no DSH-private account or account picker. The plugin offers no unbind operation; turning it off keeps the configuration and sign-in.
- Sign-in reads the device-authorization link and the completion from
lark-cli auth login --jsonevents; a CLI version that changes those events fails the connection with a retryable result. - Under a file sandbox, a token refresh during an ordinary command can be denied and then needs single-command approval.
Dev Note
Working context for maintainers — click to expand
Repository installs deny the @larksuite/cli install script in the root pnpm-workspace.yaml, so a checkout has no native binary. To run the plugin from source against the real CLI, run node packages/connector/feishu-cli/node_modules/@larksuite/cli/scripts/install.js once. Specs and the feishu-skills session snapshot use stand-in executables through binDir.