javdb-cli

module
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT

README

javdb-cli

JavDB CLI · Public Go SDK · Agent skill

English · 简体中文

Quality gate Platform smoke Release Go License Views

Install · Quick start · Interfaces · Documentation · Contributing

javdb-cli is an independent, unofficial command-line client and Go SDK for the JavDB App JSON API. It gives people, coding agents, and Go applications one consistent capability surface for search, catalog navigation, movie details, review pages, selected media downloads, magnets, rankings, and authenticated user lists. It is not a website scraper, does not include MCP, and is not affiliated with, endorsed by, or related to JavDB or its operators. Use it only in accordance with JavDB's terms and the laws that apply to you.

Why javdb-cli?

  • CLI and public Go SDK — the CLI and importable javdb package cover search, detail, review pages, selected thumbnail/preview downloads, tags, browsing, entity filmographies, magnets, rankings, TOP250, collections, authenticated watch/want data, and reverse image search with strict number linking (javdb search IMAGE, javdb cache reverse-search).
  • Composable pipelines — most commands accept non-TTY stdin batches; explicit --ndjson emits javdb.pipeline/v1 envelopes so command output can feed the next command (javdb search --ndjson | javdb detail).
  • API client, not a scraper — commands use the App JSON API with explicit host and proxy selection; failures remain visible rather than becoming fabricated empty results.
  • Useful agent navigation — JSON output, stable graph IDs from detail, and an included operator skill support safe, multi-step automation.
  • Local multi-account credentials — username/password/token data stays in ~/.javdb-cli/auth.json with mode 0600 on POSIX platforms; normal command output never prints the JWT.
  • Deliberate state changes — watch/want marks, default-account changes, configuration writes, and tag-cache refreshes are explicit CLI operations.
  • Native release evidence — macOS, Linux, and Windows on amd64 and arm64 are built, packaged, extracted, and smoke-tested by CI.

Install

brew install FlanChanXwO/tap/javdb-cli

Upgrade later with:

brew update
brew upgrade javdb-cli

The Formula is updated after a verified release when tap deployment is enabled.

Go

Use an exact published tag:

go install github.com/FlanChanXwO/javdb-cli/cmd/javdb@v0.2.0
Release archive or source build

Download the archive for your platform from GitHub Releases, verify it against the accompanying checksums.txt, and place javdb (javdb.exe on Windows) in a directory on your PATH.

To build the checkout, install the Go version declared in go.mod and run:

sh scripts/build.sh
./build/javdb --version

The release contract covers macOS, Linux, and Windows on amd64 and arm64. See the development guide for reproducible target builds and archive contents.

Update

Published installations can check for a newer release and install it with:

javdb update --check
javdb update

update detects whether javdb is managed by Homebrew, go install, or a Release archive, then uses that matching channel. Archive updates fetch only the current OS/architecture asset, verify its SHA-256 against the same Release's checksums.txt, validate the downloaded binary's version, and then replace the executable. --check --json is the machine-readable, no-write form; --prerelease includes prerelease tags. A Homebrew installation supports stable releases only. The existing --proxy URL setting also applies to Release checks; update resolves that proxy independently and ignores JavDB host settings.

Install with a coding agent

Copy this prompt into Codex, Claude Code, Cursor, or another local coding agent with terminal access:

Install the latest stable javdb-cli from https://github.com/FlanChanXwO/javdb-cli for this machine. Detect the operating system and architecture, download only official GitHub Release assets, require the matching published SHA-256 from checksums.txt before installing, ask before creating or changing any PATH directory, never read or output ~/.javdb-cli/auth.json or credentials, verify with javdb version --json, and report the installed version plus every changed file.

Also install the complete skills/javdb-cli/ directory from the same stable release tag into the agent skills directory that I confirm. Do not guess that skills path, do not use the main branch for the skill, and preserve all reference files.

60-second quick start

