npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lingjingai/anitime-admin-cli

v0.1.5

Published

Anitime 管理后台安全运营 CLI

Readme

@lingjingai/anitime-admin-cli

Anitime 管理后台一期安全运营 CLI,面向运营人员和 AI Agents。查询直接执行;所有远端业务写操作先生成短时、本机签名的 change plan。AI 完整展示计划后,用户只需在 AI 对话中输入计划给出的精确确认短语,AI 即可调用固定的 apply 命令;终端不再要求再次输入。macOS 执行前仍必须由用户完成 SecurityAgent 的当前会话所有者认证。

安装与初始化

npm install -g @lingjingai/anitime-admin-cli
anitime config init
anitime system doctor --format json
anitime auth login
anitime auth status --format json

Node.js 要求 20+。默认通过 OpenCLI 1.8.6 的公开 Browser Bridge/Page 接口复用浏览器登录态;config init 会安装只读 Adapter、skills/anitime-admin/SKILL.md 及其命令/安全 references,遇到同名文件只报告冲突,绝不覆盖。开发环境也可把配置中的浏览器模式改为 cdp 并指定本机 CDP endpoint。

npm 包以 public 访问级别发布,安装不需要 npm 私有包订阅或组织读取权限。公开范围仅包含 tarball 文件清单中的 CLI 构建产物、文档、OpenCLI Adapter 和 Agent Skill;不得向包内加入凭据、Cookie、生产响应或后台源码。

CLI 不保存密码,不复制 Cookie,不把 accessTokenrefreshToken 或 Authorization Header 返回 Node 进程、普通配置、日志或 Git。auth login 在 API 使用的同一个 anitime 持久 OpenCLI/CDP 会话中打开页面,由用户自行登录;不再调用可能指向其他浏览器或 Profile 的系统默认浏览器。

资源命名

后台真实英文资源为:剧集 series、分集 episode、轮播图 banner、栏目 program、首页瀑布流 waterfall、单列信息流 feed、转日语/人工介入 translation。栏目只使用 program,不同时注册 sectioncolumn 等同义主命令。

一期命令树

anitime
├── config init|show|remove
├── system doctor|version|update
├── update(system update 的快捷入口)
├── auth login|status|whoami|logout
├── series schema|list|search|get|options|languages|create|update
├── episode schema|list|get|create|update|manifest|upload|upload-status
├── banner schema|list|get|options|preview|cycle-list|cycle-get|create|update|cycle-create|cycle-update
├── program schema|catalog-list|list|options|preview|create-catalog|update-catalog|create
├── waterfall schema|list|options|preview|create|move
├── feed schema|list|options|preview|create|move
├── translation schema|list|options|collections|dubbing-count|to-japanese|to-manual
└── change list|show|apply|cancel

anitime update 直接运行固定的 npm 全局更新命令,不要求 TTY 或确认输入;anitime system update 保留为兼容入口。更新只影响本地 CLI,不属于远端业务数据写入。

series get 用稳定 seriesId 返回该剧的语种版本;episode list 是唯一的分集列表结构,因此没有重复的 series episodes。后台没有可靠的 program/waterfall/feed 单对象详情接口,所以未注册虚假的 get。Banner 详情路由真实存在,但 2026-07-21 生产只读核验返回业务码 9000,CLI 会透明返回脱敏错误。

所有查询支持 --format json / -f json。列表默认 --limit 10、最大 100,不会自动翻页或全库扫描;后台本身无分页的 search/program/cycle/语种列表也会在默认输出中做同样的客户端硬限制。--output <new-file> 将该次接口的完整稳定 JSON 包装写入用户指定的新文件且不覆盖。

查询矩阵

