database-operation
Was er macht
Dieser Skill lässt die KI die MoviePilot-Datenbank über ein mitgeliefertes Hilfsprogramm abfragen und pflegen, ohne Passwörter in den Chat zu schreiben. Er richtet sich an MoviePilot-Admins, die Datenprüfungen oder Aufräumarbeiten brauchen.
Wann du ihn nutzt
- ✓Wenn du Zählungen oder Statistiken aus der MoviePilot-Datenbank willst.
- ✓Wenn ein hängender Datensatz geprüft oder eine bestimmte Bereinigung ausgeführt werden muss.
- ✓Wenn du willst, dass die KI Tabelleninhalte prüft, bevor eine Änderung vorgenommen wird.
Link zum Skill
https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Kannst du zählen, wie viele Datensätze in der MoviePilot-Datenbank sind, und die Tabellen auflisten?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Die KI führt ein mitgeliefertes Hilfsskript aus, das die lokalen Einstellungen von MoviePilot liest, sich mit der Datenbank verbindet und die Ergebnisse zurückgibt.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen
Braucht er mein Datenbankpasswort?
Nein. Das Hilfsprogramm liest die lokalen Einstellungen von MoviePilot selbst, daher müssen Passwörter nicht im Prompt stehen.
Welche Datenbanken unterstützt er?
Er verbindet sich mit SQLite oder PostgreSQL, je nachdem, wie MoviePilot eingerichtet ist.
Soll ich ihn für normale Aufgaben nutzen?
Nein. Der Skill rät, zuerst die sichereren MoviePilot-Werkzeuge zu nutzen und direkten Datenbankzugriff nur dann, wenn sie die Aufgabe nicht erledigen können.
Details
Originalbeschreibung des Autors
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
Beliebtheit
- GitHub-Sterne
- 12k
- Platz im Ranking
- #11481
- Lizenz
- GPL-3.0
- Aktualisiert
- 1.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
anysearch
12kHilft deinem Agenten, das Web in Echtzeit zu durchsuchen, spezialisierte Quellen wie Finanz- oder Forschungsdaten abzufragen und vollständige Webseiten zu lesen.
browser-use
12kHilft deinem Agenten, Webseiten zu öffnen und zu lesen, Schaltflächen zu klicken, Formulare auszufüllen und Screenshots zur Kontrolle der Ergebnisse zu machen.
command-dispatch
12kHilft deinem Agenten, MoviePilot-Befehle des Systems oder von Plugins aus einer Anfrage zu finden und auszuführen, nachdem geprüft wurde, welche Befehle existieren.
create-moviepilot-plugin
12kHilft deinem Agenten, ein MoviePilot-Plugin zu erstellen oder zu reparieren, mit dem richtigen Dateiaufbau und der Einrichtung für die jeweilige MoviePilot-Version.
Ähnliche Skills
discrawl
394kLässt deinen Agenten ein gespeichertes lokales Archiv von Discord-Nachrichten durchsuchen und zusammenfassen, dessen Aktualität prüfen und Direktnachrichten lesen.
clickhouse-io
280kHilft deinem Agenten, Abfragen und Schemas in ClickHouse zu optimieren. Nutzt Best Practices für schnelle Analyse-Workloads. Ideal, wenn Auswertungen zu langsam laufen.
scientific-db-pubmed-database
280kHilft deinem Agenten, wissenschaftliche Artikel im biomedizinischen Bereich zu suchen. Nützlich für Recherchen mit speziellen medizinischen Informationen.