- Enable chat AI to execute commands on linux with feedback-loop for multi-step missions
- Type
aicmd
in the Linux terminal to start - Automatically captures Linux commands in AI responses
- Asks for user confirmation before executing commands
- Supports AI in step-by-step execution of complex tasks
- Currently supports Gemini and ChatGPT, with plans to support the Ollama local model in the future
- Currently support English and Simplified Chinese interface, more languages are considering
- Multi-language support (currently only Simplified Chinese and English)
- Added
locales
file - Moved configuration files to
~/.config
folder - Project renamed to
LaphaeL-aicmd
- Improved help documentation printed when entering
/help
- Optimized use of poetry and nix (thanks to code contributions from DataEraserC)
Warning
- Attention! Although this program requires user confirmation to execute Linux commands, it is difficult to guarantee that there will be no bugs, so please do not run this program on systems with important data
- This program is still in an early stage, has only been tested on the Ubuntu 22.04 LTS distribution
-
Install poetry with the following command:
pip install poetry
-
Add environment variables:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc
-
Launch poetry and install dependencies:
cd /path/to/this/project/on/your/computer poetry shell poetry install
Before running the program each time, you need to start poetry with poetry shell
- google-generativeai module
- Install this module with the following command:
pip install -q -U google-generativeai
- Install this module with the following command:
- openai module
- Install this module with the following command:
pip install openai
- Install this module with the following command:
- toml module
- Install this module with the following command:
pip install toml
- Install this module with the following command:
- Execute the following command in the Linux terminal to open the file:
nano ~/.bashrc
- Add the custom command at the end of the file:
alias aicmd="python3 /path/to/this/program/LaphaeL-aicmd/main.py"
- Run the following command to apply the changes:
source ~/.bashrc
- Launch the program by typing
aicmd
in the terminal - The first launch requires entering the API key (Gemini's API key can be obtained free from Google AI Studio)
- Ensure your network environment can connect to the AI
Open the ~/.config/LaphaeLaicmd/data/AI_settings.toml
file (generated after the program runs for the first time)
- Change
[prompt](text)
and[custom_instruct](text)
to modify the prompts - Change
[info](select_ai)
to modify the AI type (default is ChatGPT, Gemini is also supported) - Change
[info_your-select-ai](api_key)
to set the API key (must be filled) - Change
[info_your-select-ai](model)
to change the AI model (default is gpt-4o)
- After entering your request, it is automatically sent to the AI
- If the AI's reply contains Linux commands, user confirmation is required with
[Y/n]
(pressing Enter also executes)
Tip
Try entering help me install Chrome
; create a folder on the desktop
; help me solve this problem
; what is my graphics card model?
- Enter text starting with '/' to execute program instructions:
- Print help text:
/
or/help
or/帮助
- Exit the program:
/exit
or/退出
- Print the content to be sent to AI (history since last sent):
/content
or/内容
- Clear the content to be sent to AI:
/clear
or/清空
- Manually execute a command, e.g., "example":
/cmd example
- Print help text:
- #10: Gemini might not reply “ready” or “准备就绪” since the instruction prompt is too long
If you encounter any issues, please inform us through GitHub issues: Click me to github issue page