Chapter #7: How to Boost Your Linux Terminal Workflow with Aichat
Aichat is an open-source, Rust-based command-line interface (CLI) that enables seamless interaction with AI models directly from the terminal.

With the rise of AI, numerous tools are available for Linux and command-line users, each introducing new functionality or supporting different large language models (LLMs).
Among these, Aichat stands out - a powerful, Rust-based command-line interface that allows you to interact with AI directly from the terminal.
Packed with a variety of features and support for multiple LLMs, Aichat brings unique capabilities to streamline your daily tasks.
In this guide, weโll walk you through installing and using Aichat, highlighting what sets it apart from other AI tools.
What is Aichat
Aichat, as the name explains, is a Rust-based command-line interface to deal with AI LLMs inside the terminal. Whenever we hear Rust, we know the tool will be performant and smooth.
Aichat supports almost all the well-known LLMs, from OpenAI to Claude, Gemini, Ollama, Groq, and more.
It even adds support for RAG (Retrieval-Augmented Generation), which is a combination of AI and private text and sources to make responses more accurate.
Besides this, Aichat has many other features:
- All AI in one place: Instead of using multiple tools to switch between LLMs, Aichat has this ability, so you can use your preferred LLMs and switch between them as needed. Plus, you can choose the model you need along with LLMs.
- Configuration file: Aichat has a configuration file, which you can use to configure your LLMs. Whether you need to change the temperature, proxy, or max token limits, a file is there for you to do all of this.
- Offline mode: Aichat can work without the internet if you set up a local LLM. The internet is needed only for API calls.
We just listed the most important features, along with many other features!
Install and Configure Aichat
The installation of Aichat can be done in many ways, depending on your environment and the tools that you use.
If you have Rust and Cargo installed, you can install Aichat like this:
cargo install aichat
If you have Homebrew or Linuxbrew, you can install it with the following command:
brew install aichat
If you are on Arch or an Arch-based distribution, you can install it using Pacman like this:
pacman -S aichat
Another way to install it is by using the binary file, which can be downloaded from the GitHub releases here:
Extract it using the tar command, and make sure to replace filename
with the name of the file you downloaded.
tar xzvf filename
After extraction, move the binary file to the bin
directory to make the tool system-wide:
mv aichat /usr/local/bin/
Configuration of Aichat
After downloading, you just need to type the tool name and start configuring it with the LLMs you need. As we said before, the tool supports multiple LLMs that you can choose from - some of them are free, and some are paid.
Choose your preferred one and get the API key, which we will need for the setup.
Now, run the aichat
command in the terminal to create the config file. Hit y
to create it.

Next, it will ask you to choose your provider. Choose one; this time, I will go with Gemini:

Next, it will ask you to choose the model. I will choose gemini-1.5-flash-latest
as it's the free one:

Now we have finished the configuration, and we are ready to start using the Gemini LLM inside our terminal.

Note: To get the API key for Gemini, navigate to this link and create one.

The configuration file that the tool creates will be located here: .config/aichat/config.yaml
, where you can add and modify the configuration.
Since we just installed the tool, you will find the LLM model and the API key.

Aichat Use Cases
Just like other AI tools that we use, there are plenty of tasks that Aichat can handle, from text assignments like explanation and summarization to automating tasks like managing Docker and Kubernetes.
Coding Assistant ๐ป
Aichat can help you with coding assignments, whether explaining a code snippet or generating one. For example, suppose you need a Python script to merge two sorted lists -you can do it like this:

Aichat will guide you through the code with an explanation of each step.
You can also pass a file containing code and ask Aichat to explain or debug it in case you cannot identify the error.
To pass a file, you can do it like this:
aichat --file code.sh "Explain the code in this file"
Aichat will explain the code inside the file.
Automate Tasks ๐ค
If you are a Linux sysadmin or a DevOps engineer, you probably need Aichat to automate daily tasks like managing Linux servers, Git, Docker, and Kubernetes.
Let's say we want to start learning Kubernetes but donโt know how to set it up or where to start.
Hereโs how we can do it using Aichat:
aichat "I want to learn Kubernetes. Can you guide me on how to set it up and provide a learning roadmap?"
The output will be like this:

Aichat will guide you and provide all the steps you need to achieve your goal.
Switch Between LLMs ๐
One of the best options that Aichat has, and that does not exist in other tools, is the ability to switch between LLMs and even the model for each LLM.
All you need to do is set up the configuration for the LLMs you want to use inside the configuration file located at .config/aichat/config.yaml
.
Then, you can easily ask Aichat and specify the LLM you want to use.
For example, suppose I need to summarize an article using two different LLMs to ensure I get the most accurate information (this is just an example). Generally, comparing LLMs is important when performing specific complex tasks.
Ask Gemini like this:
aichat -m gemini "Summarize this article: https://www.tecmint.com/linux-troubleshooting-tips/"
The flag -m
is used to specify the model. Here, we are asking Gemini to summarize the article, and the output will be like this:

If we need to ask OpenAI, we can do it like this:
aichat -m openai "Summarize this article: https://www.tecmint.com/linux-troubleshooting-tips/"
As we said, this is just an example, you can adjust it to your use case. If you donโt get the response you need, switch to another LLM.
To get an idea about the LLMs that are free and those that require payment to use with Aichat, here is a list and category of each one of them:

Configure Aichat Theme ๐จ
Aichat has a cool feature: theme customization. You can change the output theme if you donโt like the default one. You can find the default themes here:
To change the theme, download the theme you like from the list of themes provided. Next, create a folder called themes
inside the Aichat configuration directory:
mkdir -p ~/.config/aichat/themes
Copy the theme you downloaded to ~/.config/aichat/themes
. To activate the theme, you need to adjust the configuration file to use the desired theme:
nano ~/.config/aichat/config.yaml
Add the name of the theme you want:
theme: "~/.config/aichat/themes/my_custom_theme"
Change my_custom_theme
to the name of the theme you downloaded.
Aichat Web Interface ๐ป
Aichat has a web interface included to test and compare LLMs, and can be served using the simple command aichat --serve
.
You will see an output like this:

If you navigate to the provided link, for example, http://127.0.0.1:8000/playground
, you will get an interface like this where you can chat with AI:

Conclusion
Aichat is a great tool to use and explore. Compared to other tools we explored, this can be an advanced tool and has many features that other tools donโt have.
In this guide, we explain how to set up and use the tool in the terminal, and we provide some use cases where the tool can help boost productivity and task completion.