Skip to main content

极简智能体 - 轻量级、无框架依赖的 AI Agent

Project description

JwClaw 极简智能体

Version Python License Platform

轻量级、无框架依赖的 AI Agent,默认 CLI 交互,Skill 优先执行

快速开始安装使用开发 Skill


📖 简介

JwClaw 是一个极简主义的 AI Agent,零框架依赖,仅使用 OpenAI 客户端。支持 ReAct 架构、Skills 扩展,默认 CLI 交互。

✨ 主要特点

  • 🚀 极简架构 - 零框架依赖,仅 openai>=1.0.0
  • 🎯 Skill 优先 - 自动识别并调用合适的 Skill 完成任务
  • 🔧 易于扩展 - 通过 Markdown 格式 SKILL.md 定义新功能
  • 💻 CLI 优先 - 默认命令行交互,轻量高效
  • 📦 易于安装 - pip install jwclaw 一键安装
  • 🌍 跨平台 - 支持 Windows、macOS、Linux

🚀 快速开始

前置要求

  • Python 3.8+
  • OpenAI 兼容的 API 服务(如 LM Studio、Ollama、LocalAI 等)

安装

# PyPI 安装(推荐)
pip install jwclaw

# 或从 GitHub 安装
pip install git+https://github.com/junweiin/jwclaw.git

配置

编辑 config.json(首次运行自动创建):

{
  "api_base": "http://localhost:1234/v1",
  "model": "your-model-name",
  "api_key": "lm-studio"
}

运行

jwclaw

卸载

pip uninstall jwclaw

📖 使用指南

基本交互

启动后直接输入自然语言指令:

> 今天有什么新闻
🔧 [news] {'query': '今天的新闻'}
📰 最新新闻
==================================================
1. 科技新闻标题...
   📎 IT之家

2. 财经新闻标题...
   📎 新浪财经

内置命令

命令 说明
/clear 清空对话历史
/tools 列出所有工具
/exit 退出程序

内置 Skills

Skill 功能
shell 执行系统命令
news RSS 新闻聚合
web_search 网络搜索
weather_advisor 天气查询
xlsx Excel 处理

🔧 开发指南

创建新 Skill

skills/my_skill/SKILL.md 创建文件:

---
name: my_skill
description: "我的自定义技能"
---

## 执行代码
```python
query = args[0] if args else ""
result = f"处理结果: {query}"

自动生效,无需重启。

### Skill 代码规范

- 使用 `args[0]` 获取输入参数
- 使用 `result` 变量返回结果
- 添加 try-except 错误处理

---

## 🎯 核心架构

用户输入 → LLM 推理 → 工具调用 → 执行 → 返回结果


- **单文件核心** - `core.py` ~200 行
- **Function Calling API** - 替代正则解析
- **自动 Skill 发现** - 启动时自动加载

---

## 📁 项目结构

jwclaw/ ├── src/jwclaw/ # 核心代码 │ ├── init.py │ ├── main.py # CLI 入口 │ └── core.py # Agent 核心 ├── skills/ # Skills 目录 ├── config.json # 配置文件 └── workspace/ # 工作目录


---

## ❓ 常见问题

### Q1: 启动时提示缺少 openai

```bash
pip install openai

Q2: 无法连接到 API

检查 config.json 中的 api_base 是否正确。

Q3: Skill 未生效

确保 SKILL.md 文件格式正确,包含 ## 执行代码 区块。


📄 许可证

MIT License - 详见 LICENSE


🔗 链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jwclaw-0.2.2.tar.gz (675.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jwclaw-0.2.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file jwclaw-0.2.2.tar.gz.

File metadata

  • Download URL: jwclaw-0.2.2.tar.gz
  • Upload date:
  • Size: 675.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for jwclaw-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9324038de033dca4d3f98a15fa11fd91d51b03a1b8153038e702de66b0601c21
MD5 538dc38b9f42b638fd7ad2d15dc5e09d
BLAKE2b-256 ae6290e7a87fb85e0b1891a12c64396871236648b943bebd5e4b27cfa4257809

See more details on using hashes here.

File details

Details for the file jwclaw-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: jwclaw-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for jwclaw-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 adf7a824a662c9bf598520796fbc385ff4c5790daa5210f1b36e8041b72d881d
MD5 14dda131e7969f3dea5dc7bdd6c15d5f
BLAKE2b-256 ecd3a29088ebb984751f4fac4497c08ce1a5ae62d4df97242c5d1786044e8fb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page