# Sign in interactively; the CLI never prints the JWT.
javdb auth login
javdb auth check --json

# Find a movie and inspect graph IDs for the next navigation step.
javdb search SSIS-589 --limit 5 --json
javdb detail SSIS-589 --json
javdb comments SSIS-589 --page 1 --limit 20 --json

# Browse a tag and request a filtered magnet list (works without login).
javdb browse --tag 巨乳 --main m --limit 20 --json
javdb magnets SSIS-589 --cnsub --hd --json

# Explicit local output paths; --preview-image downloads only the first preview.
javdb download SSIS-589 --thumbnail ./thumb.jpg --preview-image ./preview-0.jpg --preview-video ./preview.ts

Run javdb --help or read the complete command reference for all commands, flags, configuration keys, and authentication requirements.

Choose your interface

CLI

Use tabular output interactively and --json when a command exposes it and an agent or script needs stable fields:

javdb rankings movies --type fc2 --period week
javdb rankings movies --period week --json
javdb actor 山手梨愛 --main m --has-magnets --json
javdb lists search 巨乳 --zone all --json

Movie and playback rankings accept censored, uncensored, western, or fc2 as their zone selector; ranking periods use day, week, or month.

The global --proxy URL and --host auto|mirror|main|URL flags affect only that command. The default auto host reuses the cached route immediately when validation succeeds. Only a failed cache validation discovers the startup candidates, selects the fastest App API host, and rewrites ~/.javdb-cli/route.json; a fixed host skips route discovery entirely. Use javdb config get before relying on persisted settings.

Go SDK
package main

import (
	"context"
	"fmt"

	"github.com/FlanChanXwO/javdb-cli/sdk"
)

func main() {
	c, err := javdb.New(javdb.WithHost(javdb.HostMirror))
	if err != nil {
		panic(err)
	}

	res, err := c.Search(context.Background(), "SSIS-589", javdb.SearchOptions{Limit: 5})
	if err != nil {
		panic(err)
	}
	fmt.Println(len(res.Movies()))
}

Import github.com/FlanChanXwO/javdb-cli/sdk; it declares package javdb, so examples continue to use javdb. The SDK guide documents public models, client options, and caller responsibilities.

Agent skill

The repository ships skills/javdb-cli, a dedicated operator skill for coding agents. It defines credential handling, confirmation boundaries, command-scoped flags, JSON/error handling, and search-to-detail navigation. Load it only for explicit JavDB work, and verify each command's flags with javdb <command> --help.

Install the javdb-cli Skill from ClawHub

Agents using ClawHub can install the published javdb-cli Skill with clawhub install javdb-cli; pin the installed skill to the matching published release version, currently 0.5.2, rather than following an unversioned latest tag.

Authentication and credential safety

javdb auth login is the recommended setup. It keeps the username, password, and session token in the local multi-account store ~/.javdb-cli/auth.json (mode 0600 where POSIX permissions exist). Do not commit, print, paste, or upload that file, passwords, or JWTs.

javdb auth list
javdb auth use USER_ID
javdb auth check --json

javdb auth check verifies the default token without printing it. Token expiry is surfaced clearly by default. auto_relogin is opt-in and uses the saved password for one re-login attempt; enable it only when you accept that behavior:

javdb config set auto_relogin true

Magnet commands work anonymously and use the saved token when available. TOP250 and user-list commands need the default authenticated account. mark/unmark, account changes, and config set/unset modify server or local state and should be used deliberately. download writes selected media to explicit new local paths; it never replaces an existing file.

Documentation

Guide Use it for
CLI reference Commands, flags, authentication, configuration, and common workflows
Agent operator skill Safe agent routing, secrets, writes, discovery, and errors
Go SDK Public client, models, and options
Architecture (Simplified Chinese) Package boundaries and runtime flow
Development (Simplified Chinese) Toolchain, tests, platform builds, packaging, and releases
Documentation map Localized public contracts and maintainer guides
Contributing Local quality gates and contribution rules
Changelog Versioned bilingual release notes

