{"id":15431170,"url":"https://github.com/mrusme/addrb","last_synced_at":"2025-04-14T09:40:29.772Z","repository":{"id":49358264,"uuid":"497740111","full_name":"mrusme/addrb","owner":"mrusme","description":"addrb: A lightweight CLI / TUI address book that supports CardDAV","archived":false,"fork":false,"pushed_at":"2024-07-07T14:30:42.000Z","size":875,"stargazers_count":32,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T06:36:20.419Z","etag":null,"topics":["address-book","carddav","carddav-client","cli","command-line","command-line-tool","tui","webdav","webdav-client"],"latest_commit_sha":null,"homepage":"https://xn--gckvb8fzb.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrusme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://github.com/mrusme#support"]}},"created_at":"2022-05-30T00:22:17.000Z","updated_at":"2024-08-15T14:28:03.000Z","dependencies_parsed_at":"2024-01-07T21:02:36.021Z","dependency_job_id":"d5e1cd34-dc38-498d-a4b7-2bba5444ae81","html_url":"https://github.com/mrusme/addrb","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrusme%2Faddrb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrusme%2Faddrb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrusme%2Faddrb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrusme%2Faddrb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrusme","download_url":"https://codeload.github.com/mrusme/addrb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855518,"owners_count":21172580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["address-book","carddav","carddav-client","cli","command-line","command-line-tool","tui","webdav","webdav-client"],"created_at":"2024-10-01T18:20:49.509Z","updated_at":"2025-04-14T09:40:29.746Z","avatar_url":"https://github.com/mrusme.png","language":"Go","funding_links":["https://github.com/mrusme#support"],"categories":["\u003ca name=\"organizers\"\u003e\u003c/a\u003eOrganizers and calendars"],"sub_categories":[],"readme":"addrb\n-----\n\n![addrb](addrb.png)\n\n`addrb`, the command line **addr**ess **b**ook. It's super lightweight, yet it\nsupports CardDAV sync!\n\n## Build\n\n```sh\ngo build .\n```\n\n## Usage\n\nEither export all necessary variables to your ENV or set them as command line\nflags:\n\n```sh\nexport CARDDAV_USERNAME='...'\nexport CARDDAV_PASSWORD='...'\nexport CARDDAV_ENDPOINT='...'\nexport ADDRB_DB='...'\n```\n\nIf you're using [Baïkal](https://github.com/sabre-io/Baikal) for example, you\nwould export something like this as `CARDDAV_ENDPOINT`:\n\n```sh\nexport CARDDAV_ENDPOINT='https://my.baik.al/dav.php/'\n```\n\nThe `ADDRB_DB` is the local contacts database in order to not need to contact\nthe CardDAV for every lookup. You might set it to something like this:\n\n```sh\nexport ADDRB_DB=~/.cache/addrb.db\n```\n\nWhen `addrb` is launched for the first time, it requires the `-r` flag to\nrefresh the contacts and sync them locally: \n\n```sh\naddrb -r john doe\n```\n\nThis command will connect to the CardDAV server, sync all address books/contacts\nlocally and perform a lookup for *john doe*. It will display you the contact(s) \nif any was found.\n\nYou can also refresh without querying:\n\n```sh\naddrb -r\n```\n\nThis way you could create a cron job that refreshes `addrb` in the background,\ne.g. every three hours:\n\n```sh\ncrontab -e\n```\n\n```crontab\n0 */3 * * * sh -c 'addrb -r'\n```\n\nYou can also output contacts as JSON format using the `-j` flag:\n\n```sh\naddrb -j john doe\n```\n\nFind more flags and info with `addrb --help`.\n\n\n## Templating\n\nYou can customize the regular output using templating. The template can either\nbe passed using the `--template \u003cfile\u003e` flag or by exporting `ADDRB_TEMPLATE` \nin the in the environment.\n\nThe templating format is the [Go standard `text/template`][1] format. The\nfollowing special functions are available:\n\n- `RenderPhoto` for rendering a base64 string as image (usually the contact \n  `PHOTO`)\n- `RenderAddress` for rendering a contact address\n\nAvailable property names that are available can be found by displaying a \ncontact as JSON (using the `-j` flag). E.g. \"FN\" is the full name, which can be\nretrieved using e.g. the `.PreferredValue` method:\n\n```tmpl\n{{ .PreferredValue \"FN\" }}\n```\n\nOther methods that are available can be found [here][3], with the most useful\nones probably being `.PreferredValue`, `.Value`, and `.Values` (for arrays).\n\nAn example template can be found [here][2]. To make use of the template, you can\ncopy it to e.g. `~/.config/addrb.tmpl` and have\n`ADDRB_TEMPLATE=~/.config/addrb.tmpl` exported in your `.zshrc`/`.bashrc`/etc.\n\n\n## FAQ\n\n- Q: Does `addrb` write/modify any contact information?\n  A: Nope, so far it's read-only and does not support updating vCards, hence it\n     won't mess with your data.\n- Q: Can I use it with my local address book?\n  A: Nope, as of right now `addrb` only supports CardDAV servers to sync with.\n- Q: Does it support HTTP Digest auth?\n  A: Nope, only HTTP Basic auth.\n- Q: The `text/template` stuff doesn't work for me, can I make `addrb` output\n     contact data differently?\n  A: Yes, you can use the `-j` flag and have it output pure JSON, which you can\n     then process using e.g. [`jq`][4]. \n\n[1]: https://pkg.go.dev/text/template\n[2]: example.tmpl\n[3]: https://pkg.go.dev/github.com/emersion/go-vcard#Card\n[4]: https://stedolan.github.io/jq/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrusme%2Faddrb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrusme%2Faddrb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrusme%2Faddrb/lists"}