Metadata-Version: 2.4
Name: py_wlcli
Version: 0.6.13
Requires-Dist: toml>=0.10.2
Requires-Dist: click>=8.1.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: pre-commit>=4.5.1
Requires-Dist: mypy>=1.18.2 ; extra == 'dev'
Requires-Dist: ruff==0.15.21 ; extra == 'dev'
Requires-Dist: types-toml>=0.10.8.20240310 ; extra == 'dev'
Requires-Dist: types-tqdm>=4.67.0.20250809 ; extra == 'dev'
Requires-Dist: pytest-xdist>=3.8.0 ; extra == 'dev'
Requires-Dist: twine>=6.2.0 ; extra == 'dev'
Requires-Dist: pyyaml>=6.0.0 ; extra == 'lfs'
Requires-Dist: watchdog>=6.0.0 ; extra == 'lfs'
Requires-Dist: pytest>=9.0.3 ; extra == 'test'
Requires-Dist: pytest-cov>=7.0.0 ; extra == 'test'
Requires-Dist: pytest-asyncio>=1.3.0 ; extra == 'test'
Requires-Dist: pyyaml>=6.0.0 ; extra == 'test'
Requires-Dist: watchdog>=6.0.0 ; extra == 'test'
Provides-Extra: dev
Provides-Extra: lfs
Provides-Extra: test
License-File: LICENSE
Summary: wl_cli - Python项目
Author-email: WL Admin <wl.admin@example.com>
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://gitlab.gewinnrobo.com/Humuyuan/py_wlcommands
Project-URL: Issues, https://gitlab.gewinnrobo.com/Humuyuan/py_wlcommands/-/issues

# wl_cli（`wl` CLI）

`wl_cli` 是一个 Python + Rust 混合的命令行工具，命令入口为 `wl`。它以 Click 构建 CLI，
以 maturin + pyo3 编译 Rust 原生扩展，面向 Python 项目的初始化、构建、测试、格式化、lint、
清理与质量门等日常开发工作流。

## 功能概览

| 命令 | 用途 |
|------|------|
| `wl init` | 初始化项目环境（Git、虚拟环境、i18n、Rust 子模块等） |
| `wl build` | 执行构建任务，支持 Python 包构建与分发 |
| `wl test` | 运行测试（支持缓存、覆盖率、逐步模式） |
| `wl format` | 格式化 Python 与 Rust 代码 |
| `wl lint` | 代码质量检查（ruff/mypy 等） |
| `wl clean` | 清理构建产物与临时文件 |
| `wl debug` | 质量门（测试 + 格式检查） |
| `wl self` | 自管理命令 |

命令行别名：`b`→build、`c`→clean、`f`→format、`i`→init。
完整命令参考见 [CLI_COMMANDS.md](https://github.com/CharlieZi/py_wlcommands/blob/main/CLI_COMMANDS.md)。

## 环境要求

- Python >= 3.11
- 从源码构建 Rust 扩展时需要 Rust 工具链（maturin/pyo3）
- 包管理器推荐 [uv](https://docs.astral.sh/uv/)

## 安装

### 稳定版（PyPI）

```bash
pip install wl-cli
```

按需安装可选 extra：`pip install "wl-cli[lfs]"`（LFS watch）、
`pip install "wl-cli[test]"`（测试套件）、`pip install "wl-cli[dev]"`（开发工具）。
详见[安装文档](https://github.com/CharlieZi/py_wlcommands/blob/main/docs/user/installation.md)。

### 开发版（从源码）

```bash
# 以 GitLab 为主仓（origin），GitHub 为镜像
git clone https://gitlab.gewinnrobo.com/Humuyuan/py_wlcommands.git
cd wl_cli
uv pip install -e ".[dev,test]"
```

GitHub 镜像：<https://github.com/CharlieZi/py_wlcommands.git>

## 快速开始

```bash
wl --help       # 查看帮助
wl init         # 初始化项目
wl build        # 构建
wl test         # 运行测试
wl format       # 格式化代码
wl lint         # 代码质量检查
```

## 测试与质量门

```bash
wl test              # 运行全部测试
wl test --cover      # 覆盖率（阈值 70%）
wl test -s           # 逐个测试文件运行，首个失败即停
pytest tests/ -v     # 指定文件（pytest 直跑）
```

提交前请确保 pre-commit 通过（ruff、codespell、lockfile 一致性等）。
开发约束详见 [CLAUDE.md](https://github.com/CharlieZi/py_wlcommands/blob/main/CLAUDE.md)，
贡献流程见 [CONTRIBUTING.md](https://github.com/CharlieZi/py_wlcommands/blob/main/CONTRIBUTING.md)。

## 文档

- [CLI_COMMANDS.md](https://github.com/CharlieZi/py_wlcommands/blob/main/CLI_COMMANDS.md) — 命令参考
- [CONTEXT.md](https://github.com/CharlieZi/py_wlcommands/blob/main/CONTEXT.md) — 架构术语（Click 迁移语境）
- [docs/](https://github.com/CharlieZi/py_wlcommands/tree/main/docs) — 设计、ADR、章节与 CICD/发布文档
- [安装文档](https://github.com/CharlieZi/py_wlcommands/blob/main/docs/user/installation.md) — 安装细节与 shell 补全

## 架构速览

Click CLI（[src/py_wlcommands/cli_click.py](https://github.com/CharlieZi/py_wlcommands/blob/main/src/py_wlcommands/cli_click.py)
经 `setup_commands()` 直接注册）→ 各命令实现（`commands/<group>/`）→ 业务逻辑；
Rust 原生扩展（`rust/`、`src/wl_cli/lib/`）经 maturin 编译为 `wl_cli_native`；
依赖注入容器集中管理共享服务（`infrastructure/dependency_injection.py`）。
架构演进背景见 [Click 迁移设计](https://github.com/CharlieZi/py_wlcommands/blob/main/docs/superpowers/specs/2026-06-02-full-click-migration-design.md)。

## 许可证

MIT，见 [LICENSE](https://github.com/CharlieZi/py_wlcommands/blob/main/LICENSE)。

