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

opsbot_prompt_generator-2.0.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

opsbot_prompt_generator-2.0.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file opsbot_prompt_generator-2.0.0.tar.gz.

File metadata

  • Download URL: opsbot_prompt_generator-2.0.0.tar.gz
  • Upload date:
  • Size: 17.1 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 opsbot_prompt_generator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e56c5eecba8b07915138afb5d32d98b1d1b165b264d4ec4c57958d194ae5a554
MD5 caf0b9f8acb50ae2e807807369005f57
BLAKE2b-256 da37172ae2e3f0e206cc53a4e7c994610059e7347a90a59eef4a48550051fbf3

See more details on using hashes here.

File details

Details for the file opsbot_prompt_generator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opsbot_prompt_generator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5fe7331b3e30a2ac0237e48828929c19007637328c7c16b9921e0a45e943b77
MD5 d05bec0fd1e36eabf3a20ce702bdcd92
BLAKE2b-256 4ea4641583f1d46493cd028bd55243cbe9728c76ea8a9c3a72461e43484c3559

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