一个CLI工具,用于与项目交互并与AI模型通信。
Project description
OpsBot - 您的AI驱动的代码助手
OpsBot是一个命令行工具,旨在帮助开发者更高效地与AI模型互动,管理项目代码上下文,并自动应用AI生成的代码修改。
主要功能
- 项目上下文生成: 扫描指定目录下的代码文件,生成结构化的项目概览和文件内容,作为AI的输入。
- 交互式AI聊天: 启动一个基于OpenAI模型的聊天会话,支持历史记录、多行输入、命令(如加载上下文、回滚修改)。
- 代码Diff应用: AI返回的diff可以直接在本地项目中预览和应用。
- 修改回滚: 支持回滚AI应用的最近一次代码修改。
- 可配置: 通过
.ops文件自定义API设置、文件扫描规则和系统提示词。
安装
- 克隆仓库:
git clone <your-repo-url> # 将 <your-repo-url> 替换为您的实际仓库地址 cd opsbot
- 安装依赖 (推荐使用虚拟环境):
python -m venv venv # Linux/macOS source venv/bin/activate # Windows venv\Scripts\activate # 安装项目为可编辑模式,以便正确加载资源文件 pip install -e .
使用
1. 初始化项目
在您的项目根目录运行此命令。它将创建 .ops 配置文件和 opsbot_data 目录,其中包含默认的系统提示词文件、聊天记录和备份目录。
opsbot init
重要: 请务必编辑新生成的 .ops 文件,填入您的 OpenAI API Key。
2. 生成项目上下文 (可选)
您可以将整个项目的代码结构和内容扫描并输出到一个文本文件中。这个文件可以作为AI模型理解您项目的基础。
opsbot gp . -o my_project_context.txt
3. 启动聊天会话
opsbot chat
您也可以在启动时注入之前生成的上下文文件:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
opsx-1.0.1.tar.gz
(17.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
opsx-1.0.1-py3-none-any.whl
(18.7 kB
view details)
File details
Details for the file opsx-1.0.1.tar.gz.
File metadata
- Download URL: opsx-1.0.1.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.4 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13474bb40f3557f105845c1f2660d9c7fd6d9e6f4567a3b45c47e706af69c10a
|
|
| MD5 |
bd18eadbc6b534c475531f543f5801b3
|
|
| BLAKE2b-256 |
45a066686504c4810ca77c154d7efeb92804cc52e8d791eef46aa560519b61f4
|
File details
Details for the file opsx-1.0.1-py3-none-any.whl.
File metadata
- Download URL: opsx-1.0.1-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.4 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
018d5d0ce87bf3d4ff691beebccf3a888f3bf97fabec308e186603a5ac27c011
|
|
| MD5 |
79831e582d1ab873039600f3a2b9cb3d
|
|
| BLAKE2b-256 |
a800d9906792425be6302af4059ca346167708f93b75b26d3ac8d870f09b6188
|