Metadata-Version: 2.2
Name: aicortexpy
Version: 0.2.2
Summary: AICortex Python CLI and local agent runtime daemon (Go CLI compatible)
Author: AICortex
License: Apache-2.0
Project-URL: Homepage, https://gitee.com/seacozz2007/aicortex
Project-URL: Repository, https://gitee.com/seacozz2007/aicortex
Project-URL: Issues, https://gitee.com/seacozz2007/aicortex/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: websocket-client>=1.6
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"

# aicortexpy

Python **CLI + local agent runtime** for AICortex。在无法使用 Go `aicortex` 二进制时，可作为完整替代：

```powershell
pip install -U aicortexpy
aicortex login --token mul_...
aicortex daemon start
aicortex issue list --output json
```

等价入口：`python -m aicortex`（推荐）/ `python -m aicortexpy` / `aicortexpy`。

| | |
|--|--|
| PyPI 包名 | `aicortexpy` |
| 模块 | `aicortex`（`-m`）、`aicortexpy` |
| PATH 命令 | Windows：`aicortex.cmd` → `python -m aicortex`（**不**生成 `aicortex.exe`，避免与 Go 安装器 / `.exe` 探测冲突）；另有 `aicortexpy.exe` |
| 配置 | 与 Go 共用 `~/.aicortex/config.json` |

## 安装

```powershell
pip install -U aicortexpy
# 若以前装过会留下 Scripts\aicortex.exe，可手动删掉，让 aicortex.cmd 生效：
#   Remove-Item "$env:LOCALAPPDATA\Programs\Python\Python3*\Scripts\aicortex.exe" -ErrorAction SilentlyContinue
# 源码：
cd python-aicortex
pip install -e .
```

## 常用命令（对齐 Go CLI）

```powershell
aicortex login --token mul_xxx
aicortex auth status
aicortex config show
aicortex workspace list --output json
aicortex issue get MUL-123 --output json
aicortex issue comment add MUL-123 --content "done"
aicortex daemon start
aicortex daemon status
aicortex version
```

Agent 任务内：daemon 会把 `aicortex` shim 前置到 PATH，子进程执行 `aicortex issue ...` 即本包，无需 Go 二进制。

## Daemon

```powershell
$env:AICORTEX_DAEMON_BACKEND = "python"   # 若仍用 Go 包装器拉起
aicortex daemon start
# 或
python -m aicortexpy daemon start --foreground
```

Health 默认端口 **19514**。不要与 Go daemon 同时跑。

## 发布

```powershell
cd python-aicortex
python -m build
python -m twine upload dist/*
```

版本：`pyproject.toml` 与 `aicortexpy/__init__.py` 的 `__version__` 保持一致。

## 相对 Go CLI

已覆盖 Agent/日常平台命令（issue/workspace/agent/squad/project/label/attachment/autopilot/meeting/skill/memory/graph/runtime/repo/auth/config/daemon）。

相对 Go：`setup` / `update`(pip) / OAuth login / 平台命令已对齐；二进制自更新请用 `pip install -U aicortexpy`。
