Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: CLI plain-text notes & bookmarks with Git, sync, encryption, and more (github.com/xwmx)
240 points by xwmx 9 months ago | hide | past | favorite | 49 comments



This tool is going into my workflow right away. I take notes in markdown (with latex) for all my classes but they're disorganized and searching through them for a specific topic is annoying. This solves so many problems haha.

I noticed there's a way to tag bookmarks, is there a similar functionality for tagging notes?


Cool, your use case is exactly one I hope it works for. I find that the notebooks are a really good way to organize by topic or project, and should work really well for classes, too. You can even archive a project or class notebook when it ends and still easily access, revive, or drop into the content.

Tagging in `nb` is really simple and is just a matter of putting hashtags in your documents and then searching for those hashtags using `nb search` / `nb q`. `nb <url>` makes tagging a little more convenient when bookmarking by providing a `-t <tag1>,<tag2>...` / `--tags <tag1>,<tag2>...` option and saving them in a dedicated `## Tags` section in `.bookmark.md` documents.


This looks super cool and polished.

That it's a 11401 line shell script is blowing my mind.


The completeness of the tool combined with the madness of shell scripting. The author is a demigod, no doubt.


A shelligod, for sure


Everyone should use the language of their choice. That said, looking over the code, I understand why Perl became popular as a shell replacement.


> Everyone should use the language of their choice.

We live in a fruitful age for programming. There are many viable languages. Some have notation that is more difficult, perhaps, but humans are good at notation and there is no such thing as "easy" programming.

That said, any language that offers portability and stability that can be measured in _decades_ has a distinct advantage.


I hate to be critical of what's a rather impressive piece of work, but a lot of the reason for that length is just a lot of repetition, e.g. https://github.com/xwmx/nb/blob/master/nb#L10423


That particular function, `nb show`, is a big `if` statement checking the file type and environment for available tools. I'm more than happy for suggestions and / or pull requests for optimizing that.

Note that Bash is a weird language that doesn't provide language features found in normal languages, and this targets old Bash which doesn't even have associative arrays, so there are things that might look "wrong", but aren't necessarily in this context. That's a big part of what makes it interesting to code in.


Why did you decide to go with Bash instead of another scripting language like Python or Ruby? Portability? "Just because"?

I am not bashing Bash ;) but genuinously interested in the motivations as a programmer. You have stated that the Bash shortcomings are "interesting", so I guess it boils down to some kind of "who cares, let's do it with Bash".

I tried nb yesterday and damn if it had a native capture tool for macOS and iOS this would be the perfect Evernote replacement for me.


Portability, philosophy, style. I find that designing within constraints can lead to interesting solutions, and this project has focused on embracing and leveraging the command line interface itself.


Shameless Plug: If you're looking for a mobile client for your markdown notes - https://GitJournal.io

It's completely open source and integrates with Git. Please feel free to hop on to GitHub and vote on the existing features.


I bought the pro version and really appreciate this app.


There have been a few of these note taking systems that have passed through HN lately. I use org-mode for some notes and sometimes open-junk-file (that I discovered in in Spacemacs). What I miss is a tool that will help me keep some notes encrypted at rest but will allow me to search filenames _and_ content. nb seems to support searching, and encryption, but not the two in combination.


If you only care about encryption at rest, maybe just do filesystem encryption? Whether that's encfs or luks or ZFS encryption or whatever. (Caveat: some of these have very specific security properties that you may find inadequate (encfs is poor against an attacker who can see multiple versions of a file over time, IIRC), or efficiency issues with syncing (you're not gonna git commit a ZFS dataset))


