feishu-fetch for Openclaw

A secure, lightweight command-line skill that downloads file, image, and audio attachments from Feishu chat messages directly to local storage for downstream processing by AI agents.

axelhu
v1.2.0
Jun 8, 2026
0
540
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install feishu-fetch

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install feishu-fetch using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is feishu-fetch?

feishu-fetch is a specialized automation skill designed to extract and download attachments—such as files, images, and audio—from Feishu group chat messages. Operating completely within your secure local environment, this tool utilizes standard endpoints like im/v1/messages/{id}/resources/{key} and interacts solely with open.feishu.cn. It is a critical component of Openclaw Skills, giving AI agents the ability to seamlessly transition from receiving a chat attachment to processing it locally with specialized file-readers or analytical pipelines.

Designed with strict security protocols, the tool reads credentials dynamically from local storage and features zero third-party data forwarding. It also implements automated token management, trap-based cleanup of temporary files, and auto-detect mechanisms to identify message attachment types out-of-the-box. This ensures zero credential leakage while delivering robust pipeline capabilities for modern AI workflows.

feishu-fetch Use Cases

  • Downloading group chat attachments to a local workspace when an AI agent needs to parse or analyze received files.
  • Handling fallback scenarios where message reading tools return placeholders instead of actual attachment payloads.
  • Extracting images from chat threads to feed into downstream computer vision or optical character recognition tools.
  • Automating bulk data ingestion pipelines from team chat rooms into local processing folders.

How feishu-fetch Works

  1. Triggering the Script: The host system or AI agent invokes the script using the message ID (om_xxx) and optional parameters.
  2. Credential Loading: The skill reads the corresponding Feishu app ID and app secret directly from ~/.openclaw/openclaw.json based on the specified agent profile.
  3. Message Type Auto-Detection: The utility fetches message details and automatically identifies whether the target attachment is a file, image, or audio stream.
  4. Secure Token Exchange: It retrieves or rotates the tenant access token using secure internal inputs without exposing credentials to system processes.
  5. Attachment Download: The script calls the Feishu resource endpoint to stream and save the attachment to a temporary file path or designated custom location.
  6. Path Output: Upon successful completion, the script prints the absolute path of the downloaded file to stdout, enabling downstream Openclaw Skills to proceed with processing.

feishu-fetch Setup

Prerequisites

Make sure your system has curl, python3, and bash installed.

Configuration

Configure your Feishu credentials inside the OpenClaw configuration file at ~/.openclaw/openclaw.json:

{
  \"channels\": {
    \"feishu\": {
      \"accounts\": {
        \"main\": {
          \"appId\": \"cli_your_app_id\",
          \"appSecret\": \"your_app_secret\"
        }
      }
    }
  }
}

Feishu App Permissions

Ensure your Feishu custom application has the minimum required permissions enabled in the developer console:

  • im:resource (Tenant-level file and resource access)

Run the Tool

Execute the script directly by pointing to your local skills directory:

bash ~/.openclaw/skills/feishu-fetch/scripts/feishu-fetch.sh <message_id> [options]

feishu-fetch Data Schema & Taxonomy

Configuration Schema (~/.openclaw/openclaw.json)

Path Type Description
channels.feishu.accounts.<agent_name>.appId String Feishu Developer App Client ID
channels.feishu.accounts.<agent_name>.appSecret String Feishu Developer App Client Secret

CLI Parameter Schema

Option Required Default Description
message_id Yes - The unique Feishu message ID (must start with om_)
--type No Auto Resource category (file, image, or audio)
--output No /tmp/<filename> Target absolute path for the downloaded attachment
--agent No $AGENT_NAME or main Explicit account profile to load from configuration

feishu-fetch Advanced Features

  • Contextual Thread Fallback Logic: Detects broken message chains and prompts users to input parent message IDs (root_id) for precise downloading.
  • Multi-Agent Profiling: Seamlessly switches between multiple bot configurations utilizing custom environment profiles and the --agent parameter.
  • Automated Resource Cleanups: Leverages Bash trap actions to guarantee that all intermediate and temporary cache structures are cleanly scrubbed post-execution.
  • Key-Only Retrieval Mode: Offers a diagnostic --print-key flag to extract only the internal file keys for troubleshooting without downloading physical data.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Github Stars: 0
forks: 0

Featured*