Skip to content

seanrokah/Ai_Command_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Linux and Windows Command Generator using OpenAI GPT

Overview

This Python script is an interactive command-line tool that generates Linux or Windows commands based on user input. It leverages OpenAI's GPT model (gpt-4o-mini) to generate shell commands and provides an option to execute them directly from the terminal.

Features

  • πŸ–₯️ Detects the user’s operating system (Linux/macOS or Windows).
  • πŸ€– Uses OpenAI's API to generate a command based on a natural language description.
  • πŸ” Displays the generated command for user approval.
  • ⚑ Allows users to execute the command directly from the terminal.

Requirements

πŸ“Œ 1. Install Python (if not installed)

πŸ“Œ 2. API KEY for OPENAPI (as as ENV_VARIABLE)

πŸ“Œ 3. Import openapi (if not installed)

Usage

πŸš€ Run The script

python CommandGenerator

βš™οΈ Choose your os

1  # For Linux/macOS
2  # For Windows

πŸ“ 3. Describe the Command

Please describe the command you want: list all files in the current directory

example output :

ls -l

πŸ—οΈ 5. Execute the Command (Optional)

Do you want to run the command? (yes/no):

Security Considerations

β€’	πŸ”Ž Always review the generated command before executing it, as AI-generated commands might be incorrect or harmful.
β€’	❗ This script does not validate the command’s safety before execution. Use with caution.
β€’	πŸ›‘ Running AI-generated commands as root/admin can be dangerous.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages