BuilderIO / ai-shell

A CLI that converts natural language to shell commands.
MIT License
4.22k stars 278 forks source link

Ability to inject command without executing it #29

Closed soumilroy closed 1 year ago

soumilroy commented 1 year ago

Hi @steve8708

I found myself wanting to learn some commands without executing them. For general questions, I would like the program to just insert code on terminal rather than execute it.

Screenshot 2023-04-11 at 4 22 06 AM

I'm thinking of something like this

Your script:

du -sm <directory>

Run this script?

Yes | Insert | Revise | Cancel

Is this something useful to add?

aabmets commented 1 year ago

@soumilroy I'm not entirely sure that this can be accomplished at all, because the program which returns the requested console command lives in its own separate subprocess and its not possible for subprocesses to insert data into the user input line of the command prompt.

soumilroy commented 1 year ago

Thank you for clarifying! In that case I would want to edit AI generated commands before execution on the same process if possible.

aabmets commented 1 year ago

@soumilroy That should be possible, but it depends on the capabilities of the libs that are used for the cli and prompt display. I haven't yet delved into these details, so I can't provide a concise answer, but at this moment this seems doable.

steve8708 commented 1 year ago

Released in v0.1.7!