Skip to main content

🧠 ZeonCoding CLI

自带上下文思考的 AI 编程助手 — 自动作业、自动思考、自动学习,拥有持久化记忆

GitHub Stars GitHub Forks GitHub License Gitee Stars Python 3.8+ Test Coverage PyPI version


📌 这是 GitHub 官方主仓

Gitee 镜像: gitee.com/Zeon7744/zeoncoding-cli
PyPI: pypi.org/project/zeoncoding-cli

Issues 和 PR 请在 GitHub 提交。


✨ 核心特性

特性 说明
🧠 上下文记忆 三层记忆系统:会话记忆、项目上下文、长期记忆
💭 自动思考 意图识别 + 假设生成 + 验证 + 结论形成
📚 自主学习 从交互中学习模式,自动推荐相似解决方案
🔍 智能搜索 基于相关性的记忆搜索,支持关键词和标签
📊 统计分析 实时监控记忆统计、学习成功率
🔄 跨会话持久化 记忆数据跨会话保留,越用越聪明

🚀 快速开始

安装

# 从 PyPI 安装
pip install zeoncoding-cli

# 或使用源码
git clone https://github.com/Zeon7744/zeoncoding-cli.git
cd zeoncoding-cli
pip install -e .

基本使用

# 初始化项目
vibe init --project ./my-project

# 提问并启用思考
vibe ask "如何优化 Python 代码性能?" --think

# 记住重要信息
vibe remember project_arch "采用微服务架构" -c architecture -t "architecture,microservice"

# 查看对话历史
vibe history -n 20

# 查看项目上下文
vibe context

# 查看长期记忆
vibe memories -d 7

# 查看系统统计
vibe stats

交互式模式

# 启动交互式 shell
vibe shell

# 在 shell 中
> ask 如何修复这个 bug? --think --learn
> remember solution "需要添加异常处理" -c bugfix
> history
> exit

🏗️ 架构设计

三层记忆系统

┌─────────────────────────────────────────┐
│         LongTermMemory (长期记忆)        │
│   • 跨会话持久化                        │
│   • 重要性评分                          │
│   • 标签分类                            │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│        ContextMemory (项目上下文)        │
│   • 项目级配置                          │
│   • 分类管理                            │
│   • 过期机制                            │
└─────────────────┬───────────────────────┘
                  │
┌─────────────────▼───────────────────────┐
│         SessionMemory (会话记忆)         │
│   • 消息历史                            │
│   • 上下文状态                          │
│   • 临时数据                            │
└─────────────────────────────────────────┘

思考引擎流程

Query → 意图分析 → 假设生成 → 验证 → 结论
   ↓
上下文收集 ← 历史记忆检索

学习引擎流程

交互记录 → 模式检测 → 相似度匹配 → 推荐解决方案

📖 API 使用

Python 代码中使用

from zeoncoding.memory import SessionMemory, ContextMemory, LongTermMemory
from zeoncoding.thinking import ThinkingEngine
from zeoncoding.learning import LearningEngine

# 初始化记忆系统
session = SessionMemory()
context = ContextMemory(project_path=".")
long_term = LongTermMemory()

# 初始化工具
thinker = ThinkingEngine(session, context, long_term)
learner = LearningEngine(long_term)

# 使用思考引擎
result = thinker.think("如何实现快速排序?")
print(result["conclusion"])

# 使用学习引擎
learner.learn_from_interaction(
    query="如何实现快速排序?",
    response="快速排序...[代码]",
    success=True
)

# 获取相似解决方案
similar = learner.get_similar_solutions("排序算法优化")

🧪 测试

# 运行所有测试
pytest tests/ -v

# 运行测试并显示覆盖率
pytest tests/ -v --cov=zeoncoding --cov-report=term-missing

# 运行特定模块测试
pytest tests/test_memory.py -v
pytest tests/test_thinking.py -v
pytest tests/test_learning.py -v

📊 项目统计

指标 数值
代码行数 685 行
测试用例 32 个
覆盖率 77%
通过率 100%

