3 ms·
I’m very lazy. Sometimes I’m lazy even to switch window from terminal to chatgpt. Yet alone copy and paste command from gpt to terminal, and back. So I create a
by medv 2y ago
I’m very lazy. Sometimes I’m lazy even to switch window from terminal to chatgpt. Yet alone copy and paste command from gpt to terminal, and back. So I create a very simple helper, which uses TIOCSTI to insert gpt response as input in terminal, so I can modify it right away and run.
Her is my workflow:
Start typing command I want to run lsof -
Figure out, what I forgot the name flags, lsof -tcp 8089
Press, ctrl+g and allow my helper to query GPT with my command as prompt.
Verify and edit returned command from GPT
Run it (press up to retrieve howto command from history to adjust prompt).
Notes:
Works on macOS and Linux
Does NOT work on Windows (just prints to stdout), i don’t know how to “fake input” on windows