Metadata-Version: 2.4
Name: youn-xy-cli
Version: 0.1.0
Summary: Read-only Xianyu query and shop diagnosis CLI
Project-URL: Homepage, https://github.com/aclrioe/youn-xy-cli
Project-URL: Repository, https://github.com/aclrioe/youn-xy-cli
Project-URL: Issues, https://github.com/aclrioe/youn-xy-cli/issues
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Requires-Python: >=3.10
Requires-Dist: browser-cookie3>=0.20
Requires-Dist: click>=8.1
Requires-Dist: cryptography>=41.0
Requires-Dist: loguru>=0.7
Requires-Dist: mcp>=1.2
Requires-Dist: playwright>=1.58.0
Requires-Dist: pyexecjs>=1.5
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.31
Requires-Dist: rich>=13.7
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# youn-xy-cli

只读闲鱼查询与店铺诊断 CLI。项目采用 `xiaohongshu-cli` 风格的 Click + Client/Mixins
架构，并迁入 `goofish-cli` 已验证的闲鱼登录、MTop、浏览器查询和风控能力。

## 安装与开发

```bash
pip install youn-xy-cli
```

运行环境还需要：

- Node.js：执行闲鱼 MTop 签名脚本。
- 系统 Google Chrome：QR 登录、Feed、搜索和浏览器详情查询。
- 与登录浏览器相同的本机用户环境：登录态默认保存在 `~/.goofish-cli/`。

本地开发：

```bash
uv sync --extra dev
uv run goofish --help
```

## 核心流程

```bash
goofish auth login
goofish auth status --yaml
goofish search items "iPhone 15"
goofish item view @1
goofish feed
goofish item list
goofish skills install --list
```

所有业务命令均为只读。JSON/YAML 输出使用稳定的 `ok/schema_version/data/error`
envelope。Feed、搜索和详情访问仅使用闲鱼网站与经审查的淘系接口。

详见 [执行计划](docs/youn-xy-cli.md) 与 [合规说明](docs/compliance.md)。

维护者发布流程见 [发布指南](docs/publishing.md)。

## 验证与排障

```bash
uv run pytest -q
uv run ruff check src tests
uv run mypy src/youn_xy_cli
uv build
```

真实账号浏览器 smoke 默认跳过。确认本机已登录闲鱼后，可运行：

```bash
XIANYU_REAL_ACCOUNT_SMOKE=1 uv run pytest tests/test_real_account_smoke.py -q
```

遇到安全验证时，先在系统浏览器人工完成验证，再运行
`goofish auth reset-guard`。本工具不会绕过验证码或修改浏览器 Cookie。

## 在其他 Skill 中使用

优先使用 MCP，skill 无需解析 CLI 文本：

```json
{
  "mcpServers": {
    "goofish": {
      "command": "uvx",
      "args": ["--from", "youn-xy-cli", "youn-xy-cli"]
    }
  }
}
```

也可以使用稳定 Python API：

```python
from youn_xy_cli.api import login, search_items, item_view

login(browser="auto")
items = search_items("iPhone 15", limit=5)
detail = item_view("@1")
```

登录态按操作系统用户和机器保存、加密，不能直接复制到其他机器或隔离容器。
