Metadata-Version: 2.4
Name: pooh-code
Version: 0.2.0
Summary: CLI coding agent for the current project, installable from PyPI and runnable with pipx.
Requires-Python: >=3.11
Requires-Dist: beautifulsoup4>=4.14.3
Requires-Dist: duckduckgo-search>=8.1.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: oauth-cli-kit>=0.1.3
Provides-Extra: audio
Requires-Dist: faster-whisper>=1.2.1; extra == 'audio'
Provides-Extra: feishu
Requires-Dist: lark-oapi>=1.5.3; extra == 'feishu'
Provides-Extra: files
Requires-Dist: openpyxl>=3.1.5; extra == 'files'
Requires-Dist: pandas>=3.0.2; extra == 'files'
Requires-Dist: pdfplumber>=0.11.9; extra == 'files'
Requires-Dist: pypdf2>=3.0.1; extra == 'files'
Requires-Dist: python-docx>=1.2.0; extra == 'files'
Requires-Dist: python-pptx>=1.0.2; extra == 'files'
Provides-Extra: image
Requires-Dist: requests>=2.33.1; extra == 'image'
Description-Content-Type: text/markdown

# Pooh Code

`pooh-code` 是一个面向当前项目目录运行的 CLI 编码代理。安装后可以直接在本地终端里用，适合通过 `pipx install` 分发。

## 安装

推荐：

```bash
pipx install pooh-code
```

如果你需要更完整的文件处理能力，可以安装额外依赖：

```bash
pipx install 'pooh-code[files]'
pipx install 'pooh-code[files,audio,image]'
```

如果你只是在本地开发这个仓库，也可以：

```bash
uv tool install .
```

## 使用

第一次使用前先登录 OpenAI Codex OAuth：

```bash
pooh-code-login
```

然后进入你的项目目录启动：

```bash
cd /path/to/your/project
pooh-code
```

也可以显式指定工作目录：

```bash
pooh-code --workspace /path/to/your/project
```

常用命令：

```bash
pooh-code                 # 默认进入 CLI 会话
pooh-code chat            # 显式进入 CLI 会话
pooh-code sessions        # 查看历史会话
pooh-code-login --check   # 检查 OAuth 状态
```

## 运行时目录

`pooh-code` 会把运行时文件初始化到当前项目下：

```text
workplace/runtime/
workplace/output/
```

其中：

- `workplace/runtime/config/settings.json`：本地配置
- `workplace/runtime/sessions/`：CLI 会话 transcript
- `workplace/runtime/skills/`：默认 skills，会在首次启动时从包内资源复制出来
- `workplace/output/<session_id>/`：当前会话的产物目录

这意味着：

- agent 读写代码时，根目录是你当前所在的项目目录
- 会话和产物默认落在项目内，便于一起查看和清理
- 同一个安装可以在多个项目目录里分别使用

## 打包发布到 PyPI

本地构建：

```bash
uv build
```

构建完成后会得到：

```text
dist/pooh_code-<version>.tar.gz
dist/pooh_code-<version>-py3-none-any.whl
```

上传到 PyPI：

```bash
uvx twine upload dist/*
```

如果先发测试仓库：

```bash
uvx twine upload --repository testpypi dist/*
```

发布前建议至少验证这几件事：

1. 在临时目录里安装 wheel 后，`pooh-code --help` 能正常运行。
2. 在一个空项目目录里启动 `pooh-code`，能自动生成 `workplace/runtime/`。
3. `pooh-code-login --check` 和一次真实 CLI 会话都能通过。

## 开发

本地开发时常用命令：

```bash
uv sync
uv run pooh-code --help
uv build
```
