Live data from Hacker News

An interactive cheatsheet tool for the command-line

github.com

21–30 of 49 posts

Re: An interactive cheatsheet tool for the command-line

#23

Once I tried a tool like this, but just realized, there is already a method of that: the ~/bin folder. You can write bash scripts, or scripts in any programming language with the proper shebang line, you can download other people's scripts, and you don't need bash history to keep them. Listing all of them is just an ls. I tend to not put file extensions of them and use good naming, so you can see everything without l…

Great! Now, how does that bash syntax go again...? This is why I have a similar tool for command line cheat sheet snippets - recalling bits of syntax to be combined into a command or a script.

As GP, mentioned, you put the correct shebang. I write stuff in Python and make them as pipe-capable as possible. You don't have to bend hell and flip it upside down to write scripts.

Re: An interactive cheatsheet tool for the command-line

#25

Once I tried a tool like this, but just realized, there is already a method of that: the ~/bin folder. You can write bash scripts, or scripts in any programming language with the proper shebang line, you can download other people's scripts, and you don't need bash history to keep them. Listing all of them is just an ls. I tend to not put file extensions of them and use good naming, so you can see everything without l…

And then rofi for great good!

Re: An interactive cheatsheet tool for the command-line

#26
Looks neat. I wish, though, there was a way to try it out in the browser as advertised without having to sign up or login. Might be a requirement of the site hosting the demo but whoever it is, forcing login is always and forever a deal breaker for me.

Re: An interactive cheatsheet tool for the command-line

#27
Looks really nice;

I don't like the fact that an unknown command is executed before i can see/inspect what it is. Currently you won't even see what command was executed afterwards, you only see the result...

Would be nice to be able to also show the command below the item/result.

--print is possible, but it's cumbersome and not interactive: you can't "accept" the command after inspecting, and execute it.

Re: An interactive cheatsheet tool for the command-line

#28
Looks like a really useful tool. Another tool I use like this is bropages or the `bro` command(1) which gives many examples similar to this for any command like ls, docker, etc. Sometimes it's useful when you don't have time to read the entire man page.

(1) https://www.ostechnix.com/3-good-alternatives-man-pages-ever...

Re: An interactive cheatsheet tool for the command-line

#29

Once I tried a tool like this, but just realized, there is already a method of that: the ~/bin folder. You can write bash scripts, or scripts in any programming language with the proper shebang line, you can download other people's scripts, and you don't need bash history to keep them. Listing all of them is just an ls. I tend to not put file extensions of them and use good naming, so you can see everything without l…

    > ... there is already a method of that: the ~/bin folder.
More power to you if you can do that, but for me it's a memory problem and a problem of being able to figure out WTF options I need when I am in the middle of something.

man pages (and --help) are great if you have the time to sit down, ponder and experiment. But when you're trying to get stuff overwith, a massive wall of historically interesting text just isn't helpful.

The vast majority of invocations of any given command, I suspect, are limited to a not more than a handful of use-cases. In other words just enough combinations of arguments and options to perform a small number of different tasks. This is what people are typically interested in when they're on the command line. In that context getting massive dump of every possible option in a man page is frustrating and counter-productive.

For example, "tar". I use this command in 2 simple ways: archive a directory into a gzipped tar or extract a gzipped tar. This is what effectively everyone uses it for >99% of the time: toggle between a directory and a tar.gz file.

Basically... just 2 forms "tar -zxvf" and "tar ..." oh shit, I forgot how to tar/compress a directory, let's check the man page... ok "tar -cf" to create a tar, but wait I want it gzipped, and actually I forgot what the z, v and f stand for, now I need look each of those up, wait, do I really mean gzip? or bzip, oops more research.

To be fair, tar might be too easy an example but you can easily go down a manpage-rabbit-hole because of a lack of common usage examples.

Re: An interactive cheatsheet tool for the command-line

#30

Earlier quoted context omitted.

Great! Now, how does that bash syntax go again...? This is why I have a similar tool for command line cheat sheet snippets - recalling bits of syntax to be combined into a command or a script.

As GP, mentioned, you put the correct shebang. I write stuff in Python and make them as pipe-capable as possible. You don't have to bend hell and flip it upside down to write scripts.

Sure - I use both bash and python for this purpose. Sometimes bash really is the right tool for the job, for example, when you need to use a lot of other complex CLI utilities, or when pipelines of simple commands get the job done in a simpler way.

I'm just explaining why a command line cheat sheet tool is useful to me. I don't need to be convinced that it isn't.

Post reply on HN