Skip to content

A tool designed to seamlessly use gpt directly into the Windows Terminal environment. Users can interact with their terminal by enabling direct communication with GPT for problem-solving and command generation through natural language processing.

Notifications You must be signed in to change notification settings

rhouselyn/ai-cmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-CMD: Integrate GPT with Windows Terminal

AI-CMD is an innovative project designed to seamlessly integrate GPT capabilities with the Windows terminal, enabling users to directly ask questions and generate command-line code using natural language. By leveraging an OpenAI proxy, AI-CMD offers accessibility without the need for a VPN, simplifying the process of tackling terminal-related queries and automating command generation.


Getting Started

Installation

  1. Clone the project from GitHub:
    git clone https://github.com/rhouselyn/ai-cmd
    
  2. Navigate to the project directory and install the required packages:
    cd ai-cmd
    pip install -r requirements.txt
    
  3. run the setup:
    python setup.py
    
  4. Add the project directory to your system's PATH environment variable (or copy the dictionary in output of setup.py):
    • As for how to find the PATH environment variable, refer to this

Configuration

  • In config.py, input your api_key.
  • You can specify your preferred model and language settings for a tailored experience.

Usage & Feature

1. Generating Commands

It provide a simple process for generating commands using natural language. It doesn't provide much flexibility, but it's more convenient and faster.

  • 🏃 Typing gen followed by a directive in the terminal prompts GPT to translate it into a command, which is then copied to the clipboard automatically.
  • 💑 Connect multiple row operations using && or &

    image

  • 🎇 For potentially hazardous operations, it adds a cautionary note:

    CAUTION: This command is dangerous! image

2. Asking Questions

unlike gen, ask is used to ask questions with dialog context and get more responses.

  • 👢 Use ask followed by your question in the terminal. AI-CMD will automatically fetch the context from the terminal, process the inquiry with GPT, and generate a response.

    image

  • 😝 If the response contains terminal commands, they are automatically extracted and copied to the clipboard so that you can paste directly to the terminal.

    image

  • 🍔 You don't need to worry about consuming too much tocken, it will only intercept instructions from back to front until it exceeds 1000 words.
  • ✈️ Because of Windows don't provide any api for aproach to acquire history output in current dialog, a brief screen flash indicates the use of a virtual keyboard for copying and processing, ensuring the clipboard's content is promptly cleared afterwards.

error handling

  • ⭕ If the api speed limit is reached, the program automatically retries until it is lifted。
  • 🔴 Run time more than 15 seconds automatically exit the program

Credits

  • ❤️ This project draws inspiration from the cli-gpt project, adopting its approach to prompt design for effective and intuitive user interactions.
  • 💕 The document is mainly written by chatGPT4.

Please Enjoy a smoother, more interactive terminal experience with AI-CMD!

About

A tool designed to seamlessly use gpt directly into the Windows Terminal environment. Users can interact with their terminal by enabling direct communication with GPT for problem-solving and command generation through natural language processing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages