Giter VIP home page Giter VIP logo

ai.sh's Issues

Convert ai.sh to a ZSH file

When you execute a command I would like to write it to ~/.zsh_history using print -S https://unix.stackexchange.com/a/651706. Since the file is bash right now it isn't easy to just tell zsh to do this since the user might have multiple zsh binaries on their computer and we might write it the wrong way if just try to call zsh -c. For example, this does not work for me:

$ bash
bash-5.2$ zsh -c "HISTFILE=~/.zsh_history print -S 'foo bar'"

this outputs something in the wrong format to the hist file. Also the name of the ZSH history file is non-standard so we can't even assume that is the right file

Update project to new OpenAI CLI

I get errors when running ai.sh with the current version of the openai CLI. Did you try already to make it work again with the current CLI version and with GPT-4 instead of GPT-3.5-Turbo?

zsh history fix causes bother with bash

#5 unfortunately assumes that HISTFILE is defined, and that's not the case when this is used with bash, where a shell script doesn't have access to this variable.

Could wrap that code within inject_into_zsh_history with something like:

if [[ -v HISTFILE ]]; then
   ....
fi

Perhaps?

pbcopy: command not found; which -s invalid option

For everythng to work in Ubuntu I had to do these:

alias ai=`/bin/readlink -f /path/to/ai.sh`

Make sure you have xclip or install it. Then, in ai.sh, change this line:

pbcopy < "$completion_temp_file"

to:

xclip -sel clip < "$completion_temp_file"

In ai.sh change this line:

which -s "$1" > /dev/null

to:

which "$1" > /dev/null

Then I was able to use this great software!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.