Hacker News new | past | comments | ask | show | jobs | submit login
Ppl: The command line address book (github.com/hendotcat)
104 points by nomoreplease on June 8, 2021 | hide | past | favorite | 42 comments



I just use pass[0]. I namespace all my "passwords" with either "web/" "contact/", "local/" etc depending on what it is.

So contacts are my address book.

  pass edit contact/john.smith
And the contents are just toml files, eg

  name = "John Smith"
  email = "john@example.com"

  pass show contact/john.smith | toml2json | jq '.email'
Edit: I also wrote a little script that will crawl the contacts and build out a vCard for phones, email, etc. This works for me.

[0]: https://www.passwordstore.org/

[1]: https://github.com/rabbit-ci/toml2json


This here. I've used pass for notes/ and contacts/, along with the normal password stuff.


Could you share the script? I would be quite interested!


I've just kept my names in a flat file and used grep since forever (at least 35 years). If I want to make a change I just use a text editor.

A downside is that it doesn't integrate with all those fancy services, but the upside is it doesn't integrate with those fancy services either.

This ppl project has those advantages too


Grep is so handy. I want to say I also used something like 'ar -i' on one of my systems for a while, but then it went away and I never looked it up again.


Probably The Silver Surfer. The CLI is `ag`. Often used as a replacement for `grep`.

https://github.com/ggreer/the_silver_searcher

https://geoff.greer.fm/ag/


I think you meant to say The Silver Searcher.


That's the one, thank you.


I really like the simplicity of the idea but feel like the elephant in the room is: What about having your contacts on mobile?

It looks like ppl has the ability to import from Google Contacts etc but without a two-way sync mechanism to keep the contacts on my phone up-to-date it's hard to see adopting this.

Maybe if there was the ability to do simple diff and apply like gmailctl that would be good enough.


You can just search a file on mobile. The lack of integration with spyware is a feature, not a bug.


That's great for a notepad but don't do anything for knowing who contacts in text messages and call logs, incoming calls, etc are. It feels like half of a solution to me.


Yeah, those integrations just aren’t worth it to me. I know that plenty of other people don’t mind the cost.


I'm a command-line person, and I've tried a couple of different options for online contact managements since 1993.

Existing software stacks (commercial and open source) have shown poor support for file formats, and there is usually some level of loss when exporting/importing as a consequence.

Ultimately, UTF8 plain text is hard to beat as the most durable format.

I've also written scripts to extract contact details from MBOX-format e-mail repositories automatically, to support my manually-curated contacts file. Anything not found in the primary file may be in the (messier) secondary file.

I like the ppl idea, but the realization lacks generality: many people I interact with have multiple roles, so it's not uncommon to have 2 phones and 3 email addresses, and several postal addresses (I think I just saw ppl's Ruby class can just manage two emails, hardwired). Also, I think ergonomically it's not a good choice to edit one field at a time over the command line. Even I as a die-hard command liner want to be able to edit a person's full entry at once in Sublime or Emacs. I also need to see a person's record completely togehter on the screen, not just one line at a time. Finally, a free-text field (to remind oneself where I met anyone, and to store hash tags for topics) and a great search (supporting approx. string matching) is a must-have feature that I rely on heavily.

I concur with others that a static binary is preferred for such a function to avoid dependency issues.

