GithubHelp home page GithubHelp logo

gpt-terminal-assistant's Introduction

GPT Terminal Prompt

A Python script that uses OpenAI's GPT models to generate text based on user input. Users can interact with the GPT engine and select code blocks returned by the model.

Installation

  1. Clone the repository or download the script files. git clone https://github.com/y4my4my4m/gpt-terminal-assistant.git

  2. Install the required Python packages using requirements.txt: pip install -r requirements.txt

  3. Set the environment variable for your OpenAI API key. You can find your API key in the OpenAI platform's dashboard.

    • For Linux or macOS:
      • export OPENAI_API_KEY="your-api-key"
    • For Windows:
      • set OPENAI_API_KEY="your-api-key"

Usage

Run the script using Python:

python main.py

  1. When prompted, select the chatbot engine you want to use (1 for chatGpt, 2 for GPT-4).
  2. Type your prompt and press Enter WHEN ON A NEW LINE. The GPT model will generate a response.
  3. If there are code blocks in the response, you can choose one to copy to the clipboard.
  4. Type 'exit' to quit the program.

Convenience

Personally, I've added the following to my ~/.zshrc for ease of use: alias chatgpt='env OPENAI_API_KEY=MY-API-KEY python ~/gpt-terminal-assistant/main.py'

License

This project is licensed under the MIT License.

gpt-terminal-assistant's People

Contributors

y4my4my4m avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.