KManager / README.md
StarrySkyWorld's picture
Add HF Spaces README frontmatter
884bddf
---
title: KManager
sdk: docker
app_port: 7860
---
# Autoreg (Kiro Account Manager)
用于管理 Kiro 账号、配额与自动注册的 Python 后端与 Web 管理界面。包含 FastAPI 服务、CLI、自动化注册与调试工具。
## 主要功能
- Web 管理面板(FastAPI + WebSocket)
- 账号/配额/Token 管理
- 自动注册与多种邮箱策略
- 防指纹与浏览器伪装模块
- 调试与抓包分析工具
- 可选 LLM API 兼容服务
## 目录结构
```
autoreg/
app/ # Web App (FastAPI)
core/ # 核心配置与工具
registration/ # 注册与 OAuth 流程
spoofers/ # 指纹伪装模块
services/ # 业务服务层
debugger/ # 调试/抓包分析
llm/ # LLM API Server
scripts/ # 开发脚本
cli.py # CLI 入口
run.py # Web App 入口
```
## 快速开始
### 1) 安装依赖
```bash
pip install -r requirements.txt
```
### 2) 配置环境变量
复制 `.env.example``.env`,按需填写:
```env
# IMAP
IMAP_SERVER=imap.gmail.com
IMAP_USER=your@gmail.com
IMAP_PASSWORD=app-password
# Email 策略: single, plus_alias, catch_all, pool
EMAIL_STRATEGY=plus_alias
# catch_all
EMAIL_DOMAIN=mydomain.com
# pool
EMAIL_POOL=["user1@mail.ru", "user2@mail.ru:password"]
```
### 3) 启动 Web App
```bash
python run.py
# 默认访问 http://127.0.0.1:8420
```
## 常用命令
### CLI
```bash
python cli.py status
python cli.py tokens list
python cli.py tokens switch <name>
python cli.py quota --all
python cli.py patch status
python cli.py patch apply
python cli.py patch generate-id
python cli.py sso-import <cookie> -a
```
### 自动注册
```bash
python -m registration.register_auto
python -m registration.register --email user@domain.com
python -m registration.register --count 5
python -m registration.register --email user@domain.com --headless
```
### LLM API Server
```bash
python -m llm.run_llm_server
# 默认 http://127.0.0.1:8421
```
### Debug Session
```bash
python -m debugger.run
# 输出到 debug_sessions/
```
## 邮箱策略说明
| 策略 | 说明 | 示例 |
|------|------|------|
| `single` | 单邮箱 | `user@gmail.com` |
| `plus_alias` | Plus 别名 | `user+abc@gmail.com` |
| `catch_all` | 域名 Catch-all | `any@domain.com` |
| `pool` | 邮箱池 | `["a@mail.ru", "b@mail.ru:pass"]` |
## 数据与隐私
- 本地数据默认保存在 `~/.kiro-manager-wb/`
- 敏感信息请放入 `.env`,不要提交到仓库
- 建议开启 `.gitignore` 保护 `accounts/``tokens/`、日志等
## 依赖说明
- FastAPI + Uvicorn 用于 Web 服务
- DrissionPage 用于浏览器自动化(需要系统浏览器)