Token导航 LogoToken导航

Agent Skill · 运维和基础设施

database-operation(数据库操作)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

database-operation 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有未通过项,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 1,204。

总安装 768周安装 32GitHub Stars 11,023下载 256核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/jxxghp/moviepilot --skill database-operation

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

针对 MoviePilot 系统的专用 SQL 查询执行辅助工具。支持 SQLite 与 PostgreSQL 两种连接方式自动识别处理。可直接运行 SELECT/UPDATE 等命令读取或修改应用数据。需依赖系统已配置的数据库连接凭证方可正常使用。

database-operation 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/database-operation

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jxxghp/moviepilot --skill database-operation;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

database-operation 怎么安装?

在终端执行 npx skills add https://github.com/jxxghp/moviepilot --skill database-operation。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

database-operation 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

database-operation 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/jxxghp/moviepilot --skill database-operation 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

database-operation 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

database-operation 用的人多吗?

公开数据是累计安装 768 次,近一周安装 32 次,下载 256 次,GitHub 11,023 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

database-operation 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 来源仓库有 11,023 星,维护活跃度相对可查。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
brainstorming

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
database-operation

数据库操作 · 本页

76811,023执行命令未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Database Query (数据库查询)

This skill guides you through executing SQL against the MoviePilot database. Both read and write operations are supported.

Prerequisites

You need the following tools:

  • execute_command - Execute shell commands to run database queries

Getting Database Connection Info

The system prompt <system_info> section already contains all the database connection details you need:

  • 数据库类型 — sqlite or postgresql
  • 数据库 — Full connection info:

- For SQLite: the database file path, e.g. SQLite (/config/db/moviepilot.db) - For PostgreSQL: the connection string, e.g. PostgreSQL (user:password@host:port/database)

Do NOT run any detection commands. Extract the database type and connection details directly from <system_info>.

Executing Queries

SQLite Mode

Extract the database file path from <system_info> (the path inside the parentheses after SQLite).

Use execute_command to run queries:

sqlite3 -header -column <DB_PATH> "YOUR SQL QUERY HERE;"

For JSON-formatted output (easier to parse):

sqlite3 -json <DB_PATH> "YOUR SQL QUERY HERE;"

List all tables:

sqlite3 -header -column <DB_PATH> "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"

View table schema:

sqlite3 <DB_PATH> ".schema tablename"

PostgreSQL Mode

Extract the connection parameters from <system_info> (parse user:password@host:port/database from the parentheses after PostgreSQL).

Use execute_command to run queries via psql:

PGPASSWORD=<password> psql -h <host> -p <port> -U <user> -d <database> -c "YOUR SQL QUERY HERE;"

List all tables:

PGPASSWORD=<password> psql -h <host> -p <port> -U <user> -d <database> -c "SELECT tablename FROM pg_tables WHERE schemaname='public' ORDER BY tablename;"

View table schema:

PGPASSWORD=<password> psql -h <host> -p <port> -U <user> -d <database> -c "\d tablename"

Interpret Results

After executing the query, analyze the results and present them in a clear, user-friendly format. Use aggregation, sorting, and filtering as needed.

Database Schema Reference

MoviePilot uses the following core tables:

downloadhistory (下载历史)

Key columns: id, path, type, title, year, tmdbid, imdbid, doubanid, seasons, episodes, downloader, download_hash, torrent_name, torrent_site, userid, username, date, media_category

downloadfiles (下载文件)

Key columns: id, downloader, download_hash, fullpath, savepath, filepath, torrentname, state

transferhistory (整理历史)

Key columns: id, src, dest, mode, type, category, title, year, tmdbid, seasons, episodes, download_hash, status (boolean: true=success, false=failed), errmsg, date

subscribe (订阅)

Key columns: id, name, year, type, tmdbid, doubanid, season, total_episode, start_episode, lack_episode, state ('N'=new, 'R'=running, 'S'=paused), filter, include, exclude, quality, resolution, sites, best_version, date, username

subscribehistory (订阅历史)

Key columns: id, name, year, type, tmdbid, doubanid, season, total_episode, start_episode, date, username

user (用户)

Key columns: id, name, email, is_active, is_superuser, permissions, settings

site (站点)

Key columns: id, name, domain, url, pri (priority), cookie, proxy, is_active, downloader, limit_interval, limit_count

siteuserdata (站点用户数据)

Key columns: id, domain, name, username, user_level, bonus, upload, download, ratio, seeding, leeching, seeding_size, updated_day

