Skip to content
المشاريع

حول

CLI to manage contacts

أدوات التطوير

كيف تُقاس هذه الأرقام

51 نجمة6 التفرعات +1 خلال 24 ساعة

ما يمكنك فعله

  • Unified API for addressbooks and cards, the same on every backend
  • Protocol-specific APIs exposing the full surface of CardDAV, JMAP, Microsoft Graph, Google People and vdir
  • Local stores: vdir and pimdir, the offline store Neverest syncs
  • One query language to search cards, whatever the backend

النمو المقاس للنجوم

خلال 24 ساعة
+١
خلال 7 أيام
+١
خلال 15 يومًا
+١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

📇 Cardamum Matrix Mastodon Sponsor

CLI to manage contacts

$ cardamum card list --json
{
  "cards": [
    {
      "id": "ada",
      "addressbookId": "personal",
      "etag": null,
      "uid": "ada",
      "fullName": "Ada Lovelace",
      "givenName": "Ada",
      "familyName": "Lovelace",
      "emails": ["[email protected]"],
      "phones": ["+44 20 7946 0000"],
      "organization": null,
      "organizationUnits": [],
      "title": null,
      "note": null
    },
    {
      "id": "alan",
      "addressbookId": "personal",
      "etag": null,
      "uid": "alan",
      "fullName": "Alan Turing",
      "givenName": "Alan",
      "familyName": "Turing",
      "emails": ["[email protected]"],
      "phones": [],
      "organization": null,
      "organizationUnits": [],
      "title": null,
      "note": null
    }
  ],
  "nextPage": null,
  "errors": []
}

Table of contents

Features

  • Unified API for addressbooks and cards, the same on every backend
  • Protocol-specific APIs exposing the full surface of CardDAV, JMAP, Microsoft Graph, Google People and vdir
  • Local stores: vdir and pimdir, the offline store Neverest syncs
  • One query language to search cards, whatever the backend
  • Card editing from field flags, a vCard file or your own editor
  • REPL and MCP server running commands over a connection kept for the session
  • JSON output of every command, described by cardamum json-schema
  • TLS via Rustls (rustls-ring default, rustls-aws) or Native TLS (native-tls), client certificates included

RFC coverage

RFC What is covered
2426 vCard 3.0: cards minted at that version, for the servers still storing it
4918 WebDAV: the PROPFIND, PROPPATCH, GET, PUT and DELETE methods CardDAV builds on
5397 Current-user-principal, the first step of the CardDAV discovery walk
5689 Extended MKCOL: creating an addressbook
6350 vCard 4.0: parsing, building and editing cards
6352 CardDAV: addressbook collections, address object resources, and the query and multiget reports
6578 Collection synchronization, whose sync token a CardDAV addressbook listing reports
6750 HTTP Bearer authentication, for a provider-issued or broker-refreshed API token
7617 HTTP Basic authentication
8620 JMAP core: the session, its capabilities and the method calls the JMAP backend sends
9553 JSContact: the JMAP backend's cards, converted to and from vCard
9555 JSContact and vCard conversion: the properties with no JSContact slot kept as they are
9610 JMAP for Contacts: address books and contact cards

Installation

Debian, Ubuntu

Cardamum is not in the official repositories yet, but the signed APT repository of pkg.pimalaya.org ships the latest release with its man pages and shell completions. Add the repository once:

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://pkg.pimalaya.org/pimalaya.asc | sudo tee /etc/apt/keyrings/pimalaya.asc >/dev/null
sudo tee /etc/apt/sources.list.d/pimalaya.sources >/dev/null <<EOF
Types: deb
URIs: https://pkg.pimalaya.org/apt
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/pimalaya.asc
EOF
sudo apt update

Then install Cardamum:

sudo apt install cardamum
Fedora, RHEL, Rocky Linux, AlmaLinux

Cardamum is not in the official repositories yet, but the signed DNF repository of pkg.pimalaya.org ships the latest release with its man pages and shell completions:

sudo curl -fsSL -o /etc/yum.repos.d/pimalaya.repo https://pkg.pimalaya.org/pimalaya.repo
sudo dnf install cardamum
Homebrew (macOS, Linux)

Cardamum is not in homebrew-core yet, but the pimalaya/tap formula installs the latest release with its man pages and shell completions:

brew install pimalaya/tap/cardamum
Pre-built binary

For other systems, Cardamum can be installed with the installer:

