7 ms·
An interactive cheatsheet tool for the command-line
- dnsfr 7y agonavi allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands, prompting for argument values.
- lapnitnelav 7y agoThanks for releasing that Denis. Combining both cheatsheets and a better UX is brilliant. Wish I had this years ago when trying to wrap my head around the shell.
- blondin 7y agonot only this looks super awesome but this is also the first time i have seen a shell program architected in such a nice way.
- imposterr 7y agoWow, this is really cool. I assumed this was going to be written in go or rust, but taking a look it's actually all bash! I'm always surprised by how much people can get out of bash. It's also some of the cleanest bash I've seen. Definitely going to be using some of these patterns for my own scripts.
- kissgyorgy 7y agoOnce 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 looking into them.
- AdieuToLogic 7y ago> Once I tried a tool like this, but just realized, there is already a method of that: the ~/bin folder. One thing I'd add to this is that "crib notes" can be captured in man[0] pages. For example, having them in $HOME/man and ensuring MANPATH[1] includes it serves as a nice complement IMHO. There seems to be a markdown-based tool[2] which can assist in authoring them too. EDIT: It looks like pandoc[3] can generate man pages from markdown as well. 0 - https://forums.freebsd.org/threads/howto-create-a-manpage-from-scratch.13200/ https://forums.freebsd.org/threads/howto-create-a-manpage-fr... 1 - https://www.freebsd.org/cgi/man.cgi?query=man&apropos=0&sektion=0&manpath=FreeBSD+12.0-RELEASE+and+Ports&arch=default&format=html https://www.freebsd.org/cgi/man.cgi?query=man&apropos=0&sekt... 2 - https://spin.atomicobject.com/2015/05/06/man-pages-in-markdown-ronn/ https://spin.atomicobject.com/2015/05/06/man-pages-in-markdo... 3 - https://pandoc.org/MANUAL.html https://pandoc.org/MANUAL.html
- nessunodoro 7y agoto these great refs I would recommend the Ruby tool ronn https://github.com/rtomayko/ronn https://github.com/rtomayko/ronn
- alanbernstein 7y agoGreat! 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.
- grenoire 7y ago
- otroquecorre 7y agoSimply brilliant. Making bash easier
- faizshah 7y agoThis is really cool, I remember a similar effort being posted here a few years ago: https://news.ycombinator.com/item?id=7121268 https://news.ycombinator.com/item?id=7121268 I really like this implementation!
- kenshinji 7y agoDoes it also work in zsh?
- OJFord 7y agoNot sure what you mean, the shebang line is bash, so you need bash installed, but invoking it from zsh shouldn't cause a problem any more than invoking anything else could. If you meant 'why is the shebang line bash, isn't it POSIX compliant' - I don't know. Looks nice though. Not sure I fully understand how the chaining/'prompts you for arguments' works (from UX perspective) but keen to give it a go.
- pcr910303 7y agoThis is pretty cool! It’s great to see that lots of tools are trying to make the command line less intimidating, and adopting more friendly methods than the man pages. About the cheatsheets itself, it might be great to share the cheatsheets with a project sharing somewhat similar goals, tldr.sh[0] (which focuses less on interactivity but more on completeness and practicality). I’m more than excited to see the shell being more approachable. I have introduced the shell to quite a lot of my non-programmer friends with package managers and bulk renaming, but they don’t use the shell enough to memorize all of the commands. These efforts lower the barrier to use the shell... hence making the demonstration of the command line’s powers more easy. [0] https://tldr.sh https://tldr.sh
- OJFord 7y agoThis looks cool, a common workflow of mine is `cmd --blah --blah ` ah damn I don't know the value for blah, okay, fzf ` --blah=(blahgen | fzf) ` oh I'm also missing [...] This seems like it can help do the same thing more quickly, so I'm keen to give it a go. I do like shell history though, a shame to just have a bunch of `navi` entries - I wonder if it could be faked; populated with the chosen command afterwards?
- rmetzler 7y agoOh, you just gave me an idea of turning fzf into a filter for $CMD --help. I need to try this.
- dnsfr 7y agoI could write a zsh/bash plug-in so that it fills the prompt instead of running the command, in the same manner as ctrl-r. What do you think?
- rroblak 7y agoThat would make the difference between me using this tool and not using this tool. Losing my shell history isn't worth a momentary ergonomics gain.
- rushi_agrawal 7y agoSimilar concept: cheat.sh
- dnsfr 7y agoI'll add it to the "alternatives" section
- ozzmotik 7y agooh this is really cool, thanks for sharing. i also really appreciate that you have links to other projects that offer similar features so people can contrast and compare and find what works best for them.
- davidjhall 7y agoIs there a key command or way to find out what's below the cheat? For instance, I tried the "local ip address" example in the demo and it gave the IP address but now 'how' -- ifconfig? was it in a text file? env var? script?
- mikelward 7y agoAppears to be implemented here. https://github.com/denisidoro/navi/blob/master/cheats/network.cheat https://github.com/denisidoro/navi/blob/master/cheats/networ... I'd nitpick on the implementation, but the point is you can change it. :)
- mikelward 7y agoOn Linux, you can do something more robust that also supports IPv6 based on ip -o a sh up primary scope global
- dnsfr 7y agoBased on your input, the latest version has a preview window: https://user-images.githubusercontent.com/3226564/65380182-6.. https://user-images.githubusercontent.com/3226564/65380182-6.... Alternatively, you can use the --print option I hope you like it!
- anchpop 7y agoIs there any way to run this on Windows, for people who use Cygwin or Git Bash? It seems really cool and useful
- dnsfr 7y agoI think it should work out of the box. Did you get any error?
- matthewtovbin 7y agoGreat tool!!!
- acoustep 7y agoThis looks really cool. I’ve been building something similar in Crystal to scratch my own itch - https://video.twimg.com/tweet_video/EEQqvAeWkAAx3-3.mp4 https://video.twimg.com/tweet_video/EEQqvAeWkAAx3-3.mp4
- oyebenny 7y agoI want to use this, but I'm afraid of it be deprecated or not being maintained over time.
- obituary_latte 7y agoLooks 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.
- dnsfr 7y agoI didn't know it requires a login. Do you know any online free platform that can launch a given docker image?
- obituary_latte 7y agoSorry but I do not.
- DavideNL 7y agoLooks 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.
- superasn 7y agoLooks 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-every-linux-user-know/ https://www.ostechnix.com/3-good-alternatives-man-pages-ever...
- callmeschroeder 7y agoSame idea as https://news.ycombinator.com/item?id=19436884 https://news.ycombinator.com/item?id=19436884 but more polished and faster.
- dnsfr 7y agoI'll add it to the "alternatives" section
- apotheosis 7y agoWould be neat if `navi git` started it up and applied a filter at the same time.
- dnsfr 7y agoCool! Will do it! My only concern is that this way it would be impossible to add subcommands to navi Let's say that in the future I want to add a command for removing a cheat (navi remove) The way you described, it would look for snippets which contain "remove" Any ideas?