AI Agent Hub
Back to skills
Tencent COS Smart Management & Processing Skill icon

Tencent COS Smart Management & Processing Skill

IT Ops & Security Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @tencent-adm/tencent-cos-skill.

About this skill

Problem It Solves

When directly using Tencent Cloud APIs to manage COS and CI, developers face multiple service endpoints, complex authentication flows, and fragmented SDKs. For instance, managing object storage, performing image processing, running content moderation, or building a knowledge base based on semantic retrieval often requires writing and maintaining separate scripts or integrating distinct toolchains, thereby increasing development and operational complexity.

How the Skill Works

This skill provides a unified set of Node.js script entry points that consolidate disparate COS and CI capabilities into structured actions.

Core Capabilities and Execution Flow

  1. Unified Entry and Credential Management: The skill operates via three scripts: scripts/cos_node.mjs, scripts/ci_api.mjs, and scripts/preview_gen.mjs. It automatically handles the installation of cos-nodejs-sdk-v5 and supports credential management through environment variables (e.g., TENCENTCLOUD_*) or .env files, compatible with both temporary (STS) and permanent keys.
  2. Comprehensive Operations and Processing:
    • Storage & Bucket Management: Execute file upload, download, signed URL generation, and query bucket configurations (e.g., ACL, lifecycle, encryption policies).
    • CI Processing: After binding Data Processing (CI), invoke image processing (resize, AI enhancement), content recognition (OCR, tagging), media transcoding, content moderation, and more.
    • Intelligent Retrieval & Analysis: Use ci_api.mjs to perform structured queries, aggregation analysis, and semantic searches on bound datasets (MetaInsight).
    • Knowledge Base Shortcut Operations: Provide natural language-mapped quick flows, e.g., create-knowledge-base can create a bucket, a DocSearch dataset, and bind them in one step.
  3. Runtime Modes and Security Control: The skill differentiates between public and strict modes via the KIKI environment variable. Strict mode (KIKI=1) disables all deletion operations (including COS object deletion and CI unbinding) and hides local credential management features, providing a safer read-only or non-destructive operating environment.

Key Usage Steps

  1. First-Time Setup and Authentication: The first operation will guide you through environment detection and credential configuration. Using STS temporary credentials is recommended for enhanced security.
  2. Pre-check CI Status Before Operations: Before using CI functions like image or document processing, you must first query the CI binding status of the storage bucket and the enablement status of specific sub-services. Confirming availability before proceeding avoids failures due to unbanned services.
  3. Prerequisites for Datasets and Retrieval: Before performing intelligent retrieval (e.g., image search, knowledge base queries), ensure the storage bucket is bound to a dataset of the correct template and that indexing is complete. If no suitable dataset exists, the skill will guide you through creation.

Scope and Important Notes

  • Cost and Compliance: Both COS and CI are paid services. Invoking processing APIs, especially AI features, will incur charges.
  • Mode Restrictions: In strict mode (KIKI=1), all deletion-semantic operations are forbidden. This restriction cannot be bypassed through other entry points (e.g., direct HTTP calls).
  • Regional Constraints: MetaInsight datasets are only supported in ap-beijing, ap-shanghai, and ap-chengdu. When creating datasets or binding, you must explicitly specify a supported region.
  • Asynchronous Service Enablement: Synchronous image/content recognition is available upon CI binding, but asynchronous tasks, media processing, etc., require separate enablement of their respective sub-services.
  • Functional Entry Point Differences: cos_node.mjs handles write operations and basic processing; ci_api.mjs focuses on read-only retrieval and analysis of datasets. Choose the correct entry point based on your needs.

Use Cases

  • An e-commerce platform's operations engineer needs to batch-compress tens of thousands of product images daily, add uniform brand watermarks, and upload them to a CDN directory for web use.
  • A corporate compliance team needs to automatically review marketing posters and promotional videos uploaded to an internal system to ensure they contain no prohibited logos or sensitive information.
  • A data analyst needs to perform OCR on product screenshots stored in COS to extract key numbers (like prices, dates) and aggregate them into an analysis report.
  • A technical team lead needs to upload scattered API documentation, design drafts, and meeting minutes to a unified knowledge base, enabling team members to find related information quickly via natural language queries.

Best For

  • An operations engineer managing and distributing image resources for an e-commerce platform, needing to automate the processing of massive volumes of images while ensuring their safety and compliance.
  • An administrator of a corporate knowledge base or document center, aiming to transform scattered files into a structured, semantically searchable knowledge asset.
  • A developer or review lead responsible for content security strategies, needing to integrate Tencent Cloud CI capabilities for automated violation detection of text, images, and videos.
  • A post-production staff member in a multimedia content creation team, required to quickly perform batch tasks such as video transcoding, cover frame extraction, or audio noise reduction.