Skip to content
Back to skills

Surgepix Upload

ASecurity

Upload local files to SurgePix cloud storage and return a public HTTPS URL. Use when the user says "upload", "get a URL", "上传文件", "传到CDN", needs a remote-accessible URL for an API call, or wants to convert a local file path into a public link.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 13, 2026
ai-agentsshellbashnodeapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 13, 2026

npx -y skills add SurgePix/agent-skills --skill surgepix-upload --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Surgepix Upload?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Surgepix Upload
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/surgepix-surgepix-upload/badge)](https://www.skillsdirectory.com/skills/surgepix-surgepix-upload)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: surgepix-upload
description: Upload local files to SurgePix cloud storage and return a public HTTPS URL. Use when the user says "upload", "get a URL", "上传文件", "传到CDN", needs a remote-accessible URL for an API call, or wants to convert a local file path into a public link.
---

# SurgePix Upload

Upload a local file to SurgePix storage and get back a public CDN URL.

## Language consistency

This skill does not generate on-image text. Reply to the user in the **same language they used** in their request.

## When to use

- User says "upload this file", "get a URL for this image", "上传", "传到线上"
- Before calling any web API that needs a remote URL instead of a local path

## Prerequisites

- Node.js >= 18
- `SURGEPIX_API_KEY` configured (see Step 0)

## Workflow

### Step 0: Check environment (required)

Before running upload, verify config:

```bash
node "<skills-dir>/surgepix-setup/scripts/check_env.mjs"
```

- **Exit 0** → proceed to Step 1
- **Exit 1** → follow **surgepix-setup** skill to configure `.env`, then retry

Do NOT check `$SURGEPIX_API_KEY` in shell — the script loads `.env` automatically.

### Step 1: Identify the file

- Get the absolute path to the local file
- Confirm the file exists

### Step 2: Run upload

```bash
node "<skills-dir>/surgepix-upload/scripts/file_upload.mjs" "<absolute-file-path>"
```

### Step 3: Parse output

**Success** (stdout):

```json
{"ok":true,"url":"<PUBLIC_URL>","filename":"photo.png","size":12345,"contentType":"image/png","existing":false}
```

**Failure** (stderr, non-zero exit):

```json
{"ok":false,"error":"<ERROR>"}
```

If error is "API_KEY not found" → run surgepix-setup first.

### Step 4: Use the URL

- Show the `url` to the user
- Pass it to any API that needs a remote file URL

## Rules

- ALWAYS run check_env before first use in a session
- NEVER pass local paths to web APIs — upload first, use the returned URL
- NEVER invent or guess a URL
- NEVER echo auth tokens

Files in this skill

  • SKILL.md1.9 KB
  • scripts/env.mjs4.7 KB
  • scripts/file_upload.mjs7.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.