aicmd-apt

aicmd: Your AI-Powered Linux Command Assistant

License: MIT Linux

Overview

aicmd is a powerful command-line tool that transforms your natural language questions into executable Linux shell commands. Powered by Google’s Gemini AI, aicmd makes navigating the terminal easier for everyone, from beginners to seasoned users looking for quick command recall. Simply ask what you want to do, and aicmd will provide the command.

Features

Installation (For Users)

aicmd is designed for Debian/Ubuntu-based Linux systems.

  1. Ensure Prerequisites: Make sure you have curl and jq installed on your system. These are usually available by default, but you can install them if needed:
    sudo apt update
    sudo apt install curl jq
    
  2. Add the aicmd APT Repository: To allow apt to find and install aicmd, you need to add its repository to your system.
        wget https://haideryzai.github.io/aicmd-apt/aicmd-apt-repo-key.gpg -O /tmp/aicmd.gpg
        sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/aicmd-repo.gpg /tmp/aicmd.gpg
        echo "deb [signed-by=/etc/apt/trusted.gpg.d/aicmd-repo.gpg] https://haideryzai.github.io/aicmd-apt stable main" | sudo tee /etc/apt/sources.list.d/aicmd.list > /dev/null
    
  3. Install aicmd: Update your package lists to include the new repository, and then proceed with the installation of aicmd:
    sudo apt update
    sudo apt install aicmd
    

Usage Examples

Once installed, using aicmd is straightforward.

  1. Basic Usage: To get a Linux command, simply type aicmd followed by your query in double quotes:
    aicmd "how to list all files in the current directory, including hidden ones?"
    

    aicmd will display the suggested command. It will then ask if you want to execute it (e.g., Run? [y/N]).

  2. First-Time Setup: The very first time you run aicmd, it will prompt you to enter your Google Gemini API key. This key is securely stored in ~/.aicmd.env. You can obtain a Gemini API key from the Google AI Studio.

How to Update the Gemini API Key

If you need to change or renew your Gemini API key, use the following command:

```bash aicmd –renew-key