(Thanks to the Ppl authors for getting the conversation started about effective contacts management, I'm keen to learn more about how everyone else is doing it.)


Seeing you mention MBOX parsing/extraction reminds me that back in the day I used lbdb, integrated with mutt.

The little-brother database allowed looking up contacts from LDAP, and similar, and pulling from local files.


What about something like recutils? Or maybe I mean “a recutils type thing.”


This is an interesting idea. The way the commands look like filesystems makes me wonder how hard it would be to make a FUSE filesystem for contacts based on this premise.

One "mount -t contactsfs contacts ~/contacts" and you could literally treat your contacts as files!

What I don't like about programs like this is that they often don't respect the XDG folder configuration, resorting to ~/.pplconfig and ./.ppl/config for default configuration paths. I've already went through all the stupid dotfiles in my home directory once, moving as many as I could, and I'm not going through all that effort again.


Apart from a neat toy project, what benefit would “contactfs” have over just storing text files in ~/contacts?


People could share identities as files, have public keys and contact infos, or maybe even content? Would that count as distributed social network? It would work really well with mobile


Was that a gentle hint regarding vcard?

https://datatracker.ietf.org/doc/html/rfc6350


I want to say that BeOS did this back in the day. I don’t think it was specifically a FUSE mount, but rather that the contacts application read vcards (or something similar) stored as plain files in the file system. Then the Contacts app just needed to be pointed to the proper folder and it would work.

I definitely remember the email application working that way, but think contacts worked that way too.

It was quite a clever way of interacting with your system. Everything was still a file, but your client applications were a bit more clever in how they interacted with those individual files. It was very close to the file system as a DB concept that was popular at the time, but far more practical.


there is also khard [0]

[0] https://github.com/scheibler/khard


This is what I use for my CLI email client (aerc). I keep mail and contacts sync'd using fastmail as my backbone with a couple of crons using:

- https://github.com/pimutils/vdirsyncer

- https://isync.sourceforge.io/mbsync.html


Very cool! I wish macOS contacts were supported. I would not migrate to something that doesn't solve the "sync b/w devices" problem. It would be pretty nifty to have a CLI frontend for iCloud contacts.

... And it looks like such a thing somewhat exists! https://github.com/keith/contacts-cli


There's also DecSync Synchronize RSS, contacts, calendars, tasks and more without a server https://github.com/39aldo39/DecSync

And DAVx5 https://www.davx5.com/


I've been looking for something like this. Are there other similar tools in this space?


Another comment already mentioned Khard, which has been around a while. [0]

There's also Mates [1]. Less mature, very simple, but it's what I personally use.

I try to steer away from relying on CLI tools implemented in python or ruby: at the system level they always seem to cause dependency hell problems eventually. Mates is implemented in Rust, so it's compiled, which is primarily why I chose it.

An important related project is vdirsyncer [2]. Ppl, khard, and mates all store data in vcard format but don't talk to APIs or sync anything. Vdirsyncer can sync your vcard collection with your email provider or what have you.

[0] https://github.com/scheibler/khard

[1] https://github.com/pimutils/mates.rs

[2] https://github.com/pimutils/vdirsyncer


> I try to steer away from relying on CLI tools implemented in python or ruby: at the system level they always seem to cause dependency hell problems eventually.

For python specifically, you can use `pipx` which will install an app into it's own venv and activate that venv only as needed, with fully isolated deps. [1]

No such solution exists for ruby or php though, and I won't use those projects unless dockerized.

[1] - https://pypi.org/project/pipx/


I'm aware of that approach for Python, and Bundler can be configured to do a similar thing for Ruby. Those are good approaches for development environments (though I generally prefer Docker for those these days), but for system tools I think that's just kind of a hassle and I don't want to do it.

For a tool I install & use, my happy path is "install it with my package manager, and then stop thinking about it". Upgrades will happen whenever I decide to ask my package manager to upgrade everything. (I use Arch Linux, so that's usually once or twice a week.)

Needing to hand-setup an installation or deal with multiple package managers like that for a program makes me cranky. I've certainly done it when there wasn't a good alternative (and also occasionally wrap programs in docker containers as well if it's easier - https://github.com/wfleming/dockerfiles), but it's the kind of thing that makes me pause and reconsider whether I really care enough to use whatever the program is.


I've been using abook [1], which is very old software but is fast, simple, stores data in plain text, and can export to vcard when needed.

[1]: https://abook.sourceforge.io/


I recently started using abook as well and quite like it, the integration with neomutt is nice to have


This is maybe slightly different than what you’re looking for, but my project Friends[1] is a journaling CLI that I also use to keep track of people’s addresses and contact info (via the “notes” feature).

[1] https://github.com/JacobEvelyn/friends


I'm working on my passion project that incorporates some features like this with some differences:

* not only contacts but also tasks, projects, notes and calendars

* not local, instead it uses a self hosted rest-like api wrapping a database centralizing all state

* embedded MQTT broker that publishes CRUD events so you can hook into any events to script automations

* cli client that works similar to this so commands can be chained in shell pipelines

* there's also a tui client (mutt-inspired) and I might do web/mobile later

It's far from finished, but if you're interested send me an email (link in profile) and I'll keep you up to date.


I just store mines in a small sqlite DB and use emacs's sql mode to query them along with a bbdb syncronization for my email, org-contacts and a small web frontend over a kubernetes cluster to get them online from my mobile,

works well,


A few months ago I was looking around for a good personal CRM and I thought airtable would possibly be the way to go. One thing I'd like is to be able to attach multiple pictures to any given contact entry.


You can. The flow isn't great but you can.


Great idea. I would definitely use this if it could talk to an LDAP server


LDAPpl for the win!


ooOOOOoooo


I liked this command-line tool better back when it was called Finger, and the contactee controlled which information was current and correct in their .plan and .profile files.


Ok, its ruby, doesn't do ldap replace abook or plain text, but it does have a built-in website with an asciinema demo cast :) .. for .. awesome points.


What benefitsz apart from maybe a nicer command line interface, does this have over something like recutils?


nodejs based software are very slow on my raspberry-pi based desktop




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

Search: