跳到主要内容
知仓学习社ZHICANG

calibredb

Manage and query Calibre libraries with the calibredb CLI (local paths or Calibre Content server URLs). Use when listing books, searching/filtering …

执行命令读凭据严重 0 · 高危 2hashgraph-online/awesome-codex-plugins

它会碰到什么

扫了多少4 个文本文件,10 KB
它会碰到什么执行命令读凭据
命中总数2 处
命中统计严重 0 · 高 2 · 中 0 · 低 0
逐条看命中(2 条严重或高危)
  • scripts/list_books_json.py:42exec-spawn
    result = subprocess.run(cmd, capture_output=True, check=True, text=True)
  • scripts/list_books_json.py:60cred-envread
    default=os.environ.get("CALIBRE_LIBRARY"),

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

CalibreDB

Use this skill for all command-line operations on Calibre libraries.

Library path

  • Calibre library locations are user-specific. Identify the target library path

or Content server URL before running commands.

  • Prefer explicit path in every command: --with-library "$CALIBRE_LIBRARY".
  • If the user has not provided a library path, ask for it or inspect the local

environment for an existing Calibre library before proceeding.

  • For machine-readable outputs, use --for-machine or JSON-capable subcommands.

Safety model

Start with read-only operations, then escalate only when needed.

Read-only (safe by default)

  • list
  • search
  • show_metadata
  • custom_columns
  • list_categories
  • check_library
  • fts_search
  • fts_index status

Mutating (confirm intent for destructive/irreversible)

  • Usually safe with clear intent: add, set_metadata, set_custom, add_format, embed_metadata, backup_metadata
  • Confirm before destructive actions: remove, remove_format, remove_custom_column, restore_database, fts_index reindex on full library

Core workflow

  1. Identify target library and set --with-library.
  2. Discover relevant book IDs with search (or list --search).
  3. Inspect records with show_metadata or list --for-machine.
  4. Apply minimal required mutations.
  5. Validate with follow-up list/search/show_metadata.

Quick command patterns

1) List books

export CALIBRE_LIBRARY="/path/to/Calibre Library"
calibredb list --with-library "$CALIBRE_LIBRARY" --fields id,title,authors,formats --limit 20

Machine output:

calibredb list --with-library "$CALIBRE_LIBRARY" --fields id,title,authors,tags,formats --for-machine

2) Search and get IDs

calibredb search --with-library "$CALIBRE_LIBRARY" "title:python"

Use IDs in follow-up commands.

3) Show metadata

calibredb show_metadata --with-library "$CALIBRE_LIBRARY" 123

As OPF:

calibredb show_metadata --with-library "$CALIBRE_LIBRARY" --as-opf 123

4) Update metadata fields

calibredb set_metadata --with-library "$CALIBRE_LIBRARY" 123 \
  --field title:"Example Book" \
  --field tags:"python,reference"

5) Add/export books

calibredb add --with-library "$CALIBRE_LIBRARY" "/path/to/book.epub"
calibredb export --with-library "$CALIBRE_LIBRARY" 123 --to-dir "/tmp/export"

6) Library health check

calibredb check_library --with-library "$CALIBRE_LIBRARY"

Content server usage

To target a running Calibre Content server:

calibredb list --with-library "http://hostname:8080/#library_id" --username <user> --password <pass>

From docs: use special #- library id to list server libraries.

Security note: a literal --password <pass> value is passed as a process

argument and may be visible to other users on shared machines via

process-listing tools. Prefer --password '<stdin>' with the password piped

from a password manager, or --password '<f:/path/to/file>' with a 0600

credential file stored outside the repository. Prefer local or trusted hosts

for authenticated Content server commands, and redact credentials from shell

history, logs, and task transcripts.

Reference files

  • Command matrix + options: references/command-matrix.md
  • Safe operational playbooks: references/safe-workflows.md

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。