database-operation
Что он делает
Этот скилл позволяет ИИ запрашивать и поддерживать базу данных MoviePilot через встроенный помощник, не передавая пароли в чат. Он нужен администраторам MoviePilot, которым требуется проверка данных или очистка.
Когда использовать
- ✓Когда нужны подсчёты или статистика по базе данных MoviePilot.
- ✓Когда нужно проверить зависшую запись или выполнить конкретную очистку.
- ✓Когда хотите, чтобы ИИ проверил содержимое таблиц до любых изменений.
Ссылка на скилл
https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Посчитай, сколько записей в базе данных MoviePilot, и перечисли таблицы.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ запускает встроенный вспомогательный скрипт, который читает собственные настройки MoviePilot, подключается к базе и возвращает результаты.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Database Operation
All script paths are relative to this skill file.
Use scripts/mp-db.py for all database access. Do not extract database passwords, API tokens, or full PostgreSQL DSNs from the prompt. The script reads MoviePilot local settings and connects to SQLite or PostgreSQL internally.
Scope And Boundaries
This skill is the direct SQL boundary. It is implemented as a Python script and is appropriate when the agent must inspect records, run data statistics, repair stuck state, or perform an explicitly requested database update.
Run the bundled copy from the MoviePilot program directory with its project runtime, for example:
cd <MOVIEPILOT_ROOT>
python skills/database-operation/scripts/mp-db.py tables
The Agent command environment routes python to the project-specific moviepilot-python
entry when available and falls back to the project or Docker VENV_PATH Python otherwise.
The runtime sets MOVIEPILOT_ROOT for copied skills. If you run a copied
script directly from <CONFIG_PATH>/agent/skills/, set that variable to the
program directory first; otherwise the helper reports how to relocate it.
Use the project runtime instead of a system python3.
Prefer safer product surfaces first:
| Request | Preferred skill |
|---|---|
| Normal MoviePilot product operation | moviepilot-api structured operations |
| Operation outside the structured API catalog | A more specific Skill or explicit unsupported result |
| Slash commands or plugin/system command dispatch | command-dispatch |
| Manual file organization | organize-files |
| Retry failed transfer history records | transfer-failed-retry |
Use this skill as the final fallback for data access or mutation. It may run
SELECT, INSERT, UPDATE, DELETE, and schema-changing statements through
the bundled script, but broad or destructive writes still require explicit user
authorization.
System settings have two managed sources and should not normally be edited here:
- Runtime
Settingsvariables are queried and updated bymoviepilot-apioperationsconfig.system.get/config.system.update; updates perform type conversion and persist toapp.env. SystemConfigKeyvalues are stored in the databasesystemconfigtable, but the same API operations must be preferred because they enforce registered keys, plugin mutation admission, value normalization, secret redaction, and configuration-change events.
Use direct SQL against systemconfig only for an explicitly authorized repair
when the managed API cannot complete the operation. The script blocks any
statement that references systemconfig until you pass --show-secrets, so
inspect the exact row first, avoid broad writes, and verify the managed API can
read the repaired value.
Commands
List tables:
python scripts/mp-db.py tables
Show table schema:
python scripts/mp-db.py schema downloadhistory
Run a read query:
python scripts/mp-db.py query "SELECT COUNT(*) AS total FROM downloadhistory"
Read SQL from stdin or a file:
python scripts/mp-db.py query --file /path/to/query.sql
Run a write statement:
python scripts/mp-db.py write "UPDATE subscribe SET state = 'S' WHERE id = 123"
query --write is also supported for compatibility, but prefer the write subcommand for INSERT, UPDATE, DELETE, and schema changes.
SQLite also checks the actual table accesses while executing each statement, including single-quoted table names and reads through views. The temporary authorizer is removed when that statement finishes. PostgreSQL retains the identifier check described below.
Statements that reference systemconfig are rejected until you add
--show-secrets, in read and write mode alike:
python scripts/mp-db.py query "SELECT key, value FROM systemconfig WHERE key = 'TMDB_API_KEY'" --show-secrets
The gate is per table, not per column, so even a count or key listing over
systemconfig needs the flag. Read normal settings through
moviepilot-api config.system.get instead, which redacts secrets for you,
and pass the flag only for an explicitly authorized repair.
Workflow
- Prefer existing MoviePilot tools or APIs for normal product workflows.
- Use this skill for direct database inspection only when no existing tool covers the request.
- For unknown schema, run
tablesfirst, thenschema <table>. - For
SELECTqueries, execute directly with a narrow project
Частые вопросы
Нужен ли пароль от базы?
Нет. Помощник сам читает локальные настройки MoviePilot, поэтому пароли не нужно вставлять в запрос.
Какие базы он поддерживает?
Он подключается к SQLite или PostgreSQL, в зависимости от настройки MoviePilot.
Стоит ли использовать его для обычных задач?
Нет. Скилл советует сначала использовать более безопасные инструменты MoviePilot, а прямой доступ к базе — только когда они не справляются.
Подробности
Оригинальное описание автора
Use this skill when you need to inspect, query, maintain, or carefully modify the MoviePilot database. This skill uses the bundled scripts/mp-db.py helper, which reads MoviePilot local settings itself and never requires database passwords or full PostgreSQL DSNs in the agent prompt. Applicable scenarios include data statistics, counts, aggregations, inspecting or fixing records, cleanup requests, and questions like "how many downloads", "show site stats", "delete old records", or "why is this subscription stuck".
repo: jxxghp/MoviePilot
Популярность
- Звёзды на GitHub
- 12k
- Место в рейтинге
- #11481
- Лицензия
- GPL-3.0
- Обновлён
- 01.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
anysearch
12kПомогает агенту искать в интернете в реальном времени, обращаться к специализированным источникам, например финансовым или научным данным, и читать полные веб-страницы.
browser-use
12kПомогает агенту открывать веб-страницы, читать их, нажимать кнопки, заполнять формы и делать снимки экрана для проверки результатов.
command-dispatch
12kПомогает агенту находить и запускать системные команды или команды плагинов MoviePilot по запросу, после проверки, какие команды существуют.
create-moviepilot-plugin
12kПомогает агенту создать или исправить плагин MoviePilot, используя правильную структуру файлов и настройку под конкретную версию MoviePilot.
Похожие скиллы
discrawl
394kПозволяет агенту искать и кратко пересказывать сохраненный локальный архив сообщений Discord, проверять его свежесть и читать личные сообщения.
clickhouse-io
280kПомогает агенту оптимизировать запросы и схемы в ClickHouse по лучшим практикам аналитики. Используйте, когда аналитические запросы слишком медленные.
scientific-db-pubmed-database
280kПомогает агенту искать научные статьи в биомедицине. Полезен для исследований, где нужна точная медицинская информация.