Emacs can use GPG to encrypt files at rest pretty transparently. Just save a files with the extension `.org.gpg` and it should get encrypted automatically with Spacemacs (I personally use https://github.com/hlissner/doom-emacs/).

Note that adding an encrypted file to your agenda, .e.g. `(setq org-agenda-files '("~/org/secret-diary.org.gpg"))` will let Emacs decrypt that file upon calling "org-agenda". Something similar should be possible for search if it doesn't work out of the box


I use this to encrypt files as well and I think Emacs handles this very well for individual files. It is however the notes management tool that doesn't support transparently search through multiple files.

I imagine what is needed is using gpg-agent to handle passwordless decryption of the files at rest.


Ah yes, I am using gpg-agent with my Yubikey - decryption would be tiresome without.

Well, org-agenda at least seems to support it through Emacs lower-level functions. Search is a bit more complicated, but should be well possible through hooks?


This looks awesome, and touches on a bunch of things that have been on my to-do list of "find a thing that can do X", even if that thing didn't let me stay in the command line, which this obviously does.

Curious to see what people come here to say does all of this better, because if it exists in a nice package like this, I haven't seen it yet.


I use pass[1] with this alias for daily notes. The nice thing about that is there are lots of native clients

    alias journal='pass edit journal/$(date +%Y-%m-%d)'
[1]: https://www.passwordstore.org/


Very cool. `pass` is awesome and I didn't realize it had the `pass edit` feature. I have written scripts that use the 1Password and Keychain command line tools, and I definitely want `nb` to use all three of these, maybe via a plugin.


It looks incredible, rich in features and the git syncing capability is neat.

My only wish would be to be able to import my bookmarks somehow. A few months back wrote my one CLI bookmark manager in Elixir (https://github.com/tefter/cli). It's impressive how much nb achieves yet being written in Bash.


Thanks! That looks really interesting and very nicely designed (both your CLI and the web app).

It should be pretty easy to create a bookmark import plugin for `nb`, so that's likely to happen.



Looks similar to jrnl.sh which I have been using for years. Combine with iTerm2 with it's configurable "drop down" terminal with a global shortcut and I can save anything from one word notes to full meeting minutes using the same flow.


Wow, looks great. Using git to sync is super convenient -- there's so much infrastructure available to support git so it's basically no effort to start syncing with github etc.

I use dstask to manage my todo list which also uses git, it's excellent.


Thank you for dstask. I also have to take a deeper look into this submission.

Are you aware of a currated list of git-synched solutions to note taking and todo management? I used to use emacs org which was very good in the beginning yet somehow started to overgrow to the point where I found myself more in organizing than get stuff done.


That would definitely be helpful. This tool looks cool, but I need windows support.


This looks fantastic! I’ve only spent a few minutes with this, but the design is really, really smart and the featureset is top-notch!

Congratulations!


See also Logseq [1] (a roam alternative) and Cerveau/Neuron [2] (a zettelkasten implemented in Haskell) for alternative git-based note management. See also [3] for a Lobsters discussion from a few days ago.

[1] https://logseq.com/ [2] https://www.cerveau.app/ [3]https://lobste.rs/s/e5lx5p/what_note_taking_team_wiki_person...


I am surprised to see there are 3,365 commits of this project with a 5-year gap: https://github.com/xwmx/nb/graphs/contributors

Perhaps there are some interesting stories that the author would like to tell?


Yeah, it's a little unusual. No big story. I just did an early version and then didn't update it for a long time, then got hooked on working on it again over the past few months.

I don't know what to say about the number of commits. My working style on this project has involved a lot of smaller commits and little feature iterations, maybe because of the single big script and single big README, or maybe something about the feedback loop of this style of development.


That's some impressive documentation - did you write (and update) it all by hand, or is it semi-automatically updated from the CLI help page?

Shameless plug for people who are just interested in the bookmarks part: I've created Static Marks [1], an open-source tool which turns plain-text YAML bookmark collections into a shareable HTML web app.

[1] https://github.com/darekkay/static-marks


How does this compare with https://github.com/gnebbia/kb?


I love all of this! Just need a similar web-based GUI so my coworkers can use the same back-end technology without having to use the CLI.


You can check out https://github.com/Uzay-G/archivy/. It's quite similar except uses a web interface. We're building it out and are working on adding a login system so people can host instances publicly with multiple users.


If it’s all just plain text, you could just put it on GitHub / gitlab and edit the files from the built in “raw” editors.


Indeed, it is, and you can do exactly that.


I prefer using Vim (or Emacs), git and grep for things like this. They're everywhere and have stood the test of time. Are there any particular advantages I'm missing here? Either way thanks for sharing; it's helpful to see how other people do notes.


FWIW, the core idea in `nb` is that it grew out of exactly that toolset and philosophy and develops it into a single, streamlined interface with a bunch of conveniences and features. It embraces that model and is intended to support it.


This looks fantastic, just from a quick download and playing around for 5 minutes I know this is going to come in handy. I don't always have a note taker open, but I almost always have a terminal open.


This looks amazing! Love how simple yet powerful it is. Great job!


I was searching for something like this and thinking of creating it myself, glad I don't have to now. Can it import evernote notes/notebooks?


Wow. Is This is the child of Gina Trapani's old notes.sh? I feel like I've watched this grow incredibly over the last 15 years...


Did Gina had some "notes.sh" script? I can only remember her "todo.txt" for todos. This can perfectly replace it, yes, and it is very similar in spirit.


mad props, this is extremely cool. i only wish i had it ten years ago so i wouldn't have my crap spread across one more system.


Cool project, the first question that comes to my mind is, how did you succeed to have icons in a terminal application?


Unicode [0].

You'll need a terminal that supports Unicode (but most do nowadays, AFAIK) and a font that can display Unicode characters.

Oh, and make sure you're using a locale that supports UTF-8, of course.

---

[0]: https://en.wikipedia.org/wiki/Unicode


thanks




Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: