Coder Social home page Coder Social logo

contact's Introduction

Contact

This is a command line application for contact management with pipes in mind. It lets you choose a contact with FZF

Syntax:
    contact [COMMAND] [NAME] [PROPERTY]
    Commands:
    add: Add new contact
    edit: Edit existing contact
    delete: Delete contact
    get: Get property of contact (default)
    git: Interact with the git repositry directly
        Example: `contact git status`
        To enable the git repository features of contact you need to run:
            `contact git init`
        If you already have contacts you need to manually commit them:
            `contact git add --all;contact git commit -m "Commit all existing contacts"`
    help: Show this message
    mutt-aliases: Export as mutt aliases.
    rename-all: Rename all files to the correct name

Database

Each contact is saved into a separate file in ~/.contacts. You can save as many properties as you want. The only one that is required is name.

Example

name=Max Muster
[email protected]
mobile=0000000000
phone=0000000000
address=Beispielweg 12
city=Atlantis
zip=9990

Examples

contact get #this let's you choose a name and then the propery

contact get "Max Muster" "email" #get's you just the email address

contact add "Add a new contact. Opens an empty file with $EDITOR

contact mutt-aliases > ~/.mutt/aliases #export your contacts to the mutt alias file

# Usage in Pipes

mutt $(contact) #choose your email address

mutt $(contact "Max Muster" "email") #send email to Max Muster

termux-telephony-call $(contact) #call someone in you address book

termux-telephony-call $(contact "Max Muster" "mobile") #call Max Muster

Installation

Requirements

You need to install fzf and git (for git integration)

Installation

Copy the file contact to any directory in you $PATH. Make sure it's executable.

cp contact /bin/
chmod +x /bin/contact

Enable git integration

To enable git integration go to the ~/.contacts folder (create it if you've never run any contact command before and run git init all changes made with contact should now get added and commited automatically. If you have preexisting contacts you need to manually add them all to git and commit them.

git add *
git commit -m "Initial commit"

Environment variables

Certain advanced features can be set via environment variables:

  • CONTACT_SHORT_ALIASES=true will cause mutt-aliases to just include the email and not the name

Installation in Termux

Contact developed on Termux with Termux in mind, but running it on termux requires an additional step.

pkg install git fzf
cp contact $PREFIX/bin/ #or another directory in your $PATH
chmod +x $PREFIX/bin/contact
termux-fix-shebang $PREFIX/bin/contact

Getting started

To create your first contact run contact add. This will open $EDITOR or vi. You can now add contact information. See the "Example" section for the syntax. name is required (as it gets used in the filename).

Migrate from abook

mkdir -p ~/.contacts
cd ~/.contacts
awk '{print $0 "["> "file" NR}' RS='['  ../.abook/addressbook
sed 's/\[//g' -i *
sed 's/^.*\]$//g' -i *
rm file1 file2 #remove blank files
contact rename-all

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.