mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-08 08:57:09 +08:00
Refine agent skill boundaries and secret handling
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: moviepilot-update
|
||||
version: 2
|
||||
version: 3
|
||||
description: Use this skill when you need to check MoviePilot versions, restart MoviePilot, or trigger a MoviePilot upgrade. Prefer the built-in system APIs instead of docker commands or manual file replacement. If auto-update on restart is already enabled, just restart. If it is disabled, call the upgrade API so MoviePilot performs a one-shot upgrade and restart.
|
||||
---
|
||||
|
||||
@@ -12,13 +12,7 @@ Use this skill for MoviePilot restart and upgrade operations.
|
||||
|
||||
## Setup
|
||||
|
||||
This skill reuses the `moviepilot-api` client configuration.
|
||||
|
||||
Configure host and API key once:
|
||||
|
||||
```bash
|
||||
python ../moviepilot-api/scripts/mp-api.py configure --host http://localhost:3000 --apikey <API_TOKEN>
|
||||
```
|
||||
This skill reuses the `moviepilot-api` client. When running inside the MoviePilot project, the API client imports `app.core.config.settings` and reads the local host, port, and API token directly. Do not ask the user for `API_TOKEN`.
|
||||
|
||||
## Preferred Commands
|
||||
|
||||
|
||||
@@ -12,12 +12,14 @@ API_SCRIPT = SCRIPT_DIR.parents[1] / "moviepilot-api" / "scripts" / "mp-api.py"
|
||||
|
||||
|
||||
def run_api_call(args: list[str]) -> int:
|
||||
"""调用 MoviePilot REST API 客户端执行更新相关接口。"""
|
||||
command = [sys.executable, str(API_SCRIPT), *args]
|
||||
return_code = __import__("subprocess").run(command, check=False).returncode
|
||||
return return_code
|
||||
|
||||
|
||||
def print_usage() -> None:
|
||||
"""输出更新脚本的命令行用法。"""
|
||||
print(
|
||||
"Usage:\n"
|
||||
f" python {Path(sys.argv[0]).name} versions\n"
|
||||
@@ -27,6 +29,7 @@ def print_usage() -> None:
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""执行 MoviePilot 更新脚本入口。"""
|
||||
argv = sys.argv[1:]
|
||||
if not argv or argv[0] in {"-h", "--help", "help"}:
|
||||
print_usage()
|
||||
|
||||
Reference in New Issue
Block a user