As root:

curl -sSL https://raw.githubusercontent.com/pimalaya/cardamum/master/install.sh | sudo sh

As a regular user:

curl -sSL https://raw.githubusercontent.com/pimalaya/cardamum/master/install.sh | PREFIX=~/.local sh

These commands install the latest release, built with the default cargo features. For a build of master, check out the releases GitHub workflow and look for the Artifacts section.

Cargo
cargo install --locked cardamum

For a build of master:

cargo install --locked --git https://github.com/pimalaya/cardamum.git
Nix
nix profile install github:pimalaya/cardamum
Sources

Requires Rust 1.89 or later:

git clone https://github.com/pimalaya/cardamum
cd cardamum
cargo build --release --locked

The binary lands at target/release/cardamum.

Configuration

A TOML configuration is loaded from every existing path among the following, each one deep-merged on top of the ones before:

  • $XDG_CONFIG_HOME/cardamum/config.toml
  • $HOME/.config/cardamum/config.toml
  • $HOME/.cardamumrc

Override the path with -c <PATH>, repeated to merge several files.

[!TIP] See config.sample.toml for a complete configuration of one example account with commented fields; rename the account and uncomment what you need, or start from a provider below.

An account reads a vdir home, or the pimdir store Neverest syncs, with no server: point vdir.root or pimdir.root at it. Cardamum never issues nor refreshes an OAuth 2.0 token, so Google and Microsoft accounts read theirs from Ortie.

Google

Use the Google People API, richer than Google's CardDAV bridge, with a token from Ortie's Google account. Contact groups are addressbooks, myContacts listing as Contacts.

[accounts.google]

gpeople.auth.token.command = ["ortie", "token", "show", "-a", "google"]
addressbook.default = "myContacts"

Microsoft

Microsoft serves contacts over Microsoft Graph alone, with a token from Ortie's Graph account. Contact folders are addressbooks, the default one under the contacts id.

[accounts.microsoft]

msgraph.auth.token.command = ["ortie", "token", "show", "-a", "microsoft-graph"]
addressbook.default = "contacts"

Fastmail

Use JMAP with a token from Ortie or an API token, or CardDAV with an app password, replacing the block. Fastmail refuses to create, rename or delete an addressbook over JMAP.

[accounts.fastmail]

jmap.server = "https://api.fastmail.com/jmap/session"
jmap.auth.bearer.token.command = ["ortie", "token", "show", "-a", "fastmail"]

# carddav.server = "https://carddav.fastmail.com/dav/"
# carddav.auth.basic.username = "[email protected]"
# carddav.auth.basic.password.command = "pass show fastmail"
# addressbook.default = "Default"

Posteo

Standard CardDAV with the account password.

[accounts.posteo]

carddav.server = "https://posteo.de:8843/"
carddav.auth.basic.username = "[email protected]"
carddav.auth.basic.password.command = "pass show posteo"
addressbook.default = "default"

iCloud

Use an app-specific password, your account password being refused.

[accounts.icloud]

carddav.server = "https://contacts.icloud.com/"
carddav.auth.basic.username = "[email protected]"
carddav.auth.basic.password.command = "pass show icloud"
addressbook.default = "card"

Usage

Step 1: once your first account is configured, check that every backend answers:

cardamum account check

Step 2: list the addressbooks:

cardamum addressbook list

Step 3: list the cards of the default addressbook, or of the one -k names:

cardamum card list

Every command runs on the default account unless -a names another, and its --help details its flags, exit codes and JSON output. More use cases:

# Read a card, its raw vCard included
cardamum card read ada

# Add a card from a vCard file
cardamum card add ada.vcf

# Search the cards of every addressbook
cardamum card search lovelace email:@example.org

# Send a CardDAV sync report
cardamum carddav report sync personal

# Serve the account to an AI agent, writes allowed
cardamum mcp --allow-write

Alternatives

  • khard: a contacts CLI over a vdir, a sync tool such as vdirsyncer reaching the server
  • abook: a terminal address book in its own file format, local only

License

This project is licensed under either of:

Social

Sponsoring

nlnet

Special thanks to the NLnet foundation and the European Commission that have been financially supporting the project for years:

This program is part of Pimalaya, free software funded entirely by grants and donations. If you find it useful, consider sponsoring its development:

GitHub Ko-fi Buy Me a Coffee Liberapay thanks.dev PayPal

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…