Skip to main content

tAI, a terminal AI assistant

Project description

tAI, a terminal AI assistant

tAI is a CLI that helps you with Linux and macOS terminal commands. Just ask it a question, and it will use AI to suggest a command and explain what it does. If you like the suggestion, the script can automatically run the command for you in your terminal.

Demo

BREAKING

Changing the name from lfg to tai. The package name is changed from lfg-llama to terminal-ai-assistant.

Why & What?

  • Github Copilot CLI syntax feels clunky to me
  • Faster than using Gemini, ChatGPT or similar in a browser
  • Simpler to find answers without checking man pages
  • NEW: Switching to the free GPT-4o model
  • NEW: Now you can run commands right from this command-line interface
  • NEW: New package name terminal-ai-assistant

However, never trust the output entirely.

Installation

# install pipx
brew install pipx

# add pipx binaries to path
pipx ensurepath

# restart your terminal
# install TAI
pipx install terminal-ai-assistant

Usage

This executable is using OpenAI, that means you need and API token.

GPT-4o is free to use.

Add the token to your .bashrc/.zshrc and reload your terminal.

export OPENAI_API_KEY={replace_me}

You can use either of these commands

$ tai <query>

Now you can use the executable

$ tai kill port 3000

fuser -k 3000/tcp

Explanation:
The `fuser` command identifies processes using files or sockets. The `-k` option is used to kill th
ose processes. Here, `3000/tcp` specifies the TCP port number 3000. This command effectively kills
any process currently using port 3000.

> Execute the command? (N/y):

Change the LLM

$ tai get pods from all namespaces

kubectl get pods --all-namespaces


Explanation:
The `kubectl get pods --all-namespaces` command lists all the pods across all namespaces in a Kuber
netes cluster. The `--all-namespaces` flag is used to fetch the pods from every namespace instead of the default namespace.

> Execute the command? (N/y):

Development

pip install --user pipenv
pipenv --python 3.11
pipenv install

pipenv run tai kill port 3000

TODO

  • Fix the setup and pyproject file, including github workflow for releasing the package

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

terminal_ai_assistant-3.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminal_ai_assistant-3.1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file terminal_ai_assistant-3.1.2.tar.gz.

File metadata

  • Download URL: terminal_ai_assistant-3.1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for terminal_ai_assistant-3.1.2.tar.gz
Algorithm Hash digest
SHA256 4386f4f6f3e67b970e461333be49793237b670a92a4a96828b9e4b34f5131c32
MD5 22a3eb98cfadf17a9e741ce56a54bb50
BLAKE2b-256 20ca5a33f22b9f54eeb18becc0d8920de0c4ab44a4cd1c55416b7e9a3bf51d54

See more details on using hashes here.

File details

Details for the file terminal_ai_assistant-3.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for terminal_ai_assistant-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2fcb11bd926a5a3a1b9ede4a7efac053baf76119c3838cc4d1d0cd3c6cdeb42
MD5 7408dd883d9ecaf5722eff939065745f
BLAKE2b-256 e87e81bd2d0507c78af5d582a913e3c738f3c57f8456352ea08738682134a9f3

See more details on using hashes here.

Supported by

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