内容
<p align="center">
<img src="assets/hero-coding.png" width="384" alt="一个像素艺术角色在桌前编程,旁边有一个狐狸伴侣">
</p>
<h1 align="center">CubeLife</h1>
<p align="center">
为您的AI代理赋予一个持久的像素艺术角色,该角色实时反映其状态。
</p>
<p align="center">
<a href="https://www.npmjs.com/package/@cubelife/sdk"><img src="https://img.shields.io/npm/v/@cubelife/sdk?label=%40cubelife%2Fsdk&color=blue" alt="npm SDK"></a>
<a href="https://www.npmjs.com/package/cubelife"><img src="https://img.shields.io/npm/v/cubelife?label=cubelife%20cli&color=blue" alt="npm CLI"></a>
<a href="https://pypi.org/project/cubelife/"><img src="https://img.shields.io/pypi/v/cubelife?color=blue" alt="PyPI"></a>
<a href="https://life.cubeworld.co.za"><img src="https://img.shields.io/badge/CubeLife-life.cubeworld.co.za-purple" alt="CubeLife"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/licence-MIT-green" alt="MIT"></a>
</p>
---
角色生活在像素艺术房间中,根据代理状态执行活动,展示情绪,并有生物伴侣。您可以在 [life.cubeworld.co.za](https://life.cubeworld.co.za)、桌面伴侣或通过 `<iframe>` 嵌入到您自己的应用程序中查看它们。
## 工具列表
此仓库包含三个工具包:
| 工具包 | 安装 | 描述 |
|---------|---------|-------------|
| [`@cubelife/sdk`](sdk/) | `npm install @cubelife/sdk` | 用于状态报告的Node.js SDK |
| [`cubelife`](cli/) | `npm install -g cubelife` | 用于AI编码工具的CLI + MCP服务器 |
| [`cubelife`](python-sdk/) | `pip install cubelife` | 用于状态报告的Python SDK |
## 快速开始
### MCP服务器(适用于Claude Code、Cursor、Copilot、Windsurf、Cline、Codex)
```bash
npx cubelife tutorial # 创建账户 + 代理
npx cubelife setup claude-code # 自动配置MCP
```
您的代理将获得四个工具:`cubelife_report`、`cubelife_complete`、`cubelife_error`、`cubelife_status`。
### Node SDK
```bash
npm install @cubelife/sdk
```
```typescript
import { CubeLifeClient } from '@cubelife/sdk';
const client = new CubeLifeClient({ apiKey: process.env.CUBELIFE_API_KEY });
await client.report('coding', { detail: 'Building the login page', progress: 0.5 });
await client.report('complete', { detail: 'Login page shipped' });
```
### Python SDK
```bash
pip install cubelife
```
```python
from cubelife import CubeLifeClient
client = CubeLifeClient("your-agent-key")
client.report("coding", detail="Building the login page", progress=0.5)
client.report("complete", detail="Login page shipped")
```
## 生物伴侣
<p align="center">
<img src="assets/creature-fox.png" width="64">
<img src="assets/creature-owl.png" width="64">
<img src="assets/creature-cat.png" width="64">
<img src="assets/creature-dragon.png" width="64">
<img src="assets/creature-wolf.png" width="64">
<img src="assets/creature-phoenix.png" width="64">
<img src="assets/creature-slime.png" width="64">
</p>
每个代理都有一个生物伴侣(狐狸、猫头鹰、猫、龙、狼、凤凰或史莱姆),它与角色一起反应。
## MCP服务器
<img src="assets/mcp-hub.png" width="80" align="right" alt="MCP Hub">
CLI包含一个用于AI编码工具的MCP服务器。 为您的工具自动配置:
```bash
npx cubelife setup claude-code # Claude Code
npx cubelife setup cursor # Cursor
npx cubelife setup windsurf # Windsurf
npx cubelife setup copilot # GitHub Copilot
npx cubelife setup cline # Cline
npx cubelife setup codex # Codex
```
或手动:`claude mcp add cubelife -- npx cubelife mcp`
## 链接
- [网站](https://life.cubeworld.co.za)
- [SDK文档](https://life.cubeworld.co.za/#/dev/sdk/node)
- [CLI文档](https://life.cubeworld.co.za/#/dev/cli)
- [MCP服务器文档](https://life.cubeworld.co.za/#/dev/mcp)
- [示例仓库](https://github.com/Ivy-Innovation/cubelife-example-claude)
## 许可证
MIT(源代码)。像素艺术精灵资产是专有的(参见 [SPRITE-LICENSE](cli/SPRITE-LICENSE))。