Termite is a powerful tool for quickly prototyping terminal applications to solve real-world problems effortlessly. Whether you need to check which ports are active, monitor Redis queue throughput, manage Docker containers, or compare SQL tables, Termite has you covered.
It simplifies the process by generating and executing Python scripts that create functional terminal UIs using libraries like urwid
, rich
, curses
, or textual
. Just describe what you want to build, and Termite will handle everything—from creating a design document to implementing and refining the interface. Once ready, your TUI is saved and instantly available in the ~/.termite
directory.
Fully open source under the Apache License 2.0, Termite is a great project for open-source contributors looking to make an impact. Start building innovative terminal apps with Termite and take your productivity to the next level!
Resource
GitHub
Link: https://github.com/shobrook/termite
Prerequisites for Installing Termite
Make sure you have the following:
- GPUs: 1xRTXA6000 (for smooth execution).
- Disk Space: 40 GB free.
- RAM: 48 GB(24 Also works) but we use 48 for smooth execution
- CPU: 48 Cores(24 Also works)but we use 48 for smooth execution
Step-by-Step Process to Install Termite
For the purpose of this tutorial, we will use a GPU-powered Virtual Machine offered by NodeShift; however, you can replicate the same steps with any other cloud provider of your choice. NodeShift provides the most affordable Virtual Machines at a scale that meets GDPR, SOC2, and ISO27001 requirements.
Step 1: Sign Up and Set Up a NodeShift Cloud Account
Visit the NodeShift Platform and create an account. Once you’ve signed up, log into your account.
Follow the account setup process and provide the necessary details and information.
Step 2: Create a GPU Node (Virtual Machine)
GPU Nodes are NodeShift’s GPU Virtual Machines, on-demand resources equipped with diverse GPUs ranging from H100s to A100s. These GPU-powered VMs provide enhanced environmental control, allowing configuration adjustments for GPUs, CPUs, RAM, and Storage based on specific requirements.
Navigate to the menu on the left side. Select the GPU Nodes option, create a GPU Node in the Dashboard, click the Create GPU Node button, and create your first Virtual Machine deployment.
Step 3: Select a Model, Region, and Storage
In the “GPU Nodes” tab, select a GPU Model and Storage according to your needs and the geographical region where you want to launch your model.
We will use 1x RTX A6000 GPU for this tutorial to achieve the fastest performance. However, you can choose a more affordable GPU with less VRAM if that better suits your requirements.
Step 4: Select Authentication Method
There are two authentication methods available: Password and SSH Key. SSH keys are a more secure option. To create them, please refer to our official documentation.
Step 5: Choose an Image
Next, you will need to choose an image for your Virtual Machine. We will deploy Termite on an NVIDIA Cuda Virtual Machine. This proprietary, closed-source parallel computing platform will allow you to install Termite on your GPU Node.
After choosing the image, click the ‘Create’ button, and your Virtual Machine will be deployed.
Step 6: Virtual Machine Successfully Deployed
You will get visual confirmation that your node is up and running.
Step 7: Connect to GPUs using SSH
NodeShift GPUs can be connected to and controlled through a terminal using the SSH key provided during GPU creation.
Once your GPU Node deployment is successfully created and has reached the ‘RUNNING’ status, you can navigate to the page of your GPU Deployment Instance. Then, click the ‘Connect’ button in the top right corner.
Now open your terminal and paste the proxy SSH IP or direct SSH IP.
Next, if you want to check the GPU details, run the command below:
nvidia-smi
Step 8: Check the Available Python version and Install the new version
Run the following commands to check the available Python version.
If you check the version of the python, system has Python 3.8.1 available by default. To install a higher version of Python, you’ll need to use the deadsnakes
PPA.
Run the following commands to add the deadsnakes
PPA:
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
Step 9: Install Python 3.11
Now, run the following command to install Python 3.11 or another desired version:
sudo apt install -y python3.11 python3.11-distutils python3.11-venv
Step 10: Update the Default Python3
Version
Now, run the following command to link the new Python version as the default python3
:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
sudo update-alternatives --config python3
Then, run the following command to verify that the new Python version is active:
python3 --version
Step 11: Install and Update Pip
Run the following command to install and update the pip:
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade pip
Then, run the following command to check the version of pip:
pip --version
Step 12: Install Pipx
Run the following command to install the pipx:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
Now, execute the following command to restart your terminal or run:
source ~/.bashrc
Then, run the following command to check the version of pipx:
pipx --version
Step 13: Install Termite-ai
Run the following command to install the termite-ai:
pipx install termite-ai
Step 14: Create OpenAI API Key
To use the OpenAI API, you need to create an API key. This key will allow you to securely access OpenAI’s services. Follow these steps to generate your API key:
Visit the OpenAI platform and log in to your account. If you do not have an account, you will need to sign up.
Once logged in, navigate to the top right corner of the page where your profile icon is located. Click on it and select API from the dropdown menu. Alternatively, you can directly access the API section by clicking on API in the main dashboard.
In the API section, look for an option that says Create new secret key or View API Key. Click on this option.
After clicking on create, a new API key will be generated for you. Make sure to copy this key immediately as it will only be shown once.
Step 15: Export OpenAI API Key
Run the following command to export the OpenAI API Key:
export OPENAI_API_KEY="your api key"
Step 16: Run Termite
Finally, execute the following command to run the termite:
termite
Conclusion
In this guide, we introduced Termite, a fully open-source tool for building generative terminal user interfaces to solve everyday challenges. From real-time monitoring to managing resources and comparing data, Termite simplifies terminal UI development with ease. We also provided a step-by-step overview of how Termite works, including its seamless process of generating and refining terminal applications. By following this guide, you’ll be ready to leverage Termite’s capabilities to enhance productivity, customize your workflows, and even contribute to its development as part of the open-source community.