🔧 配置

环境配置

创建 ~/.zeoncoding/config.yaml:

memory:
  storage_path: "~/.zeoncoding/data"
  auto_save: true
  max_messages: 1000

thinking:
  max_iterations: 3
  default_confidence_threshold: 0.7

learning:
  max_patterns_per_type: 100
  similarity_threshold: 0.3

🎯 使用场景

场景 1:项目初始化

# 快速记录项目关键信息
vibe remember db_host "postgres://localhost:5432/mydb" -c database
vibe remember api_key "sk-xxx" -c credentials -t "secret"
vibe remember tech_stack "FastAPI + PostgreSQL + Redis" -c architecture

场景 2:智能问答

# 带思考的回答
vibe ask "如何优化数据库查询性能?" --think

# 带学习的回答(会记住你的偏好)
vibe ask "如何设计 REST API?" --think --learn

场景 3:错误调试

# 自动分析错误
vibe ask "RuntimeError: database connection failed" --think

# 记录解决方案
vibe remember "添加重试机制和连接池配置" -c fix -t "database,error"

📈 版本历史

版本 日期 变更
v1.0.0 2026-09-25 初始发布,核心功能完成

🤝 贡献指南

欢迎贡献!请遵循以下步骤:

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'Add amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 开启 Pull Request

代码规范

  • 使用 black 格式化代码
  • 保持测试覆盖率 ≥ 75%
  • 遵循 PEP 8 规范

☕ 支持作者

如果这个项目对你有帮助,欢迎赞助 ☕

渠道 方式
爱发电 支付宝 / 微信支付
GitHub Sponsors PayPal / Stripe

📄 License

MIT License


由 Zeon7744 维护
自带思考的 AI 编程助手

⭐ 如果对你有帮助,点个 Star 鼓励一下!

🤖 AI 集成

ZeonCoding CLI 支持集成 OpenAI 和 Anthropic Claude API:

# 使用 OpenAI
export OPENAI_API_KEY="sk-..."
vibe ask "如何优化这段代码?" --think

# 使用 Claude  
export ANTHROPIC_API_KEY="sk-ant-..."
vibe ask "分析这个项目架构" --think

🔌 插件系统

在 ~/.zeoncoding/plugins/ 目录下创建插件:

// plugin.json
{
  "name": "my-plugin",
  "version": "1.0.0",
  "description": "我的自定义插件",
  "author": "Zeon7744",
  "commands": ["mycmd"],
  "enabled": true
}
# plugin.py
def my_command(ctx, args):
    console.print("Hello from plugin!")

查看已安装插件:

vibe plugins list

📊 项目统计

指标 数值
代码行数 879 行
Python 文件 24 个
测试用例 43 个
覆盖率 74%
通过率 100%

🔗 相关链接


License: MIT
Author: Zeon7744

Metadata

Release files for zeoncoding-cli 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zeoncoding-cli 1.1.0
File Size Uploaded
zeoncoding_cli-1.1.0.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zeoncoding-cli 1.1.0
File Interpreter ABI Platform
zeoncoding_cli-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.3 kB

Release files / zeoncoding_cli-1.1.0.tar.gz

Download URL zeoncoding_cli-1.1.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0234bcfc12c43f2c90bf4c3fb0b86f6d0e1c33b6bcb7be777cc0340b8285a0e0
BLAKE2b-256 checksum
How to use checksums
42f0045ce6a6a208156a2e21ba72a65aa39632856d79e3067c1293beb027a167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / zeoncoding_cli-1.1.0-py3-none-any.whl

Download URL zeoncoding_cli-1.1.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b78d862f504eb4be9eae0499184059fc11bd91b08849499a4bef5bff6498d0d1
BLAKE2b-256 checksum
How to use checksums
f84abc146d5b3b52763e09e1a9499b449d99d2ffdc2edfbb7fe4800f48abbfbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.7.0

2 release files

1.3.0

2 release files

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page