feishu-cli

repository·main·Indexed 20 days ago

https://github.com/riba2534/feishu-cli

A comprehensive command-line interface for the Feishu (Lark) Open Platform. It provides bidirectional Markdown ↔ Feishu document conversion, native rendering of Mermaid and PlantUML into editable vector graphics, and extensive command groups for managing docs, wiki, sheets, bitables, messages, calendars, and more. Designed for both developers and AI Agents, it features a high-performance concurrent pipeline for large-scale imports and a generic OpenAPI passthrough supporting over 2,500 endpoints.

Tokens
44.7K
Snippets
83
Records
268
Agent score
78%

What's inside feishu-cli

  1. Overview of feishu-cli

    main

    feishu-cli is a comprehensive command-line interface (CLI) for the Feishu (Lark) Open Platform. It encapsulates operations for Feishu documents, knowledge bases, spreadsheets, messages, calendars, tasks, and more into a concise CLI.

    Core Capabilities:

    • Bidirectional Markdown ↔ Feishu Document Conversion: Supports 40+ block types with near-zero loss. Content imported from Markdown to Feishu can be exported back to Markdown while preserving integrity.
    • Native Chart Rendering: Automatically converts Mermaid (8 types) and PlantUML into editable Feishu whiteboard vector graphics (not static screenshots).
    • High-Performance Processing: Uses a three-stage concurrent pipeline architecture designed for large-scale imports (e.g., 10,000+ lines, 127+ charts, 170+ tables).
    • AI Agent Optimized: Specifically designed for AI coding assistants like Claude Code, providing 9 out-of-the-box domain skills to allow agents to manage Feishu without manual configuration.
    • Robustness for Scripts: Includes spelling suggestions for mistyped commands/flags, --dry-run mode for write operations, idempotency keys to prevent duplicate requests, and unified --jq/--format for structured output.
  2. Command Reference for feishu-cli

    main

    The feishu-cli tool provides a wide range of commands to interact with the Feishu (Lark) ecosystem. The general syntax is:

    feishu-cli <command> [subcommand] [flags]

    Key command groups include:

    • doc: Document operations (create, import, export, edit, async operations).
    • wiki: Knowledge Base (Wiki) operations (nodes, spaces, member management).
    • sheet: Spreadsheet operations (read/write, styles, rich text, XLSX/CSV export).
    • bitable: Multidimensional Table operations (88 commands covering bases, fields, records, etc.).
    • msg: Messaging (send, forward, reply, pin, reactions, history).
    • chat: Group chat management (CRUD, member management).
    • mail: Email operations (send, search, drafts, templates).
    • drive: Cloud Drive enhancements (upload, download, move, mirror).
    • markdown: Drive native Markdown CRUD.
    • vc: Video conferencing (search, notes, recording queries).
    • minutes: Feishu Minutes (AI products, search, media download).
    • apps: Miaoda (App Builder) application management.
    • file: File management (list, move, copy, delete, upload, download).
    • media: Media asset operations.
    • perm: Permission management (add/delete collaborators, public access, passwords).
    • calendar: Calendar operations (schedule, search, availability).
    • task / tasklist: Task and Task List management.
    • attendance: Attendance record and statistics.
    • okr: OKR operations.
    • slides: Slides presentation operations.
    • user / dept: User and Department information.
    • board: Whiteboard/Board operations.
    • comment: Comment management.
    • approval: Approval workflow operations.
    • search: Search messages and documents.
    • event: Real-time event subscription (WebSocket).
    • schema: Local browsing of Feishu OpenAPI methods.
    • api: Generic OpenAPI passthrough (supports 2500+ endpoints with auto-auth).
    • profile: Multi-app/Multi-account configuration.
    • doctor: Environment health checks.
    • auth: Identity authentication (OAuth, status, logout).
    • config: Configuration management.
  3. Use the feishu-cli-mail skill for email operations

    main

    The feishu-cli-mail skill is the dedicated entry point for all Feishu Mail operations. You must use this skill when performing tasks related to the inbox, messages, threads, sending, replying, forwarding, drafts, filters, signatures, or email templates.

    Key capabilities include:

    • Inbox triage
    • Reading messages and threads
    • Sending, replying, and forwarding emails
    • Managing drafts
    • Managing filters and email signatures
    • Handling CID inline images and templates
    • Sending HTML/CID emails

    Important Workflow Note: Even if you only request a preview of an email (e.g., "Generate a preview of the email and wait for my confirmation") without actually sending it, you must still use this skill as it follows the draft/send workflow.

  4. Use feishu-cli for messaging, cards, and events

    main

    The feishu-cli-messaging skill is the unified entry point for all Feishu instant messaging operations. Use this skill when you need to interact with Feishu chats, groups, or interactive cards.

    Capabilities include:

    • Messaging: Sending, replying, forwarding, merging forwards, marking as urgent (加急), and downloading resources.
    • Chat Management: Reading chat history, viewing message details, managing Reactions, Pins, message revocations, and group/member management.
    • Interactive Cards: Designing and generating V2 interactive card JSON.
    • Events: Subscribing to and consuming real-time events via WebSocket.

    Triggering the skill: The skill is automatically triggered if the request involves msg, chat, card, event, post/interactive, oc_, om_, Reaction, Pin, urgent marking, or local images within a message.

    Note: Do NOT use this skill for email (use feishu-cli-mail), meeting recordings/transcripts (use feishu-cli-meetings), or global platform-wide message searching (use feishu-cli-platform).

    argument-hint: <msg|chat|card|event> [args]
  5. Use the feishu-cli-meetings skill for meetings and minutes

    main

    The feishu-cli-meetings skill is the dedicated entry point for interacting with Feishu Video Conferencing (VC) and Minutes (妙记).

    Use this skill for:

    • Searching for meetings.
    • Accessing meeting notes, AI summaries, and transcripts.
    • Downloading recordings, videos, or transcripts.
    • Managing meeting bots (joining/leaving meetings).
    • Querying meeting events.
    • Retrieving minute tokens.

    Do NOT use this skill for:

    • Creating meeting schedules or finding meeting times (use feishu-cli-work instead).

    Command Syntax: feishu-cli <vc|minutes> [args]

  6. Use feishu-cli-visual for Feishu visualization and presentation

    main

    The feishu-cli-visual skill is the unified entry point for creating visual content in Feishu. Use this skill when you need to generate or manipulate any of the following:

    • Visual Assets: Whiteboards (画板), architecture diagrams, flowcharts, flywheels, fishbone diagrams, roadmaps, posters, illustrations, SVG, or Mermaid diagrams.
    • Presentations: Creating or modifying Slides/PPT.
    • Dynamic/Interactive Content: Embedding moving ECharts, maps, 3D components, or window.magic components.
    • Web Applications: Publishing HTML applications via Miaoda/Spark.

    Note: This skill is NOT for message cards (use feishu-cli-messaging) or Markdown chart imports (use feishu-cli-docs).

    Usage Syntax:

    feishu-cli-visual <dataviz|board|slides|htmlbox|apps> [args]
  7. Overview of feishu-cli AI Skills

    main

    The feishu-cli provides 9 specialized AI skills that cover the full range of Feishu (Lark) capabilities. Each skill loads fine-grained workflows from references/workflows/ on demand.

    SkillFunctionalityTrigger Example
    feishu-cli-platformAuthentication, configuration, Profile, doctor, API/schema, search, address book"Login to Feishu", "Check this API parameter"
    feishu-cli-docsDocument reading/editing, Markdown import/export, native .md CRUD"Import this md to Feishu"
    feishu-cli-storageDrive, file/media, wiki, comments, and permissions"Upload file and give permissions to colleagues"
    feishu-cli-messagingMessage sending, chat history, group management, cards, and event subscriptions"Make a card and send it to the group"
    feishu-cli-dataFull functionality for Sheets and Bitable/Base"Add a dropdown to the table"
    feishu-cli-visualDataviz, Whiteboard, Slides,妙笔BOX, and 妙搭 apps"Draw an interactive chart in Feishu"
    feishu-cli-workCalendar, Tasks, Approvals, Attendance, and OKR"Find time for a meeting and create a task"
    feishu-cli-mailFeishu Mail reading, drafts, sending, replying, and forwarding"Reply to this Feishu email"
    feishu-cli-meetingsVideo conferencing, Minutes, Recording, Transcripts, and Meeting Bots"Download meeting minutes"
  8. Convert Mermaid and PlantUML to Feishu Canvas

    main

    Markdown code blocks containing mermaid or plantuml (or puml) are automatically converted into editable Feishu Canvas vector graphics rather than static screenshots.

    Supported Mermaid types:

    • flowchart TD / flowchart LR (supports subgraph)
    • sequenceDiagram (recommended $\le$ 8 participants)
    • classDiagram
    • stateDiagram-v2 (must use v2)
    • erDiagram
    • gantt
    • pie
    • mindmap

    Supported PlantUML types:

    • Sequence, Activity, Class, Use Case, Component, ER, and Mindmaps.
    ```mermaid
    flowchart TD
        A[开始] --> B{判断}
        B -->|是| C[处理]
        B -->|否| D[结束]
  9. Identify the scope of feishu-cli-platform capabilities

    main

    The feishu-cli-platform skill provides foundational platform capabilities for the Feishu CLI. It is specifically designed for tasks involving configuration, authentication, and general platform metadata.

    Use this skill for:

    • Authentication & Identity: Login/Logout, Device Flow, managing scope, User/Tenant Token, Token expiration, and profile management.
    • Diagnostics: Running doctor commands.
    • API Discovery & Execution: Querying OpenAPI schemas (paths, parameters, scopes), executing raw/unwrapped OpenAPI calls, and using the --as flag.
    • Global Search: Searching for docs, messages, or apps (Note: this is limited to global search and does not include business-domain searches like approvals or meetings).
    • Directory Services: Querying users, emails, phone numbers, and departments.

    DO NOT use this skill for:

    • Document/Cloud Drive operations: Use feishu-cli-docs or feishu-cli-storage.
    • Messaging/Groups/Cards: Use feishu-cli-messaging.
    • Sheets/Bitable: Use feishu-cli-data.
    • Approvals/Workflows: Use feishu-cli-work.
    • Meetings/Minutes/Recordings: Use feishu-cli-meetings.
  10. Use the feishu-cli-work skill for work management

    main

    The feishu-cli-work skill is a specialized entry point for managing specific Feishu work modules. It is not a general-purpose entry point for all Feishu requests.

    Supported Modules

    You must use this skill for the following tasks:

    • Calendar: freebusy, finding common free time, booking meeting rooms, RSVP (accept/reject), creating or replying to schedules.
    • Tasks & Tasklists: Managing tasks, sub-tasks, members, reminders, comments, attachments, and task lists.
    • Approvals: Initiating, withdrawing, approving, rejecting, transferring, or CC'ing approvals.
    • Attendance: Querying clock-in/out, lateness, and leave statistics.
    • OKR: Querying OKR cycles or updating progress.

    Prohibited Uses

    Do not use this skill for the following; they require different specialized tools:

    • Contacts/Departments: Use feishu-cli-platform.
    • Email: Use feishu-cli-mail.
    • Meeting History/Recordings/Minutes: Use feishu-cli-meetings.
    • Meeting Notifications: Use feishu-cli-messaging.
    argument-hint: <calendar|task|tasklist|approval|attendance|okr> [args]
  11. Understand identity and token requirements for meeting commands

    main

    The feishu-cli-meetings skill uses different authentication tokens depending on the command being executed:

    1. User Token Required:

      • vc search
      • vc notes
      • vc recording
      • vc detail
      • vc note detail
      • vc transcript
      • All minutes commands
    2. Bot Token (Default):

      • vc bot meeting-join
      • vc bot meeting-leave
      • Note: You can switch to a User Token for these commands using an explicit flag.
    3. User Token Required (Strict):

      • vc bot meeting-events (This endpoint rejects Tenant Tokens; it requires a User Token and the vc:meeting.meetingevent:read permission).