This project solves thefollowing problem:
I love command line! Command line doesn't love me back. It is a difficult relationship.
It uses OpenAI™ to turn user intention into the appropriate command, making it easier to interact with Bash or other shells.
- Clone this project
git clone git@github.com:jkatnik/ai-shell.git
- Register at https://beta.openai.com/signup and create secret key. Note it down.
- On Ubuntu-based distributions, for extra features, install
xdotool
apt install xdotool
- run installation script
./install.sh
- Reload shell
source ~/.bashrc
- have fun
ai list files in my home folder
Basic usage:
$ ai list all text files in home dir
Reset conversation context and use new one
$ ai -n
Ask OpenAI a question
ai -q Who was the best soccer player ever?
If OpenAI™ fails, you can send the last question to google
$ ai -g
- Build an interactive CLI with Node.js by Hugo Dias
- Build an interactive CLI application with Node.js by Chatthana Janethanakarn
Use Node 16 or higher.
nvm use v16
- configStore should check if newly entered API key is valid
- documentation
- prepare a blog post
- configure license
- provide OS and shell version in the prompt context
- -i information (version, file locations, node version, authors, etc)
Maybe we can use standard stdin command forward
Example:
Open terminal 1
$ echo $$
296
Open terminal 2
$ echo -n 'ls -la' >> /proc/296/fd/0
Then in the terminal 1 you will see command ls -la