Giter VIP home page Giter VIP logo

openai-rust's Introduction

openai-rust

The openai-rust project is a command-line interface (CLI) tool written in Rust, designed to interact with OpenAI APIs. It supports multiple features like interactive chatting, translation, generating commit messages, writing code, and debugging code.

Features

  • Interactive Chat: Engage in an interactive chat session.
  • Translate: Translate text from a specified file.
  • Generate Commit Message: Automatically generate a commit message for a given change.
  • Write Code: Generate code based on a given prompt.
  • Debug Code: Debug code with a specified issue.
  • Installation
  • Clone the repository and build the project:
git clone https://github.com/yoichiojima-2/openai-rust.git
cd openai-rust
cargo build --release

Usage

Run the tool using the following commands:

Start Interactive Chat

cargo run -- interactive

Translate Text

cargo run -- translate <path-to-text-file>

Generate Commit Message

cargo run -- commit-message <path-to-file>

Write Code

cargo run -- code <prompt>

Debug Code

cargo run -- debug <path-to-file> <issue>

Dependencies

  • Rust
  • Clap
  • Tokio

Example Commands

Start Interactive Chat

To start an interactive chat session:

cargo run -- interactive

Translate Text

To translate text from a specified file:

cargo run -- translate path/to/text/file.txt

Generate Commit Message

To generate a commit message for a given file:

cargo run -- commit-message path/to/file.txt

Write Code

To generate code based on a given prompt:

cargo run -- code "Implement a binary search algorithm"

Debug Code

To debug code with a specified issue:

cargo run -- debug path/to/code/file.rs "The function does not return the correct value"

Ensure that you have the necessary permissions and access to the specified files when running these commands.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

openai-rust's People

Contributors

yoichiojima-2 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.