Hacker News new | ask | show | jobs
by redlohr 985 days ago
Oh, that's a great idea. I have a doc that I maintain by hand, either via ">>" or editing directly. Time to go and make a shortcut. Do you do any annotation to help with the search?
2 comments

A large Justfile (https://just.systems/) of random recipes might be a way to make it both executable and searchable (at least on zsh, you can get an autocomplete list of completions from the command line).
Can you think of a single CLI tool that would let me commit a past incantation to a file and retrieve it later? Especially one that syncs well across devices.

The best I can think of is Atuin (https://github.com/atuinsh/atuin) but I wasn't super interested in using it - I kind of want something more lightweight.

I've been using a little set of bash funcs I called `hs` for this for a few years:

https://github.com/mikemccracken/hs

your snippets are stored in a git repo that you can sync around how you like.

Usually no annotations, as I typically search by command name. But sometimes I edit the file to add comments if there are many examples for the same command.