Contributing

Bug reports, documentation fixes, tests, and focused features are welcome. Read CONTRIBUTING.md before opening a pull request; discuss large or compatibility-sensitive changes first.

License

MIT © FlanChanXwO

Directories

Path Synopsis
cmd
javdb command
internal
buildinfo
Package buildinfo exposes metadata embedded by the Go linker at build time.
Package buildinfo exposes metadata embedded by the Go linker at build time.
cli
Package cli assembles the Cobra root command and implements the CLI entrypoint.
Package cli assembles the Cobra root command and implements the CLI entrypoint.
cli/authstore
Package authstore 只负责默认认证文件的路径、目录与 store 打开。
Package authstore 只负责默认认证文件的路径、目录与 store 打开。
cli/client
Package client 统一配置解析、SDK client 创建与 required/optional 认证生命周期。
Package client 统一配置解析、SDK client 创建与 required/optional 认证生命周期。
cli/commands/actor
Package actor 提供实体影片列表命令。
Package actor 提供实体影片列表命令。
cli/commands/auth
Package auth 提供真实的 auth 命令组与交互式凭据输入。
Package auth 提供真实的 auth 命令组与交互式凭据输入。
cli/commands/browse
Package browse 提供按内容标签/年份/月份浏览影片命令。
Package browse 提供按内容标签/年份/月份浏览影片命令。
cli/commands/cache
Package cache 提供本机反搜缓存的运维命令。
Package cache 提供本机反搜缓存的运维命令。
cli/commands/code
Package code 提供实体影片列表命令。
Package code 提供实体影片列表命令。
cli/commands/collections
Package collections 提供用户收藏列表命令。
Package collections 提供用户收藏列表命令。
cli/commands/comments
Package comments 提供影片评论单页命令。
Package comments 提供影片评论单页命令。
cli/commands/detail
Package detail 提供影片详情与可选磁力输出命令。
Package detail 提供影片详情与可选磁力输出命令。
cli/commands/director
Package director 提供实体影片列表命令。
Package director 提供实体影片列表命令。
cli/commands/download
Package download 提供影片媒体下载命令。
Package download 提供影片媒体下载命令。
cli/commands/list
Package list 提供实体影片列表命令。
Package list 提供实体影片列表命令。
cli/commands/lists
Package lists 提供我的合集与公开合集命令组。
Package lists 提供我的合集与公开合集命令组。
cli/commands/magnets
Package magnets 提供影片磁力列表与最佳磁力选择命令。
Package magnets 提供影片磁力列表与最佳磁力选择命令。
cli/commands/maker
Package maker 提供实体影片列表命令。
Package maker 提供实体影片列表命令。
cli/commands/mark
Package mark 提供影片标记命令。
Package mark 提供影片标记命令。
cli/commands/rankings
Package rankings 提供影片/演员/播放排行命令组。
Package rankings 提供影片/演员/播放排行命令组。
cli/commands/recent
Package recent 提供最近浏览影片列表命令。
Package recent 提供最近浏览影片列表命令。
cli/commands/search
Package search 提供影片/实体搜索命令与以图搜番图片模式。
Package search 提供影片/实体搜索命令与以图搜番图片模式。
cli/commands/series
Package series 提供实体影片列表命令。
Package series 提供实体影片列表命令。
cli/commands/tags
Package tags 提供内容标签 taxonomy 命令。
Package tags 提供内容标签 taxonomy 命令。
cli/commands/top250
Package top250 提供 TOP250 排行命令。
Package top250 提供 TOP250 排行命令。
cli/commands/unmark
Package unmark 提供影片取消标记命令。
Package unmark 提供影片取消标记命令。
cli/commands/want
Package want 提供想看影片列表命令。
Package want 提供想看影片列表命令。
cli/commands/watched
Package watched 提供已看影片列表命令。
Package watched 提供已看影片列表命令。
cli/entity
Package entity 只保留六类实体命令共享的查询用例。
Package entity 只保留六类实体命令共享的查询用例。
cli/entity/entitycmd
Package entitycmd 提供六个实体命令的共享管道化实现。
Package entitycmd 提供六个实体命令的共享管道化实现。
cli/invocation
Package invocation 保存 CLI 根命令的调用期数据:persistent flags 目标与标准流。
Package invocation 保存 CLI 根命令的调用期数据:persistent flags 目标与标准流。
cli/pipeline
Package pipeline 实现 javdb.pipeline/v1 机器协议核心:typed envelope、 严格 NDJSON/文本解码、输入分类与输出模式。
Package pipeline 实现 javdb.pipeline/v1 机器协议核心:typed envelope、 严格 NDJSON/文本解码、输入分类与输出模式。
cli/result
Package result 提供 CLI 纯结果投影与过滤,按领域分文件(movie.go、magnet.go、named.go)。
Package result 提供 CLI 纯结果投影与过滤,按领域分文件(movie.go、magnet.go、named.go)。
common/jsonx
Package jsonx 提供纯 JSON 编解码 helper。
Package jsonx 提供纯 JSON 编解码 helper。
common/proxyutil
Package proxyutil 构造支持 CLI 全部既有代理 scheme 的标准库 HTTP transport:http/https 与 socks5/socks5h 由 net/http 原生支持,socks4 与 socks4a 由本包实现拨号握手。
Package proxyutil 构造支持 CLI 全部既有代理 scheme 的标准库 HTTP transport:http/https 与 socks5/socks5h 由 net/http 原生支持,socks4 与 socks4a 由本包实现拨号握手。
common/scalar
Package scalar 提供跨领域复用的基础标量转换。
Package scalar 提供跨领域复用的基础标量转换。
config/paths
Package paths 管理 javdb-cli 本机状态文件的路径。
Package paths 管理 javdb-cli 本机状态文件的路径。
config/settings
Package settings 管理 config.toml 的 schema 与优先级解析。
Package settings 管理 config.toml 的 schema 与优先级解析。
javdb/appapi
Package appapi 是签名 App API 的真实 Client 组合层。
Package appapi 是签名 App API 的真实 Client 组合层。
javdb/appapi/client
Package client 持有签名 App API 的 HTTP transport 与公共请求处理。
Package client 持有签名 App API 的 HTTP transport 与公共请求处理。
javdb/appapi/codec
Package codec 负责 App API 的 JSON、JWT、用户 ID 和响应数组解析。
Package codec 负责 App API 的 JSON、JWT、用户 ID 和响应数组解析。
javdb/appapi/endpoint/auth
Package auth 负责登录、启动信息和用户身份解析 endpoint。
Package auth 负责登录、启动信息和用户身份解析 endpoint。
javdb/appapi/endpoint/route
Package route 实现 JavDB App /startup 动态 API 域名的解密、候选提取与线路选择。
Package route 实现 JavDB App /startup 动态 API 域名的解密、候选提取与线路选择。
javdb/appapi/model
Package model 定义 JavDB App API 的稳定配置、响应和领域类型。
Package model 定义 JavDB App API 的稳定配置、响应和领域类型。
javdb/protocol/httpx
Package httpx wraps bogdanfinn/tls-client for Chrome-like TLS fingerprints.
Package httpx wraps bogdanfinn/tls-client for Chrome-like TLS fingerprints.
javdb/protocol/signature
Package signature implements the JavDB app jdsignature header.
Package signature implements the JavDB app jdsignature header.
reversesearch/cache
Package cache 实现反搜响应的文件缓存:key 为 source + 原图 SHA-256, 只保存规范化响应与写入时间(不保存图片、鉴权 header 或 JavDB 详情), 原子写入 0600,TTL 默认 30 天。
Package cache 实现反搜响应的文件缓存:key 为 source + 原图 SHA-256, 只保存规范化响应与写入时间(不保存图片、鉴权 header 或 JavDB 详情), 原子写入 0600,TTL 默认 30 天。
reversesearch/image
Package image 提供反搜图片的统一原始读取入口:本地路径、HTTP(S) URL 与 stdin 流。
Package image 提供反搜图片的统一原始读取入口:本地路径、HTTP(S) URL 与 stdin 流。
reversesearch/provider
Package provider 实现反搜 provider:内置 AVScan adapter 与声明式外部 HTTP adapter。
Package provider 实现反搜 provider:内置 AVScan adapter 与声明式外部 HTTP adapter。
storage/auth
Package auth 持久化 ~/.javdb-cli/auth.json 中的多账户认证资料。
Package auth 持久化 ~/.javdb-cli/auth.json 中的多账户认证资料。
storage/route
Package route 管理自动选线路由缓存(~/.javdb-cli/route.json)的原子读写。
Package route 管理自动选线路由缓存(~/.javdb-cli/route.json)的原子读写。
storage/tags
Package tags 持久化和解析 JavDB tag taxonomy cache。
Package tags 持久化和解析 JavDB tag taxonomy cache。
update/archive
Package archive verifies and installs platform release archives.
Package archive verifies and installs platform release archives.
update/manifest
Package manifest 定义 v1 签名发布清单协议:发布清单、签名文件、规范 JSON 编码、Ed25519 签名与验签,以及客户端内置的公钥环。
Package manifest 定义 v1 签名发布清单协议:发布清单、签名文件、规范 JSON 编码、Ed25519 签名与验签,以及客户端内置的公钥环。
update/model
Package model 保存更新流程跨领域共享的数据模型。
Package model 保存更新流程跨领域共享的数据模型。
update/process
Package process 管理更新流程中的命令执行、候选二进制校验和平台替换。
Package process 管理更新流程中的命令执行、候选二进制校验和平台替换。
update/release
Package release reads and compares published GitHub releases.
Package release reads and compares published GitHub releases.
update/source
Package source identifies the installation source before an update writes.
Package source identifies the installation source before an update writes.
scripts
changescope command
Command changescope classifies a Git diff for GitHub Actions CI routing.
Command changescope classifies a Git diff for GitHub Actions CI routing.
internal/releasenotes/audit
Package audit 负责读取 GitHub 元数据、校验 PR 声明并生成审计报告。
Package audit 负责读取 GitHub 元数据、校验 PR 声明并生成审计报告。
internal/releasenotes/document
Package document 负责 release-note 文档、来源链接和 PR 声明的解析校验。
Package document 负责 release-note 文档、来源链接和 PR 声明的解析校验。
internal/releasenotes/github
Package github 封装 release-note 流程使用的 GitHub REST 读写边界。
Package github 封装 release-note 流程使用的 GitHub REST 读写边界。
internal/releasenotes/history
Package history 负责显式同步历史 GitHub Release 正文。
Package history 负责显式同步历史 GitHub Release 正文。
internal/releasenotes/model
Package model 保存 release-note 流程跨领域传递的稳定数据模型。
Package model 保存 release-note 流程跨领域传递的稳定数据模型。
internal/releasenotes/prepare
Package prepare 将已审阅的计划渲染为按版本归档的双语变更说明文件。
Package prepare 将已审阅的计划渲染为按版本归档的双语变更说明文件。
releasenotes command
Command releasenotes audits and validates the versioned changelog contract.
Command releasenotes audits and validates the versioned changelog contract.
sign-release command
Command sign-release 从受保护环境私钥生成并签名 v1 发布清单。
Command sign-release 从受保护环境私钥生成并签名 v1 发布清单。
Package javdb is the public Go SDK for the JavDB app JSON API.
Package javdb is the public Go SDK for the JavDB app JSON API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL