360 Secure SkillHub
360 安全技能中心

supabase-win

使用项目 ID 与 anon key 调用 Supabase REST API 只读查询云数据库:从本地 .env 读取凭据,按表名执行 SELECT 查询,支持列选择、等值过滤与排序,返回 JSON(含 rows、row_count、truncated),限制最多 200 行、超时 30 秒,仅支持读取。

don2ccc
don2ccc
热度 25.09
最近更新 2026-05-11 17:28:38
分类:数据依赖:代码执行 / 第三方 API / 读写文件应用场景:数据处理 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add supabase-win
Metadata
name
supabase-query
description
Query Supabase cloud database via REST API using project ID and anon key. Use when the user needs to query their Supabase database, inspect table schemas, or retrieve data. Only supports read operations for security.
license
MIT
compatibility
Requires Python 3.x and Windows with PowerShell or CMD. No database drivers needed.
metadata
{"author":"user","version":"2.0"}

Supabase Query Skill

This skill allows AI agents to query Supabase cloud database via REST API using only project ID and anon key.

Security Features

  • Cloud-native: Uses Supabase REST API, no direct database connection
  • Read-only operations: Only SELECT-style queries via HTTP GET
  • Row limit: Maximum 200 rows returned per query
  • Timeout protection: 30-second request timeout
  • Local config: Credentials stored in local .env file (not in version control)

Prerequisites

  1. Python 3.x installed
  2. Supabase project with API access enabled

Setup

  1. Copy references/.env.example to references/.env
  2. Fill in your Supabase credentials in references/.env:
    • SUPABASE_PROJECT_ID: Your Supabase project ID (from project URL)
    • SUPABASE_ANON_KEY: Your anon/public API key (from Settings → API)

Usage

Run the query script from the skill directory:

python scripts/query.py "users" --select "*" --limit 10

Or on Windows:

scripts\query.bat users --select "*" --limit 10

Output Format

The script returns JSON:

{
  "success": true,
  "table": "users",
  "rows": [...],
  "row_count": 10,
  "truncated": false
}

Error response:

{
  "success": false,
  "error": "Error message here"
}

Examples

Query all columns

python scripts/query.py "users" --select "*" --limit 20

Query specific columns with filter

python scripts/query.py "users" --select "id,name,email" --eq "status:active" --limit 10

Query with ordering

python scripts/query.py "posts" --select "title,created_at" --order "created_at.desc" --limit 5

Troubleshooting

  • "Config file not found": Create references/.env from the example file
  • "Connection failed": Check your project ID and anon key
  • "Table not found": Verify the table name and RLS policies
  • "Permission denied": Check if anon key has access to the table (RLS settings)