Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

rscontacts uses an optional TOML configuration file located at:

~/.config/rscontacts/config.toml

This is the same directory where OAuth credentials and the token cache are stored.

If the file does not exist, rscontacts runs with default settings (all checks enabled). If the file exists but contains errors, a warning is printed and defaults are used.

You can generate a default config file with rscontacts init-config. Use --force to overwrite an existing file.

check-all skip list

The [check-all] section controls which checks are included when running check-all. By default, all checks run. You can skip specific checks by listing them in the skip array:

[check-all]
skip = [
    "check-contact-given-name-regexp",
    "check-contact-label-nophone",
]

Skipped checks will not run and will not appear in the --stats output.

Individual check commands (e.g., rscontacts check-contact-given-name-regexp) are not affected by the config file and will always run when invoked directly.

Available check names

The following check names can be used in the skip list:

Check nameDescription
check-phone-countrycodePhone numbers missing a country code
check-phone-formatPhone numbers not in +CC-NUMBER format
check-contact-given-name-regexpGiven names not matching the configured allow regex
check-contact-family-name-regexpFamily names not matching the configured allow regex
check-contact-suffix-regexpSuffixes not matching the allow regex (default: numeric)
check-contact-no-given-nameContacts with family name but no given name
check-contact-no-identityContacts with no type tag
check-contact-given-name-knownGiven name not in the configured allowed names list
check-contact-given-name-existsConfigured given names that have no matching contacts
check-contact-company-knownCompany field not in configured companies list
check-contact-company-existsConfigured companies that have no matching contacts
check-contact-displayname-duplicateMultiple contacts with the same display name
check-contact-no-displaynameContacts with empty display name
check-contact-typeContacts missing or having both type:Person/type:Company labels
check-contact-type-company-no-companyCompany-tagged contacts without a company field
check-contact-type-company-given-nameCompany-tagged contacts with given name != company field
check-contact-type-company-no-labelCompany-tagged contacts missing company:<name> label
check-contact-no-middle-nameContacts with a middle name set
check-contact-no-nicknameContacts with a nickname set
check-contact-no-labelContacts not assigned to any label
check-phone-label-missingPhone numbers without a label (mobile/home/work)
check-phone-label-englishNon-English phone labels
check-phone-country-labelMissing or wrong country labels for phone numbers
check-contact-emailInvalid or uppercase email addresses
check-phone-duplicateDuplicate phone numbers on a contact
check-contact-email-duplicateDuplicate email addresses on a contact
check-contact-label-nophoneEmpty labels (contact groups with no members)
check-contact-label-regexpLabels not matching the configured allow regex

Config sections

[check-all]

Controls which checks to skip when running check-all.

[check-all]
skip = ["check-contact-no-label", "check-phone-label-missing"]

[check-contact-given-name-regexp]

Allowlist regex for given names. Contacts whose given name does not match this pattern are flagged. If no allow regex is configured, the check is silently skipped in check-all.

[check-contact-given-name-regexp]
allow = '^[A-Z][a-z]*$'

[check-contact-family-name-regexp]

Allowlist regex for family names. Same behavior as the given name regex check.

[check-contact-family-name-regexp]
allow = '^([A-Z][a-z]+(-[A-Z][a-z]+)*|[1-9]\d*)$'

[check-contact-suffix-regexp]

Allowlist regex for name suffixes. If not configured, the check uses a default behavior that allows numeric suffixes.

[check-contact-suffix-regexp]
allow = '^[1-9]\d*$'

[check-contact-label-regexp]

Allowlist regex for contact labels (groups). Labels that do not match this pattern are flagged. If not configured, the check is silently skipped in check-all.

[check-contact-label-regexp]
allow = '^(type|company|person|service|group|organization):[A-Z][a-zA-Z]*$'

[check-contact-name-is-company]

List of known company names. Used by check-contact-company-known (flags contacts whose company field is not in this list) and check-contact-company-exists (flags configured companies that have no matching contacts). If the list is empty, both checks are skipped in check-all.

[check-contact-name-is-company]
companies = ["Google", "Microsoft", "Amazon"]

[check-contact-given-name-known]

List of allowed given names (case-sensitive). Used by check-contact-given-name-known (flags contacts whose given name is not in this list) and check-contact-given-name-exists (flags configured names that have no matching contacts). If the list is empty, check-contact-given-name-exists is skipped in check-all.

[check-contact-given-name-known]
names = ["John", "Jane", "Mark"]

Regex syntax

The allow values use Rust regex syntax. For example, '^[A-Z][a-z]+$' requires values to start with an uppercase letter followed by one or more lowercase letters. Names like “Smith” pass, while “smith”, “SMITH”, “Smith 2”, or “123” would be flagged.

Name regexp checks support --fix for interactive fixing (rename/delete/skip, plus swap for given name). The label regexp check supports --fix for interactive renaming.

Example configuration

# ~/.config/rscontacts/config.toml

[check-all]
skip = [
    "check-contact-given-name-regexp",
    "check-contact-no-label",
    "check-phone-label-missing",
]

[check-contact-given-name-regexp]
allow = '^[A-Z][a-z]*$'

[check-contact-family-name-regexp]
allow = '^([A-Z][a-z]+(-[A-Z][a-z]+)*|[1-9]\d*)$'

[check-contact-label-regexp]
allow = '^(type|company|person|service|group|organization):[A-Z][a-zA-Z]*$'

[check-contact-name-is-company]
companies = ["Google", "Microsoft"]

[check-contact-given-name-known]
names = ["John", "Jane", "Mark"]