sitestatistic (站点统计)

Key columns: id, domain, success, fail, seconds, lst_state, lst_mod_date

mediaserveritem (媒体库条目)

Key columns: id, server, library, item_id, item_type, title, original_title, year, tmdbid, imdbid, tvdbid, path

systemconfig (系统配置)

Key columns: id, key, value (JSON)

userconfig (用户配置)

Key columns: id, username, key, value (JSON)

plugindata (插件数据)

Key columns: id, plugin_id, key, value (JSON)

message (消息)

Key columns: id, channel, source, mtype, title, text, image, link, userid, reg_time

workflow (工作流)

Key columns: id, name, description, timer, trigger_type, event_type, state ('W'=waiting, 'R'=running), run_count, actions, flows, last_time

passkey (通行密钥)

Key columns: id, user_id, credential_id, public_key, name, created_at, last_used_at, is_active

siteicon (站点图标)

Key columns: id, name, domain, url, base64

Common Query Examples

Count total downloads

SELECT COUNT(*) AS total FROM downloadhistory;

Recent download history

SELECT title, year, type, torrent_site, date FROM downloadhistory ORDER BY id DESC LIMIT 10;

Failed transfers

SELECT id, title, src, errmsg, date FROM transferhistory WHERE status = 0 ORDER BY id DESC LIMIT 10;

Active subscriptions

SELECT name, year, type, season, state, lack_episode FROM subscribe WHERE state = 'R';

Site upload/download statistics

SELECT name, domain, upload, download, ratio, bonus, seeding, user_level FROM siteuserdata ORDER BY upload DESC;

Media library statistics

SELECT server, library, COUNT(*) AS count FROM mediaserveritem GROUP BY server, library;

Site access success rate

SELECT domain, success, fail, ROUND(success * 100.0 / (success + fail), 1) AS success_rate FROM sitestatistic WHERE success + fail > 0 ORDER BY success_rate DESC;

Plugin data inspection

SELECT plugin_id, key FROM plugindata ORDER BY plugin_id, key;

Delete old download history (write operation)

DELETE FROM downloadhistory WHERE date < '2024-01-01';

Update subscription state (write operation)

UPDATE subscribe SET state = 'S' WHERE id = 123;

Clean up failed transfer records (write operation)

DELETE FROM transferhistory WHERE status = 0 AND date < '2024-06-01';

Safety Rules

  1. Confirm before writing — For any INSERT, UPDATE, DELETE, DROP, ALTER, or TRUNCATE operation, always describe what the statement will do and ask the user to confirm before executing. For SELECT queries, execute directly without confirmation
  2. Back up before destructive operations — Before executing DELETE, DROP, or TRUNCATE on important tables, suggest the user back up the data first (e.g., export with .dump for SQLite or pg_dump for PostgreSQL)
  3. Use WHERE clauses — Never run UPDATE or DELETE without a WHERE clause unless the user explicitly intends to affect all rows
  4. Use LIMIT for queries — When querying large tables with SELECT, add LIMIT to prevent excessive output
  5. Sensitive data — The site table contains cookie, apikey, and token fields. NEVER display these values to the user. Exclude them from SELECT or replace with '***'
  6. Password data — The user table contains hashed_password and otp_secret fields. NEVER display these values
  7. Output limits — If the query results are very long, summarize or truncate them

SQL Dialect Differences

When writing queries, be aware of differences between SQLite and PostgreSQL:

FeatureSQLitePostgreSQL
Boolean values0 / 1false / true
String concat`\\``\\ or CONCAT()`
Current timedatetime('now')NOW()
LIMIT syntaxLIMIT nLIMIT n
JSON accessjson_extract(col, '$.key')col->>'key'
Case sensitivityCase-insensitive by defaultCase-sensitive
LIKECase-insensitiveUse ILIKE for case-insensitive

Troubleshooting

  • sqlite3 not found: The sqlite3 CLI should be pre-installed in the MoviePilot Docker container. If missing, you can try using Python: python3 -c "import sqlite3;..."
  • psql not found: For PostgreSQL, if psql is not available, use Python: python3 -c "import psycopg2;..."
  • Permission denied: Database queries require admin privileges
  • Table not found: Use the "list all tables" query first to verify table names

平台分布

Codex

35.57%
按下载量换算91

Claude

29.97%
按下载量换算77

Cursor

16.37%
按下载量换算42

Gemini CLI

8.98%
按下载量换算23

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/jxxghp/moviepilot --skill database-operation 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills