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.
- Clone the project from GitHub:
git clone https://github.com/rhouselyn/ai-cmd
- Navigate to the project directory and install the required packages:
cd ai-cmd pip install -r requirements.txt
- run the setup:
python setup.py
- 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
- In
config.py
, input yourapi_key
. - You can specify your preferred model and language settings for a tailored experience.
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 &
- 🎇 For potentially hazardous operations, it adds a cautionary note:
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. - 😝 If the response contains terminal commands, they are automatically extracted and copied to the clipboard so that you can paste directly to the terminal.
- 🍔 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.
- ⭕ 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
- ❤️ 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.