Skip to main content

Boost your terminal's intelligence with LLM: intuitive command assistance, seamless customization, and predictive next steps at your fingertips.

Project description

Termax

Downloads PyPI - Version

Similar to GitHub Copilot CLI, Termax is a personal AI assistant in your terminal.


...

It is featured by:

  • 🍼 Personalized Experience: Optimize the command generation with RAG.
  • 📐 Various LLMs Support: OpenAI GPT, Anthropic Claude, Google Gemini, Mistral AI, Ollama, and more.
  • 🧩 Shell Extensions: Plugin with popular shells like zsh, bash and fish.
  • 🕹 Cross Platform: Able to run on Windows, macOS, and Linux.

Installation

pip install termax

Quick Start

[!TIP]

  • After installation, you'll need to configure the LLM (e.g., set the OpenAI API key).
  • A setup guide will automatically launch the first time you use Termax.
  • Alternatively, you can manually initiate configuration at any time by running t config or termax config.
  • Please read ℹ️ and warnings under each feature before using to ensure your data safety.

Ask Commands

You can start using Termax by asking using command t or termax, for example:

t show me the top-5 CPU processes

You can also use Termax to control your software:

t play a song using Spotify

Here is a more complex example:

ℹ️ Note: Be aware of privacy implications. This feature collects the following info into LLM prompt.

  • System Info: os, hardware architecture
  • Path Info: username, current directory, file names in directory

Guess Commands (experimental)

Termax can predict your next move based on your command history, workspace information, and so on — just try t guess or termax guess to generate a suggested command. It's not only smart, it's fun!

t guess

Here is an example that Termax guesses my next move:

[!WARNING]

This feature automatically inserts the last 15 commands from your shell history into the LLM prompt. If your command history contains sensitive information, please refrain from using this feature to ensure your data remains secure.

Shell Plugin

We support various shells like bash, zsh, and fish. You can choose to install the plugins by:

t install -n <plugin>

The <plugin> can be any of zsh, bash, or fish. With this plugin, you can directly convert natural language into commands using the Ctrl + K shortcut.

You can also easily uninstall the plugin by:

t uninstall -n <plugin>

Remember to source your shell or restart it after installing or uninstalling plugins to apply changes.

Configuration

Termax has a global configuration file that you can customize by editing it. Below is an example of setting up Termax with OpenAI:

[general]                  # general configuration
platform = openai          # default platform
auto_execute = False       # execute the generated commands automatically
show_command = True        # show the generated command
storage_size = 2000        # the command history's size, default is 2000

[openai]                   # platform-related configuration
model = gpt-3.5-turbo      # LLM model
api_key = <your API key>   # API key
temperature = 0.7
save = False

[!TIP]

  • The configuration file is stored at <HOME>/.termax, so as the vector database.
  • For other LLMs than OpenAI, you need to install the client manually.
  • We utilize ChromaDB as the vector database. When using OpenAI, Termax calculates embeddings with OpenAI's text-embedding-ada-002. For other cases, we default to Chroma's built-in model.

Retrieval-Augmented Generation (RAG)

Our system utilizes a straightforward Retrieve and Generate (RAG) approach to enhance user experience continuously. Each time the command generation feature is used, Termax captures and stores a "successful example" in a local vector database. This "successful example" comprises the command that was successfully executed without errors, along with the user's description that prompted this command. These entries serve as valuable references for future command generations based on similar user descriptions.


...

Additionally, we gather external information crucial for effective prompting engineering. This includes system details such as the operating system version and the structure of files in the current workspace. This data is essential for generating precise commands that are compatible with the user's current system environment and are pertinent to file management operations.

Contributing

For developers, you can install from source code to enable the latest features and bug fixes.

cd <root of this project>
pip install -e .

We are using PEP8 as our coding standard, please read and follow it in case there are CI errors.

License

Licensed under the Apache License, Version 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termax-0.1.4.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

termax-0.1.4-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file termax-0.1.4.tar.gz.

File metadata

  • Download URL: termax-0.1.4.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for termax-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c8ddaf5c3ac63887bd905a0dde11eb56ed8f27860f0b4dc8c34ace9819010e27
MD5 fa5f0645a40985df5868479e65e1874f
BLAKE2b-256 15e081d68c5dafd6ad989d7896cd54d07837a9ea6287c196dcf36cb9af8ba16f

See more details on using hashes here.

File details

Details for the file termax-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: termax-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for termax-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 82b5f6df7e29c061f2185f02089a91623a52905694a8502eb2dedc672f0ac1e9
MD5 d6ae899eb115c29b2086e210a4c5d122
BLAKE2b-256 b2b74819da80abf572992382cbac9e738a4ed1553228232d3003e93c10aa8560

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page