본문으로 건너뛰기
Skillpedia
데이터베이스12k · #11481

database-operation

하는 일

번들된 도우미를 통해 AI가 MoviePilot 데이터베이스를 조회하고 관리하게 하며, 대화에 비밀번호를 넣지 않게 합니다. 데이터 확인이나 정리가 필요한 MoviePilot 관리자를 위한 스킬입니다.

사용하는 경우

  • ✓MoviePilot 데이터베이스의 개수나 통계가 필요할 때.
  • ✓멈춘 기록을 살펴보거나 특정 정리 작업이 필요할 때.
  • ✓변경을 하기 전에 AI가 테이블 내용을 확인하기를 원할 때.

스킬 링크

https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 Settings variables are queried and updated by moviepilot-api operations config.system.get / config.system.update; updates perform type conversion and persist to app.env.
  • SystemConfigKey values are stored in the database systemconfig table, 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

  1. Prefer existing MoviePilot tools or APIs for normal product workflows.
  2. Use this skill for direct database inspection only when no existing tool covers the request.
  3. For unknown schema, run tables first, then schema <table>.
  4. For SELECT queries, 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