This project is a Node.js-based command-line application that integrates with Google Calendar, allowing users to manage their calendar events through natural language interactions. It uses OpenAI's GPT model to interpret user inputs and perform calendar operations.
Why use this?
Before you begin, ensure you have met the following requirements:
Clone the repository:
git clone https://github.com/ahnafaf/google-calendar-assistant.git
cd google-calendar-assistant
Install the dependencies:
npm install
Set up your Google Cloud Project and obtain the necessary credentials:
credentials.json
in the project root directorySet up your OpenAI API key:
.env
file in the project root.env
file:
OPENAI_API_KEY=your_api_key_here
To start the application, run:
node main
On first run, you'll be prompted to authorize the application with your Google account. Follow the provided URL, grant the necessary permissions, and enter the authorization code when prompted.
Once authorized, you can interact with the assistant using natural language. Here are some example commands:
Type 'exit' to quit the application.
main.js
: The entry point of the application. Contains the main chat loop and integration with OpenAI.googleCalendar.js
: Handles all interactions with the Google Calendar API.credentials.json
: Your Google Cloud Project credentials (not included in the repository).token.json
: Stores the user's access and refresh tokens (auto-generated on first run)..env
: Contains environment variables like the OpenAI API key.The application uses the following environment variables:
OPENAI_API_KEY
: Your OpenAI API keyThese should be set in the .env
file.
token.json
file and restart the application to re-authenticate.credentials.json
file is correctly placed in the project root directory..env
file.Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.