Skip to content

Chat with AI directly from your shell. This is a simple tool I created for my own use.

Notifications You must be signed in to change notification settings

Liquorice10113/Shell_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shell AI

Chat with AI directly from your shell. This is a simple tool I created for my own use.

Setup

Install rich

pip install rich

Copy to System Environment

sudo cp ai.py /usr/bin/ai
sudo chmod +x /usr/bin/ai

Configure Your API Token

Create or edit the ~/.shell_ai_config file with your API token and URL:

{
    "api_url": "https://api.openai.com/v1/chat/completions",
    "api_token": "YOUR-TOKEN-HERE"
}

Usage

In Your Shell

To interact with the AI, simply type:

ai Can you show me some examples of markdown

If your prompt includes special characters, enclose it in quotes:

ai "Can you show me some examples of markdown?"

Include Shell Command Output

You can add output of a shell command to context.

ai exec [shell command]

For example, you can include a txt file in the context by ai exec cat text.txt:

Reset Context

To reset the AI's context, use the following command:

ai reset

About

Chat with AI directly from your shell. This is a simple tool I created for my own use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages