# nxclaw **Repository Path**: umb/nxclaw ## Basic Information - **Project Name**: nxclaw - **Description**: NxClaw 是一个从零构建的最小可用 AI Agent 系统 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-25 - **Last Updated**: 2026-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NxClaw NxClaw 是一个轻量级的 AI Agent 框架,专注于本地自动化和工具集成。 ## 特性 - 轻量高效 - 专为本地运行设计 - 灵活配置 - JSON 配置 + 环境变量覆盖 - 安全第一 - 可配置的路径白名单和工具开关 - 记忆持久化 - 自动保存对话历史 - 工具调用 - 支持 Shell、文件操作等工具 ## 快速开始 ### 安装 ```bash # 从源码构建 go clone https://github.com/umb/nxclaw.git cd nxclaw make build ``` ### 配置 1. 复制示例配置: ```bash mkdir -p ~/.nxclaw cp config/config.example.json ~/.nxclaw/config.json ``` 2. 编辑配置文件,设置你的 API Key: ```json { "provider": { "api_key": "your-api-key-here", "model": "gpt-4o" } } ``` 或者使用环境变量: ```bash export NX_API_KEY="your-api-key-here" ``` ### 启动 ```bash # 使用默认配置 ./build/nxclaw start # 指定配置文件 ./build/nxclaw start --config /path/to/config.json ``` ## 架构概览 ``` ┌─────────────────────────────────────────┐ │ cmd/nxclaw │ │ Cobra CLI 入口 │ └─────────────────────────────────────────┘ │ ┌─────────────────────────────────────────┐ │ internal/config │ │ 配置加载、环境变量、验证 │ └─────────────────────────────────────────┘ │ ┌─────────────────────────────────────────┐ │ pkg/agent │ │ Agent 核心逻辑(待实现) │ └─────────────────────────────────────────┘ ``` ## 环境变量 | 变量名 | 说明 | 示例 | |--------|------|------| | NX_API_KEY | API 密钥 | sk-xxx | | NX_BASE_URL | API 基础 URL | https://api.openai.com/v1 | | NX_MODEL | 默认模型 | gpt-4o | | NX_SERVER_PORT | 服务端口 | 8080 | | NX_TOOLS_SHELL_ENABLED | 启用 Shell 工具 | false | ## 开发 ```bash # 运行测试 make test # 格式化代码 make fmt # 开发模式运行 make dev ``` ## License MIT License