Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

ziqx-drive-sdkziqx drive SDK 命令行

Agent Skill

ziqx-drive-sdk 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

264

周安装

11

GitHub Stars

公开资料未说明

下载量

88
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ziqx-drive-sdk(ziqx drive SDK 命令行)
来源仓库:https://github.com/ziqx/ziqx-ai-skills
仓库路径:skills/ziqx-drive-sdk
安装命令:
npx skills add https://github.com/ziqx/ziqx-ai-skills --skill ziqx-drive-sdk
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ziqx/ziqx-ai-skills --skill ziqx-drive-sdk

简介

ziqx-drive-sdk 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 建议结合原始 README 核验具体用法和功能边界。

SKILL.md

@ziqx/drive Skill

This skill provides comprehensive instructions on how to use the @ziqx/drive package for managing file uploads to Ziqx Drive. It handles both server-side signed URL generation and client-side direct uploads.

Overview

@ziqx/drive is split into two main components:

  1. ZDrive (Server-side): Used to securely generate signed upload URLs using your Drive credentials.
  2. ZDriveClient (Client-side): Used in the browser to upload files directly to the signed URLs and perform image processing (like resizing) before upload.

Installation

npm install @ziqx/drive

Technical Implementation

1. Server-side: Generating Signed URLs

To allow a client to upload a file directly to Ziqx Drive, you must first generate a signed URL on your server. This prevents exposing your ZDRIVE_SECRET to the client.

API Reference: ZDrive

  • constructor(driveKey: string, driveSecret: string)
  • generatePutUrl(fileName: string, folder?: string): Promise<SignUrlResponse>
  • deleteFile(fileName: string, folder?: string): Promise<any>

Logic Flow

  1. Initialize ZDrive with your credentials.
  2. Call generatePutUrl with the intended filename.
  3. Return the url to the client.

2. Client-side: Uploading Files

The client uses the signed URL to perform a multipart/form-data POST request directly to Ziqx Drive.

API Reference: ZDriveClient

  • uploadFile(uploadUrl: string, file: File): Promise<UploadResponse>
  • resizeImage(file: File, maxWidth?: number, quality?: number): Promise<File> (Browser only)

Logic Flow

  1. Obtain the signed URL from your server.
  2. (Optional) Resize the image using ZDriveClient.resizeImage.
  3. Call uploadFile with the signed URL and the File object.

Next.js Implementation Guide

This is the recommended pattern for Next.js applications using Server Actions.

A. Server Action (actions/drive.ts)

Create a server action to securely generate the signed URL.

"use server";

import { ENV } from "@/constants/envs";
import { ZDrive } from "@ziqx/drive";

/**
 * Generates a signed upload URL for Ziqx Drive.
 * This should ALWAYS be called from the server to protect credentials.
 */
export async function generateSignedUrl(fileName: string, folder?: string) {
  // Initialize with drive credentials from environment variables
  const drive = new ZDrive(ENV.ZDRIVE_KEY!, ENV.ZDRIVE_SECRET!);

  const signed = await drive.generatePutUrl(fileName, folder);

  if (signed.success && signed.url) {
    return signed.url;
  } else {
    console.error("❌ Error generating URL:", signed.message);
    return null;
  }
}

/**
 * Deletes a file from Ziqx Drive.
 */
export async function deleteFromDrive(fileName: string, folder?: string) {
  const drive = new ZDrive(ENV.ZDRIVE_KEY!, ENV.ZDRIVE_SECRET!);
  return await drive.deleteFile(fileName, folder);
}

B. Client Component Usage

Use ZDriveClient in your frontend components to handle the actual upload process.

"use client";

import { ZDriveClient } from "@ziqx/drive";
import { generateSignedUrl } from "@/actions/drive";

// ... inside your component

const handleUpload = async (options: any) => {
  const { file, onSuccess, onError } = options;
  const client = new ZDriveClient();

  try {
    // 1. Get signed URL from the server action
    const signedUrl = await generateSignedUrl(file.name);
    if (!signedUrl) throw new Error("Failed to get signed URL");

    // 2. Upload to Ziqx Drive directly from the browser
    const uploadRes = await client.uploadFile(signedUrl, file);

    if (!uploadRes.success || !uploadRes.filename) {
      throw new Error("Upload to ZDrive failed");
    }

    // 3. Handle success
    onSuccess(uploadRes.filename);
  } catch (err) {
    console.error("Upload Error:", err);
    onError(new Error("Upload failed"));
  }
};

Best Practices for AI Agents

  1. Always use Environment Variables: Never hardcode driveKey or driveSecret. Ensure they are stored in .env and accessed via process.env or a config constants file.
  2. Server vs Client separation: Remind the developer that ZDrive is for server-side (Node.js/Server Actions/API Routes) and ZDriveClient is for client-side (Browser). ZDriveClient uses browser-native FormData and fetch.
  3. File Naming: When generating a signed URL, ensure the filename passed to generatePutUrl matches or is appropriate for the file being uploaded.
  4. Error Handling: Always check for signed.success on the server and uploadRes.success on the client.
  5. Image Optimization: If the user is uploading images, suggest using client.resizeImage(file, 1024, 0.8) before calling uploadFile to save bandwidth and storage.
  6. Folder Organization: Encourage using the folder parameter to organize files (e.g., users/123/avatars) for better storage management.

Examples

Simple Client-side Upload Logic

const signedUrl = await generateSignedUrl(file.name);
if (!signedUrl) throw new Error("Failed to get signed URL");

// Upload to Object Storage
const client = new ZDriveClient();
const uploadRes = await client.uploadFile(signedUrl, file);

if (!uploadRes.success || !uploadRes.filename)
  throw new Error("Upload to ZDrive failed");

console.log("Uploaded filename:", uploadRes.filename);

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36%
按下载量换算32

Claude

29.47%
按下载量换算26

Cursor

18.04%
按下载量换算16

Gemini CLI

9.91%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills