Skip to main content

一个CLI工具,用于与项目交互并与AI模型通信。

Project description

OpsBot - 您的AI驱动的代码助手

OpsBot是一个命令行工具,旨在帮助开发者更高效地与AI模型互动,管理项目代码上下文,并自动应用AI生成的代码修改。

主要功能

  • 项目上下文生成: 扫描指定目录下的代码文件,生成结构化的项目概览和文件内容,作为AI的输入。
  • 交互式AI聊天: 启动一个基于OpenAI模型的聊天会话,支持历史记录、多行输入、命令(如加载上下文、回滚修改)。
  • 代码Diff应用: AI返回的diff可以直接在本地项目中预览和应用。
  • 修改回滚: 支持回滚AI应用的最近一次代码修改。
  • 可配置: 通过 .ops 文件自定义API设置、文件扫描规则和系统提示词。

安装

  1. 克隆仓库:
    git clone <your-repo-url> # 将 <your-repo-url> 替换为您的实际仓库地址
    cd opsbot
    
  2. 安装依赖 (推荐使用虚拟环境):
    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


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.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

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

opsx-1.0.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file opsx-1.0.0.tar.gz.

File metadata

  • Download URL: opsx-1.0.0.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

Hashes for opsx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bd6997449fe00e8a82f8e87c940c078f11bad1bfb20f51d266b0ef3195f9dc9a
MD5 0188ee1dbf85b8a9b8e5563885452ebb
BLAKE2b-256 7a4273f60938917d64d68c5077d9c5aca3182ddae3b3f4ab9db261b938b7c3c9

See more details on using hashes here.

File details

Details for the file opsx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: opsx-1.0.0-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

Hashes for opsx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2d54ad8f90c7d8834d3d01d0550199a0b2401c1ab23ce44f4a5a11f07a3a0d6
MD5 c04c2dccad145168e9269f0581373051
BLAKE2b-256 3c08de6a28d8eecba169625cc8746349e737521fffa9fdb4351b99659f47df9b

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