Simple command-line snippet manager, written in Go
github.com
github.com
% big hairy command here # foo the bars!
Then you can history search for 'foo' or whatnot. That doesn't totally obviate the need for a tool like this. I plan on checking it out.There is also a web interface https://ok-b.org/
Anyone can edit the public snippets (only bash for now, because it is such an obvious usecase), but private ones are coming too.
The plan is provide a way to save and search snippets from anywhere, terminal, web, phone, whatever.
It is also written in Go.
Edit: the mobile version of the site is not too responsive, but a new version of the UI is coming :)
*Edit 2: You can also self host the server/frontend yourself and change your terminal client to point to your own.
But so far I've been unable to get it working in any way- I've submitted a github issue.
Speaking of github- any chance we can have other login mechanisms for the frontend? I do so loathe having external dependencies.
And yeah, there is an issue on some systems with dependencies of a go package. We are going to fix that, sorry.
Thanks for the issue.
On bash, it's M-C-e where the Escape key can serve as the "M" portion. Also, M-r to clear the command-line, which I could also have used many times. Bash docs: https://www.gnu.org/software/bash/manual/html_node/Miscellan...
This applies to Go, Rust, whatever. I'd love to see future projects stand on their own merits and be pleasantly surprised when discovering the source language on my own.
If it's written in go I know I can drop a static binary in my PATH and be done.
(defun send-command-to-cli () (interactive)
(let ((current 0)
(the-command "")
(start 0)
(end 0))
(setq current (point))
(org-beginning-of-line)
(setq start (point))
(org-end-of-line)
(setq end (point))
(goto-char current)
(setq the-command (concat
"tmux send-keys -t top ' "
(buffer-substring start end)
" ' ; tmux send-keys -t top C-a ; tmux send-keys -t top '#'; tmux select-pane -t top; " ))
(message the-command)
(shell-command the-command)
))I think there's a much simpler way to go about this. Just add a snippet by typing it in your shell followed by an echo command, e.g.:
ls -rt; echo "List all files reverse-sorted by date"
Then the problem remains to search your shell history, but there are many solutions for that already. And the good part is (besides not needing another tool) that you can search the same way for commands that were not labeled with a description.We have 4 members in the team but there are loads of work to do.
I have long held a ~/bin directory that contains things that are similar.