ibigio / shell-ai

A delightfully minimal, yet remarkably powerful AI Shell Assistant.
GNU General Public License v3.0
266 stars 25 forks source link

Feature Request - Cache the previous command for context #18

Open santiagomed opened 1 year ago

santiagomed commented 1 year ago

Hey @ibigio. Might be pretty useful if ShellAI takes in the previous command as context for the next response. I'd love to contribute so if this sounds good I can start writing the feature.

Quick example: This:

$ docker tag myImage myAcr.azurecr.io/myImage
$ q push the above image

    docker push <image_name>

Would turn into this:

$ docker tag myImage myAcr.azurecr.io/myImage
$ q push the above image

    docker push myAcr.azurecr.io/myImage

Let me know what you think!

ibigio commented 1 year ago

Hola Santiago! That's an awesome idea, and I would love it if you made a PR!

I've actually been thinking about that from the first iteration of ShellAI a couple years ago, and it feels like a natural direction for it to go.

Ideally ShellAI would take some smart subset of recent command history, which might require some clever history setup (which I've been avoiding thinking about). e.g. How do you make it "magical" so it always has the context you want, but nothing more. Give it a shot! I'm very curious what your solutions are.