mp2rss-auth

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

mp2rss-auth Skill

mp2rss-auth Skill

Mp2rss CLI 的登录态管理 —— 登录、登出、查看 Feed Key 与登录状态。
Login-state management for the Mp2rss CLI — log in, log out, and view the Feed Key and login status.

Prerequisites

Prerequisites

mp2rss
二进制已安装:
bash
undefined
The
mp2rss
binary is installed:
bash
undefined

一键安装(macOS / Linux)

One-click installation (macOS / Linux)

npm(Node ≥ 18)

npm (Node ≥ 18)

pnpm add -g @mp2rss/cli

也可在 <https://github.com/areyoubugcoder/mp2rss-cli/releases/latest> 直接下载对应平台二进制。
pnpm add -g @mp2rss/cli

You can also download the binary for your platform directly from <https://github.com/areyoubugcoder/mp2rss-cli/releases/latest>.

Commands

Commands

Log in

Log in

mp2rss auth login [-k <feed-key>] [--no-browser]
ModeCommandDescription
浏览器(默认)
mp2rss auth login
打开浏览器走 loopback 授权,登录后自动写入
~/.mp2rss/config.json
Feed Key 直传
mp2rss auth login -k <feed-key>
直接传入 Feed Key,先调用上游
VerifyAuth
校验,校验通过后写入
~/.mp2rss/config.json
,跳过浏览器流程;适用于 CI / 无头环境
远程模式
mp2rss auth login --no-browser
不打开浏览器,仅打印授权 URL,复制到本地浏览器打开后手动粘贴 Feed Key
bash
mp2rss auth login
mp2rss auth login -k <your-feed-key>
mp2rss auth login --no-browser
Feed Key 可在 https://mp2rss.bugcode.dev/ 登录后查看或重置。
⚠️
auth login
不支持
-o json
,只输出纯文本反馈。

mp2rss auth login [-k <feed-key>] [--no-browser]
ModeCommandDescription
Browser (default)
mp2rss auth login
Opens the browser for loopback authorization and automatically writes the credentials to
~/.mp2rss/config.json
after login
Direct Feed Key entry
mp2rss auth login -k <feed-key>
Passes the Feed Key directly, first calls the upstream
VerifyAuth
service for validation and writes it to
~/.mp2rss/config.json
only after validation succeeds
, bypassing the browser flow; suitable for CI / headless environments
Remote mode
mp2rss auth login --no-browser
Does not open a browser and only prints the authorization URL; copy it, open it in a local browser, and then manually paste the Feed Key
bash
mp2rss auth login
mp2rss auth login -k <your-feed-key>
mp2rss auth login --no-browser
You can view or reset your Feed Key after logging in at https://mp2rss.bugcode.dev/.
⚠️
auth login
does not support
-o json
and only outputs plain-text feedback.

Check status

Check status

mp2rss auth status [-o json]
显示是否已认证、Feed Key 来源、API URL、最近登录时间。
bash
mp2rss auth status
mp2rss auth status -o json
JSON shape(已登录):
json
{
  "loggedIn": true,
  "source": "config",
  "apiUrl": "https://mp2rss.bugcode.dev",
  "feedKeyMasked": "abcdef***",
  "name": "张三",
  "email": "user@example.com",
  "lastLoginAt": 1705000000000,
  "lastVerifyAt": 1705000001000
}
name
/
email
仅在浏览器登录回调成功时落盘;
-k
/
--no-browser
流程拿不到这两个字段,会以
omitempty
省略。
JSON shape(未登录):
json
{
  "loggedIn": false,
  "source": "none",
  "apiUrl": "https://mp2rss.bugcode.dev"
}
source
取值:
"env"
(环境变量)/
"config"
(配置文件)/
"none"
(未配置)。

mp2rss auth status [-o json]
Displays whether you are authenticated, the Feed Key source, the API URL, and the most recent login time.
bash
mp2rss auth status
mp2rss auth status -o json
JSON shape (logged in):
json
{
  "loggedIn": true,
  "source": "config",
  "apiUrl": "https://mp2rss.bugcode.dev",
  "feedKeyMasked": "abcdef***",
  "name": "John Doe",
  "email": "user@example.com",
  "lastLoginAt": 1705000000000,
  "lastVerifyAt": 1705000001000
}
name
/
email
are persisted only when the browser login callback succeeds; the
-k
/
--no-browser
flows cannot retrieve these two fields and omit them using
omitempty
.
JSON shape (not logged in):
json
{
  "loggedIn": false,
  "source": "none",
  "apiUrl": "https://mp2rss.bugcode.dev"
}
Possible
source
values:
"env"
(environment variable) /
"config"
(configuration file) /
"none"
(not configured).

Log out

Log out

mp2rss auth logout
清空
~/.mp2rss/config.json
里的 Feed Key(保留 API URL 配置)。

mp2rss auth logout
Clears the Feed Key in
~/.mp2rss/config.json
while retaining the API URL configuration.

Agent Usage Notes

Agent Usage Notes

  • 调用
    mp2rss mp
    任何子命令前如不确定登录状态,应先
    mp2rss auth status -o json
    解析
    loggedIn
    字段
  • 时间字段均为 unix 毫秒数(number),不是格式化字符串
  • 字段命名统一 camelCase(
    loggedIn
    /
    apiUrl
    /
    feedKeyMasked
    /
    name
    /
    email
    /
    lastLoginAt
    /
    lastVerifyAt
    )
  • 本地配置:
    ~/.mp2rss/config.json
    ,目录
    0700
    / 文件
    0600
  • Feed Key 优先级(高 → 低):命令行
    --api-key
    >
    MP2RSS_FEED_KEY
    环境变量 > 配置文件
  • API URL 优先级(高 → 低):
    --api-url
    >
    MP2RSS_API_URL
    > 配置文件 > 默认
    https://mp2rss.bugcode.dev
  • 错误 JSON 形态:
    {"error":{"message":"...","code":<int>}}
    ,
    code
    为 HTTP 状态码或 CLI exit code;被限流(429)时额外带
    "kind":"rate_limited"
    ,不要立刻重试
  • Exit codes:
    0
    成功;
    1
    通用错误(网络);
    2
    参数错误;
    3
    鉴权失败;
    4
    资源不存在;
    5
    上游不可用
  • Before invoking any
    mp2rss mp
    subcommand, if you are unsure about the login state, first run
    mp2rss auth status -o json
    and parse the
    loggedIn
    field
  • All time fields are Unix timestamps in milliseconds (number), not formatted strings
  • Field names consistently use camelCase (
    loggedIn
    /
    apiUrl
    /
    feedKeyMasked
    /
    name
    /
    email
    /
    lastLoginAt
    /
    lastVerifyAt
    )
  • Local configuration:
    ~/.mp2rss/config.json
    , with directory permissions
    0700
    and file permissions
    0600
  • Feed Key precedence (high → low): command-line
    --api-key
    >
    MP2RSS_FEED_KEY
    environment variable > configuration file
  • API URL precedence (high → low):
    --api-url
    >
    MP2RSS_API_URL
    > configuration file > default
    https://mp2rss.bugcode.dev
  • Error JSON shape:
    {"error":{"message":"...","code":<int>}}
    , where
    code
    is the HTTP status code or CLI exit code; when rate-limited (429), it additionally includes
    "kind":"rate_limited"
    —do not retry immediately
  • Exit codes:
    0
    success;
    1
    generic error (network);
    2
    invalid arguments;
    3
    authentication failure;
    4
    resource not found;
    5
    upstream unavailable