Metadata-Version: 2.4
Name: yangpa
Version: 0.1.0
Summary: A generic CLI application based on Click
Author-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/yangpa-project
Project-URL: Documentation, https://github.com/yourusername/yangpa-project#readme
Project-URL: Repository, https://github.com/yourusername/yangpa-project
Keywords: cli,template,command-line
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.0
Requires-Dist: twine>=6.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=4.0.0; extra == "dev"

# Yangpa Project

一个通用的 Python CLI 应用，基于 Click 框架构建。

## 特性

- 现代化项目结构
- 使用 Click 框架，支持漂亮的命令行界面
- 支持多命令架构
- 可通过 `uv pip install` 安装
- 内置版本显示
- 易于扩展

## 安装

### 使用 uv 安装（开发模式）

```bash
cd cli_template
uv pip install -e .
```

### 使用 uv 从 PyPI 安装（发布后）

```bash
uv pip install yangpa
```

## 使用方法

安装后直接使用 `yangpa` 命令：

```bash
yangpa --help
yangpa test --name Alice
yangpa test --name Bob --verbose
```

## 项目结构

```
cli_template/               # 项目文件夹
├── pyproject.toml           # 项目配置文件
├── README.md                # 项目文档
└── yangpa_project/          # Python 包
    ├── __init__.py          # 包初始化
    ├── main.py              # CLI 主入口
    └── commands/            # 命令模块
        ├── __init__.py
        └── test.py          # 测试命令
```

## 添加新命令

1. 在 `yangpa_project/commands/` 目录下创建新的命令文件，例如 `new_command.py`：

```python
import click

@click.command()
@click.option("--option", "-o", help="Description of option")
def new_command(option):
    """Description of the new command."""
    click.echo(f"Option value: {option}")
```

2. 在 `yangpa_project/main.py` 中导入并注册命令：

```python
from yangpa_project.commands.new_command import new_command

cli.add_command(new_command)
```

3. 在 `yangpa_project/commands/__init__.py` 中导出：

```python
from yangpa_project.commands.new_command import new_command

__all__ = ["test", "new_command"]
```

## 开发

### 安装开发依赖

```bash
uv pip install -e ".[dev]"
```

### 运行测试

```bash
pytest
```

### 代码格式化

```bash
black .
```

## 配置说明

### pyproject.toml 关键配置

- `[project.scripts]` 中的 `yangpa = "yangpa_project.main:cli"` 定义了入口点
- 安装后，系统会根据这个配置创建 `yangpa` 命令
- `[project.dependencies]` 定义了项目依赖（Click）

## 许可证

MIT License
