database-operation
What it does
It lets the AI query and maintain the MoviePilot database through a bundled helper, without putting passwords in the chat. It is for MoviePilot admins who need data checks or cleanup.
When to use it
- ✓When you want counts or statistics from the MoviePilot database.
- ✓When a stuck record needs inspecting or a specific cleanup needs doing.
- ✓When you want the AI to check table contents before any change is made.
Skill link
https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you count how many records are in the MoviePilot database and list the tables?”
5 new skills a week. 1 minute to read.
How it works
The AI runs a bundled helper script that reads MoviePilot's own settings, connects to the database and returns the results.
Technical content (original SKILL.md)
Original text by the author, straight from 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
FAQ
Does it need my database password?
No. The helper reads MoviePilot's local settings itself, so passwords do not need to be in the prompt.
Which databases does it support?
It connects to SQLite or PostgreSQL, depending on how MoviePilot is set up.
Should I use it for normal tasks?
No. The skill advises using safer MoviePilot tools first and direct database access only when they cannot do the job.
Details
Original description by the author
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
Popularity
- GitHub stars
- 12k
- Ranking position
- #11481
- License
- GPL-3.0
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
anysearch
12kHelps your agent search the web in real time, query specialized sources such as finance or academic data and read full web pages.
browser-use
12kHelps your agent open web pages, read them, click buttons, fill in forms and take screenshots to check the results.
command-dispatch
12kHelps your agent find and run MoviePilot system or plugin commands from a request, after checking which commands exist.
create-moviepilot-plugin
12kHelps your agent create or fix a MoviePilot plugin, using the right file layout and setup for the MoviePilot version.
Similar skills
discrawl
394kLets your agent search and summarize a saved local archive of Discord messages, check how fresh it is, and read direct messages.
clickhouse-io
280kHelps your agent optimize queries and schemas in ClickHouse databases. It applies best practices for high-performance analytical workloads. Use when analytical queries are too slow.
scientific-db-pubmed-database
280kHelps your agent search for scientific articles in the biomedical field. It's useful for research needing specific medical information.