database-operation
できること
AIが、付属の補助ツールを通じてMoviePilotのデータベースを照会し、保守できるようにします。チャットにパスワードを入れずに済みます。データの確認や整理が必要なMoviePilotの管理者向けです。
使う場面
- ✓MoviePilotのデータベースの件数や統計が欲しいとき。
- ✓詰まった記録を調べたい、または特定の整理が必要なとき。
- ✓何かを変更する前に、テーブルの内容を確認させたいとき。
スキルのリンク
https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“MoviePilotのデータベースに記録が何件あるかを数えて、テーブルの一覧を出してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは付属の補助スクリプトを実行します。それが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のローカルの設定を自分で読むため、パスワードを入力する必要はありません。
どのデータベースに対応していますか?
MoviePilotの設定に応じて、SQLiteまたはPostgreSQLに接続します。
通常の作業にも使うべきですか?
いいえ。このスキルは、まずより安全な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
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
anysearch
12kエージェントが、Webをリアルタイムで検索し、金融や学術データなどの専門の情報源に問い合わせ、Webページの全文を読めるよう支援します。
browser-use
12kエージェントが、Webページを開いて読み、ボタンをクリックし、フォームに入力し、スクリーンショットを撮って結果を確認できるよう支援します。
command-dispatch
12kエージェントが、リクエストからMoviePilotのシステムやプラグインのコマンドを見つけて実行できるよう支援します。その前に、どのコマンドがあるかを確認します。
create-moviepilot-plugin
12kエージェントが、MoviePilotのバージョンに合ったファイル構成と設定を使い、MoviePilotのプラグインを作成または修正できるよう支援します。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。