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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
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에이전트가 웹을 실시간으로 검색하고, 금융이나 학술 데이터 같은 전문 자료를 조회하며, 웹 페이지 전체를 읽도록 돕습니다.
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생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.