Live data from Hacker News

Show HN: Get answers for shell commands from GPT3 from your terminal

github.com

71–80 of 97 posts

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#71
post #22

On one hand I can see how this would be incredibly useful (I can never remember what ffmpeg flags I need) but I also just,,,,, I have this immediate uncomfortable reaction to the thought of just piping AI output into the terminal with the express purpose of not needing to know what the flags do. If the AI makes a mistake and the only way to catch it is to know what the flags do anyways, I think this becomes less usef…

This reminds me how people in lesswrong community were arguing whether it's inevitable that when general AI is created - it will escape its sandbox. There were elaborate schemas how it will persuade or blackmail the scientists to let it out. In practice it won't need to, somebody will make a plugin that uses it to download funny images or highlight code in console :)

"escape its sandbox" ... it's more useful outside the sandbox, so... we just let it loose

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#72

Bash / Shell is one of the last things I would trust a typical AI considering how much bad shell code/examples exist out there. (it always surprise me how many unquoted variables exist in most shell scripts; quoting fixes many problems, doesn't hurt and still developers are often to lazy to do it) The example in the project readme is imo already a bad example. $ ai ask "Check process running on port" Answer Command i…

You can ask GPT for variations. Also, combining this with thefuck might circumvent most issues.

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#73

Earlier quoted context omitted.

I sort of agree wrt quoting. Most people's solution is just "well don't use spaces or dollars or whatever in your filenames!" which is obviously shit. But on the other hand I think the ultimate blame lies with Bash for being so shitily designed that you can make basic quoting mistakes and it works most of the time. Real programming languages don't have that issue.

It's not a real programming language tho

So why do people write real production code in it?

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#74

Bash / Shell is one of the last things I would trust a typical AI considering how much bad shell code/examples exist out there. (it always surprise me how many unquoted variables exist in most shell scripts; quoting fixes many problems, doesn't hurt and still developers are often to lazy to do it) The example in the project readme is imo already a bad example. $ ai ask "Check process running on port" Answer Command i…

I sort of agree wrt quoting. Most people's solution is just "well don't use spaces or dollars or whatever in your filenames!" which is obviously shit. But on the other hand I think the ultimate blame lies with Bash for being so shitily designed that you can make basic quoting mistakes and it works most of the time. Real programming languages don't have that issue.

Yes, the convention is shit.

Alas, the things that force it are also shit. Overall, it is an improvement.

Want real fun. touch -- --help # or similar. :)

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#75
post #60

Earlier quoted context omitted.

So does Java, yet it is still considered a real programming language...

I always have to share this video on threads like these: https://youtu.be/kdMG40wUCm4 . Maybe you’ve seen it - interview with a senior Java developer in 2022.

Let me summarize. Java, the good parts:

> We don't actually use Java. We use Scala.

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#76
post #60

Earlier quoted context omitted.

So does Java, yet it is still considered a real programming language...

I always have to share this video on threads like these: https://youtu.be/kdMG40wUCm4 . Maybe you’ve seen it - interview with a senior Java developer in 2022.

> It has clean code and a clear architecture which makes it perfect for serious business

I love how vague and meaningless this is, yet I still feel like I've heard this sentence said unironically a hundred times.

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#77
post #47

Earlier quoted context omitted.

lsof is available on Mac's by default, ss is not, so significantly smaller depends on your platform I guess. I believe ss is not available for Mac at all, where as lsof is widely available.

Well that is one of the problems when suggesting shell snippets. There are many similar ways to do the same thing¹ but most have some caveats or work on one system but not the other. And when asking the AI there might be not enough context to provide a good answer. In this case the AI answer might be somewhat better for Mac. On Linux I have more often manually installed lsof than ss (iproute2). Maybe Mac provides the…

Doesn’t seem like a huge stretch for the AI to check uname and see what system you’re on in order to clarify the answers.

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#78
post #47

Earlier quoted context omitted.

lsof is available on Mac's by default, ss is not, so significantly smaller depends on your platform I guess. I believe ss is not available for Mac at all, where as lsof is widely available.

Well that is one of the problems when suggesting shell snippets. There are many similar ways to do the same thing¹ but most have some caveats or work on one system but not the other. And when asking the AI there might be not enough context to provide a good answer. In this case the AI answer might be somewhat better for Mac. On Linux I have more often manually installed lsof than ss (iproute2). Maybe Mac provides the…

No -p flag for netstat on Mac and -l has different purpose. Closest you can get is

  netstat -anv
And then you need to filter for LISTEN.

I'm sure there is a few ways to skin the cat, but on Mac the most equivalent to the ss command would probably be:

  sudo lsof -iTCP:8000 -sTCP:LISTEN -n -P

Re: Show HN: Get answers for shell commands from GPT3 from your terminal

#79

Bash / Shell is one of the last things I would trust a typical AI considering how much bad shell code/examples exist out there. (it always surprise me how many unquoted variables exist in most shell scripts; quoting fixes many problems, doesn't hurt and still developers are often to lazy to do it) The example in the project readme is imo already a bad example. $ ai ask "Check process running on port" Answer Command i…

[deleted]
Post reply on HN