agentleFS
csfuwwccsfuwwc/md-skills/skills/feishu-cli-manager/SKILL.md

feishu-cli-manager

Skill4 starsChanged 3 months agoMITView on GitHub

Use when the user asks to install Feishu/Lark CLI, configure lark-cli, connect an agent with Feishu CLI, check or refresh lark-cli auth, recover expired tokens, or start a Feishu device-flow login.

  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 9 are distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill to install, configure, and maintain local lark-cli for agent workflows.

    line 10
  2. Distinctive:

    Never print app secrets, access tokens, refresh tokens, cookies, or credential files.

    line 14
  3. Very specific:

    Treat which lark-cli, lark-cli --version, and npm list -g --depth=0 as installation evidence.

    line 15
  4. Very specific:

    Treat lark-cli auth status as the first source of truth for local auth state.

    line 16
  5. Very specific:

    Use lark-cli auth status --verify only when network verification is needed.

    line 17
  6. Distinctive:

    When command output contains a verification URL, copy that URL exactly as returned.

    line 20
  7. Very specific:

    Do not run lark-cli config bind, lark-cli config init --new, or lark-cli config init --force-init unless the user confirms the intended …

    line 21
  8. Distinctive:

    Prefer the bundled helper when available from this skill directory:

    line 25
  9. Distinctive:

    Update an existing install:

    line 56
  10. Very specific:

    Use lark-cli update --check --json when only checking update availability.

    line 62
  11. Very specific:

    If lark-cli is installed but not configured, inspect before changing anything:

    line 66
  12. Distinctive:

    Use server verification only when needed:

    line 90
  13. Very specific:

    If an environment reports keychain not initialized, first suspect that the current process cannot access the local keychain.

    line 96
  14. Distinctive:

    If the token is expired, missing, revoked, or too close to expiry, start a scoped login:

    line 100
  15. Distinctive:

    Use narrower domains or scopes when the task is limited:

    line 106
  16. Very specific:

    Check whether lark-cli is installed.

    line 121
  17. Very specific:

    If missing, install @larksuite/cli with npm after confirming Node/npm are available.

    line 122
  18. Distinctive:

    If installed but not configured, decide between binding an existing agent app and creating a new app.

    line 123
  19. Very specific:

    Check auth state with lark-cli auth status.

    line 124
  20. Very specific:

    If tokenStatus is valid and refreshExpiresAt is not close, report that no reconnect is needed.

    line 125
  21. Very specific:

    If access token expiry is close but refresh token is still valid, run lark-cli auth status --verify once and re-check.

    line 126
  22. Very specific:

    If refresh token is expired, missing, or revoked, start lark-cli auth login with the smallest explicit domain/scope that fits the task.

    line 127
  23. Distinctive:

    If a device-flow URL is returned, present it exactly and wait for the user to authorize.

    line 128
  24. Very specific:

    Verify completion with lark-cli auth status --verify.

    line 129

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Feishu CLI Manager

Use this skill to install, configure, and maintain local lark-cli for agent workflows.

Core Rules

  • Never print app secrets, access tokens, refresh tokens, cookies, or credential files.
  • Treat which lark-cli, lark-cli --version, and npm list -g --depth=0 as installation evidence.
  • Treat lark-cli auth status as the first source of truth for local auth state.
  • Use lark-cli auth status --verify only when network verification is needed.
  • User auth and bot auth are different. Do not run auth login for bot-only permission issues.
  • lark-cli auth login must request an explicit range with --domain, --scope, or --recommend.
  • When command output contains a verification URL, copy that URL exactly as returned. Do not rewrite or re-encode it.
  • Do not run lark-cli config bind, lark-cli config init --new, or lark-cli config init --force-init unless the user confirms the intended app/config identity.

Install Check

Prefer the bundled helper when available from this skill directory:

python3 scripts/feishu_cli_setup.py --check

Manual checks:

node --version
npm --version
which lark-cli
lark-cli --version

lark-cli is normally installed as the global npm package @larksuite/cli.

Install Or Update

Install only when lark-cli is missing:

python3 scripts/feishu_cli_setup.py --install

Equivalent direct command:

npm install -g @larksuite/cli

Update an existing install:

lark-cli update

Use lark-cli update --check --json when only checking update availability.

Configure

If lark-cli is installed but not configured, inspect before changing anything:

lark-cli auth status
lark-cli config init --help
lark-cli config bind --help

Inside an agent workspace, prefer lark-cli config bind only after the user confirms the target app and identity mode. Use bot-only unless the task needs personal resources; use user-default only when the user explicitly needs user-resource access.

For a brand-new standalone app setup, and only after the user confirms that intent:

lark-cli config init --new

Auth Check

Run:

lark-cli auth status

Use server verification only when needed:

lark-cli auth status --verify

If an environment reports keychain not initialized, first suspect that the current process cannot access the local keychain. Re-run the check in an environment with normal keychain access before assuming the Feishu account or token is broken.

Refresh Or Reconnect

If the token is expired, missing, revoked, or too close to expiry, start a scoped login:

lark-cli auth login --domain all --scope offline_access

Use narrower domains or scopes when the task is limited:

lark-cli auth login --domain docs --domain drive
lark-cli auth login --scope "docs:document.content:read drive:file:download offline_access"

The bundled helper can summarize expiry and decide whether login is needed, but it must run with the same keychain access as lark-cli:

python3 scripts/feishu_auth_refresh.py --login-if-needed --domain all --scope offline_access

Agent Workflow

  1. Check whether lark-cli is installed.
  2. If missing, install @larksuite/cli with npm after confirming Node/npm are available.
  3. If installed but not configured, decide between binding an existing agent app and creating a new app; do not guess this choice.
  4. Check auth state with lark-cli auth status.
  5. If tokenStatus is valid and refreshExpiresAt is not close, report that no reconnect is needed.
  6. If access token expiry is close but refresh token is still valid, run lark-cli auth status --verify once and re-check.
  7. If refresh token is expired, missing, or revoked, start lark-cli auth login with the smallest explicit domain/scope that fits the task.
  8. If a device-flow URL is returned, present it exactly and wait for the user to authorize.
  9. Verify completion with lark-cli auth status --verify.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.