Giter Club home page Giter Club logo

codesistant's Introduction

Codesistant

Codesistant is a CLI tool designed to assist with code generation and completion using OpenAI's GPT-4 model. It watches specified files and directories for changes and updates an OpenAI assistant with the current state of the codebase, helping users complete their projects with consistent style and structure.

Table of Contents

Installation

To install Codesistant, you need to have Node.js and npm installed. Then, follow these steps:

  1. Install the Codesistant package globally:
    npm install -g codesistant

Usage

Codesistant can be used via the command line. The following commands are available:

Commands

  • init: Create a default config.yml in the current directory.

    codesistant init
  • watch: Start the watch process based on the configuration provided.

    codesistant watch

Options

  • --config, -c: Path to the config file (default: ./config.yml)
  • --proxy: Proxy URL
  • --openai: OpenAI API Key
  • --assistant: OpenAI assistant ID
  • --model: OpenAI model to use (default: gpt-4o)
  • --prompt: System prompt (default: a predefined prompt)
  • --files: List of files and directories to watch
  • --throttle: Throttle value in milliseconds (default: 2000)
  • --dburl: Database connection URL for MySQL or PostgreSQL

Example:

codesistant watch --config ./config.yml --openai <your-openai-key> --assistant <your-assistant-id>

Configuration

The configuration file (config.yml) specifies the settings for Codesistant. You can generate a default configuration file using the init command. Here is an example configuration:

proxy: '<optional proxy url>'
openai: '<required openai api key>'
assistant: '<required assistant id in openai>'
model: 'gpt-4o'
prompt: 'Below are snippets of code from the same project. Help the user complete the parts of the project they request based on the existing code. Adhere to the same style, structure, and approaches.'
files:
  - './example/path/to/dir/watch'
  - './support/**/glob/templates'
  - './example/**/somedir/*.js'
throttle: 2000
dburl: '<optional database connection url>'

Project Purpose

Codesistant is designed to quickly update an OpenAI assistant without the need to manually refresh the prompt each time. The system monitors specified files and directories, as well as changes in the database schema, and updates the assistant's prompt on the fly. This ensures that the assistant always has the most up-to-date information from your project.


Happy coding with Codesistant! If you encounter any issues or have any questions, feel free to open an issue on the project's GitHub page.

codesistant's People

Contributors

sintanial avatar

Stargazers

Andrey Markin avatar Kirill Markin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.