Skip to content

aaronik/ai-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aaronik's zsh ai functions

zsh functions that integrate OpenAI LLMs into your command line.

Works on OSX and linux environments that use gnome.

Available commands

Command Description
ai General Purpose AI CLI tool. You can ask it to create a shell command, and it'll put it directly into the command buffer. You can ask it for information or to analyze piped in content, and it'll echo it to the terminal. You can ask it to generate images, and it'll generate some and open them in your browser. You can ask it to crawl the web for information.
ai-vision Screen grab, add text, ask vision model. Uses OS builtins for screen grab and text input/output popups. Designed to be mapped to an OS keyboard shortcut and used outside a terminal.
ai-openai-models Enumerate what models your OPENAI_API_KEY has access to. It just lists out all the openai models you currently have access to, easy peazy.

Requirements

Installation

In your ~/.zshrc, where path/to/ai-functions/ is this project's root,

# aaronik/ai-functions https://github.com/Aaronik/ai-functions export PATH=path/to/ai-functions/bin:$PATH # Get ai-openai-models and ai-vision source /path/to/ai-functions/ai.zsh # Source as zsh function so `print -z` works

Usage

Examples

ai

  • ai list all open ports
  • ai show me the weather in my local region
  • ai watch star wars in the terminal
  • ai monitor CPU and memory usage and alert if too high
  • ai convert all jpg images in a folder to png
  • ai create a new user with sudo privileges
  • ai set up a cron job to run a script every day at midnight
  • lsusb | ai disconnect from all bluetooth devices
  • ifconfig | ai port knock my local machine
  • tail -20 /var/log/syslog | ai is there any unusual activity in this log?
  • cat /var/log/auth.log | ai are there any suspicious login attempts here?
  • ai generate a medium size image of a dog meditating on saturn
  • ai generate a high quality image, in a realistic style, of a computer coming to life
  • ai say hello there, human, in a warm, female voice
  • summarize the headlines from today

others

  • ai-vision
  • ai-openai-models

Tweaks

You can set OPENAI_API_MODEL to specify what model you want, ex OPENAI_API_MODEL=gpt-4-preview-1106 ai list all open ports

Notes

You can see an old video demo of the ai() function here: https://youtu.be/a_5-7qCuzpw

About

A collection of CLI utilities for easily interacting with OpenAI AIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published