Khadijah is a voice-controlled digital assistant designed to perform various tasks such as opening and closing applications, responding to greetings, and interacting with the user via voice commands. This project leverages Python libraries for text-to-speech, speech recognition, and keyboard shortcuts to deliver a dynamic and interactive experience.
-
Voice-Controlled Commands:
- Open or close common applications like Terminal, Safari, Notes, and more.
- Respond to user greetings and basic queries.
-
Customizable Hotkeys:
j
to start listening.k
to pause listening.
-
Dynamic Application Mapping:
- Easily add or modify supported applications in the global
APP_MAP
.
- Easily add or modify supported applications in the global
-
Python Libraries:
pyttsx3
: For text-to-speech functionality.SpeechRecognition
: To recognize and process user voice commands.keyboard
: To add hotkey functionality for starting and pausing the assistant.python-decouple
: For managing user and bot configuration variables.smtplib
: For securely sending email messages over SMTP.
-
macOS-Specific Utilities:
osascript
: Used to execute AppleScript for closing applications.open
: The native macOS command to launch applications.
- Python 3.7 or higher installed on your system.
$ git clone https://github.com/shahbajsingh/khadijah-ai.git
$ cd khadijah-ai
$ pip install -r requirements.txt
$ chmod +x setup.sh
$ ./setup.sh
Create a .env
file in the project directory with the following content:
USER=YourName
Navigate to online.py
and enter email and passkey credentials to send emails.
EMAIL=YourEmailAddress
PASSWORD=YourPasskey
Run the script
$ python khadijah-ai.py
- Say
open [application]
to open an application - Say
quit [application]
to close an application - Say
search google
,search wikipedia
, orsearch youtube
to browse web related content - Say
send an email
to send emails - Say
read me the news
to get the top headlines in US news - Say
give me the forecast
to get the weather forecast for a city - Example:
open terminal
quit safari
Say stop
or exit
to gracefully shut down Khadijah