介绍
# Steam Games CLI
用于浏览和发现 Steam 库中游戏的命令行工具。可按游戏时长、评测、Steam Deck 兼容性、类型和标签进行筛选。
## 安装
```bash npm install -g steam-games-cli ```
## 设置
1. 从 https://steamcommunity.com/dev/apikey 获取 Steam Web API 密钥 2. 配置 CLI: ```bash steam config set-key YOUR_API_KEY steam config set-user YOUR_STEAM_ID ```
## 命令
### 个人资料
```bash steam whoami # Profile info and library stats steam whoami --json ```
### 游戏库
```bash steam library # List all games steam library --limit 10 # Limit results steam library --json # JSON output for scripting ```
### 标签与类型 (即时)
```bash steam tags # List all 440+ Steam tags steam tags --json steam genres # List all genres steam genres --json ```
## 筛选选项
### 游戏时长
```bash steam library --unplayed # Never played steam library --min-hours 10 # At least 10 hours steam library --max-hours 5 # Less than 5 hours steam library --deck # Played on Steam Deck ```
### 评测 (1-9 分制)
```bash steam library --reviews very-positive # Exact category steam library --min-reviews 7 # Score 7+ (Positive and above) steam library --show-reviews # Show review column ```
**类别:** 压倒性好评 (9), 特别好评 (8), 好评 (7), 多数好评 (6), 褒贬不一 (5), 多数差评 (4), 差评 (3), 特别差评 (2), 压倒性差评 (1)
### Steam Deck 兼容性
```bash steam library --deck-compat verified # Verified only steam library --deck-compat playable # Playable only steam library --deck-compat ok # Verified OR Playable steam library --show-compat # Show Deck column ```
### 标签与类型
```bash steam library --tag "Roguelike" # Filter by tag steam library --genre "Strategy" # Filter by genre steam library --show-tags # Show tags column ```
### 排序
```bash steam library --sort name # Alphabetical (default) steam library --sort playtime # Most played first steam library --sort deck # Most Deck playtime first steam library --sort reviews # Best reviewed first steam library --sort compat # Best Deck compat first ```
## AI 代理工作流
该 CLI 针对智能体进行了优化,具备流融合 和提前终止 功能。
### 步骤 1:发现可用的标签/类型 (即时)
```bash steam tags --json steam genres --json ```
### 步骤 2:使用组合条件筛选游戏库
```bash # Unplayed Deck Verified roguelikes with good reviews steam library --unplayed --deck-compat verified --tag "Roguelike" --min-reviews 7 --limit 10 --json
# Well-reviewed strategy games under 5 hours steam library --max-hours 5 --genre "Strategy" --min-reviews 8 --limit 5 --json
# Trading games playable on Deck steam library --tag "Trading" --deck-compat ok --limit 10 --json ```
### 性能说明
- 本地筛选(游戏时长、未玩过的)优先应用 - 即时完成 - 远程筛选(评测、Deck 兼容性、标签)按游戏并行获取 - 提前终止:达到限制时停止 - 优先使用本地筛选以最小化 API 调用
## 使用示例
**用户:“我该在我的 Steam Deck 上玩什么?”** ```bash steam library --deck-compat verified --min-reviews 7 --sort playtime --limit 10 ```
**用户:“我有哪些 Roguelike 游戏?”** ```bash steam library --tag "Roguelike" --show-tags --limit 20 ```
**用户:“有哪些未玩的高分游戏?”** ```bash steam library --unplayed --min-reviews 8 --sort reviews --limit 10 --show-reviews ```
**用户:“我总共有多少款游戏?”** ```bash steam whoami ```
**用户:“有哪些支持 Deck 的策略游戏?”** ```bash steam library --genre "Strategy" --deck-compat ok --show-compat --limit 15 ```
**用户:“有哪些可用的标签?”** ```bash steam tags --json ```
## 输出格式
- 默认:彩色表格 - `--plain`:纯文本列表 - `--json`:用于脚本/AI 智能体的 JSON 格式