Last Updated: Sunday, February 3rd, 2019
A Node.js CLI utility to retrieve available time slots on your Google Calendar
Born from the need for a quicker solution to list out my Calendar availability than manually checking for open time slots was amifree. I’ve tried services like Calend.ly, but my clients were frustrated when I sent them a link to schedule time with me. I didn’t want to give an impression that I was too lazy to look at my own calendar.
- Node.js & NPM
- Knowledge of Google API’s (e.g., ability to create an application in Google Developer Console, add an API, generate OAuth Credentials)
Running this application for the first time:
- Open a web browser and navigate to https://console.developers.google.com/
- Sign In with your Google Account
- In your Google Developer Console, find the option to create a new API Project
- Name your project
- In your new project Dashboard, click “Library” and add ‘Google Calendar API’ to your project
- Once enabled, navigate to your new project’s credentials dashboard
- Click “Create Credentials” > “OAuth client ID”
- Fill out the necessary steps to generate your credentials
- Download your credentials JSON file as ‘credentials.json’
- $ git clone https://github.com/matthewvolk/amifree.git folder-name/
- $ cd folder-name/
- $ npm install
- $ mv /Your/download/path/credentials.json folder-name/
- $ touch .env
- $ vim .env and add your primary calendar email address as CALENDAR_ID="email@example.com"
- $ npm install
- $ ./bin/amifree
When the application is complete, the user will be able to:
- Run npm install amifree
- Run amifree config
- Application lists out steps to generate an appropriate Google OAuth application, read credentials.json file, and asks you for the Google Calendar ID of the calendar you want to read.
- Run amifree for a list of available time slots from the Google Calendar associated with the Google Calendar ID above.
- amifree config: Walks user through the process of creating Calendar API app in Google Developer console, generating and downloading credentials, passing credentials to CLI application for registration
- amifree --this week: As well as other commands like this, I want the user to be able to query their calendar for a wider range of dates
- amifree --changeCalendarID firstname.lastname@example.org: Allows user to change the Google Calendar ID you want to read from.
- Right now, all users are forced to create their own Google API credentials for this project. I want to look into a way to have everyone use my Google API credentials without giving them access to my file.
What information do you collect?
We use Google’s OAuth2 to view your Google Calendar events. We do not store any of your email or password data, your data is stored in a file called ‘token.json’ in the folder where this application is stored on your computer.
How do you use the information?
We use your Google Calendar information to identify open blocks of time on your Google Calendar.
What information do you share?
We do not share your information with third parties.