| 模块 | 查询命令 | 后台路径 | 分页/稳定 ID | |---|---|---|---| | 剧集 | list/search/get/options/languages | /admin/series/queryList, searchByKeyword, queryLangVersions, queryOptions | pageNum/pageSizeseriesId | | 分集 | list/get | /admin/series/queryDetail, queryEpisodeDetail | pageNum/pageSizeepisodeId | | 轮播图 | list/get/options/cycle-list/cycle-get | /admin/banner/* | pageNum/pageSizebannerId/cycleId | | 栏目 | catalog-list/list/options | /admin/program/* | 后台未声明分页;programId | | 瀑布流 | list/options | /admin/waterfall/* | pageNum/pageSizeseriesId | | 信息流 | list/options | /admin/feed/* | pageNum/pageSizeepisodeId | | 翻译 | list/collections/dubbing-count/options | /admin/transfer2JP/* | pageNum/pageSizemediaId/bizId |

完整证据和字段限制见 docs/ENDPOINT_NOTES.md

变更计划与 AI 对话确认

写命令只接受单对象 JSON(批量分集上传除外),立即返回 planId、环境、资源类型/ID、当前值、计划值、字段差异、文件映射、冲突、哈希、过期时间、confirmationPhrasenextAgentCommand,并明确:当前仅生成变更计划,尚未修改服务器数据。

anitime series update --series-id <id> --input ./update.json --format json
anitime change show --plan-id <planId> --format json
# AI 完整展示计划后,等待用户在对话中精确输入 confirmationPhrase。
# 确认匹配后由 AI 执行 nextAgentCommand:
anitime change apply --plan-id <planId> --format json

计划默认 10 分钟、硬上限 15 分钟,采用规范 JSON 的 SHA-256 与本机 mode-600 HMAC 密钥签名。确认短语包含实际目标,例如 APPLY <id>UPLOAD <count> FILES TO <seriesId>TRANSFER <id> TO JAPANESE。它必须是计划展示之后的一条全新用户消息,并与 confirmationPhrase 完全一致;“可以”“继续”或计划生成前的授权都不算确认。

确认成功后,AI 只可对该 planIdplanHash 调用一次 nextAgentCommandchange apply 不从终端或 stdin 读取确认短语,而是重新读取完整计划、验证签名/哈希/过期时间、重新查询服务器检测状态漂移、校验上传文件,并弹出 macOS SecurityAgent 由用户认证。系统认证被取消、平台没有等价认证、计划变化或 CI 环境都会失败关闭。

0.1.5 起 change plan 使用 schemaVersion: 2。由 0.1.4 或更早版本生成的 pending 计划会以 PLAN_SCHEMA_UNSUPPORTED 拒绝执行,必须使用当前版本重新读取目标并生成新计划。

不存在 --yes--force--confirmation 或通用 Raw API。AI 不得替用户生成确认消息、把模糊自然语言当确认、自动操作 SecurityAgent、在 CI 中执行或修改计划文件。CLI 无法读取 AI 对话本身,因此“对话中的精确确认”由随包安装的 Agent Skill 约束,SecurityAgent 是执行前独立且不可省略的本机人类存在硬门。

写入前可直接读取后台 DTO 驱动的严格 JSON Schema,例如 anitime series schema --operation create --json。未知字段、错误类型和缺失必填字段会在任何网络写入前拒绝。

分集批量上传

一期唯一批量写能力:

anitime episode manifest --series-id <id> --dir ./episodes --output ./episodes.json
anitime episode upload --series-id <id> --manifest ./episodes.json

目录扫描不递归、不跟随符号链接,只接受 E<序号>.mp4|mov|m4v|mkv,不能确定分集时明确报错。SHA-256 使用流式读取,不把完整视频载入内存。Manifest 记录绝对文件路径、大小、MIME、SHA-256、语言、远端分集缺失、远端媒体状态、冲突和重复项。远端分集缺失会阻止计划;已有空分集允许上传;已有媒体才是远端冲突。upload 只预检并生成计划。

确认并执行后默认并发 1、硬上限 2;COS 上传携带禁止覆盖头。冲突/重复项跳过并报告;429/502/503/504 或未知状态会暂停批次且不自动重试。最终后台关联没有可靠幂等键,因此只提供 upload-status,不提供 upload-resume;未知状态必须人工处理。

已实现与明确不实现

可生成并执行安全计划:单剧集/分集/轮播图/轮播周期新建与更新,栏目目录新建、栏目内容新建,瀑布流与信息流单对象置顶创建,单媒体转日语,以及分集批量上传。program update-catalogwaterfall movefeed movetranslation to-manual 因缺少可靠详情/并发或源码契约,只生成带原因的不可执行预览计划。

一期没有注册任何删除、批量删除、批量元数据编辑、批量发布/下架、批量置顶/重排、媒体覆盖、清空/重置、通用非 GET Raw API 或无边界重试。源码中危险的 createOrSave(会删除缺失语种)、unTop 和所有批量状态/排序接口均不在允许列表。

OpenCLI Adapter

opencli anitime admin --resource series --limit 10 -f json

Adapter 仅允许六类有边界列表查询,声明 access: read,最大 limit 100。OpenCLI 当前策略枚举没有 PAGE_FETCH,故以 Strategy.COOKIE 表示需要认证浏览器上下文;实现实际在同源页面内读取 localStorage token 并发起 PAGE_FETCH,Token 不离开页面。

开发验证

npm install
npm run lint
npm run typecheck
npm test
npm run build
npm pack --dry-run

正式 npm publish --access public 不会由构建或 PR 自动执行,必须在展示 npm 身份、包版本、access、tarball 摘要和测试结果后获得明确人工确认。