This repository contains two versions of a CLI application that generates a motivational quote using an AI model and displays a snowflake animation in your terminal. You can choose to use either the Python version or the Zsh version—you only need to set up one of them, not both.
- Retrieves a motivational quote using Amazon Bedrock.
- Displays a falling snowflake animation in the terminal.
- Two different implementations available: Python and Zsh.
You must have the following installed before running the app:
- AWS CLI: Installed and configured with permissions to use Amazon Bedrock. Install AWS CLI
- jq (for Zsh version only): Used for parsing JSON responses. Install jq
- Python 3.x (for Python version only): Install the
boto3
andtermcolor
libraries. Install Python
To configure the AWS CLI, follow the official AWS documentation: AWS CLI Configuration.
Run the following command to configure your AWS CLI:
aws configure
You will be prompted for:
- AWS Access Key ID
- AWS Secret Access Key
- Default Region Name
- Default Output Format
Ensure that your IAM user has the necessary permissions to invoke Amazon Bedrock models by adding the correct policies.
You can choose to set up either the Python version or the Zsh version of the app. Follow the instructions for the one you prefer. You don't need to set up both.
-
Install the required Python libraries:
pip install boto3 termcolor
-
Clone or download this repository to your local machine.
-
Run the Python version:
python ai_quote_generator.py
-
Install
jq
if it’s not already installed. You can do so with:sudo apt-get install jq # For Debian/Ubuntu # or brew install jq # For macOS
-
Clone or download this repository to your local machine.
-
Make the Zsh script executable (if it's not already):
chmod +x ai_quote_generator.sh
-
Run the Zsh version:
./ai_quote_generator.sh
You can set the script to automatically run each time your terminal opens. Follow the steps below depending on whether you chose the Python or Zsh version.
-
Open or create your
.zshrc
file (this file runs every time a new Zsh session is started):nano ~/.zshrc
-
Add the following line to the end of the
.zshrc
file to run the Zsh version of your script when the terminal opens:# Run AI Quote Generator when terminal starts ~/path-to-your-script/ai_quote_generator.sh
Replace
~/path-to-your-script/
with the actual path to the directory where yourai_quote_generator.sh
is located. -
Save and close the file, then reload your terminal configuration:
source ~/.zshrc
The script will now run automatically each time you open a new Zsh terminal session.
-
Open or create your
.bashrc
file (this file runs every time a new Bash session is started):nano ~/.bashrc
-
Add the following line to the end of the
.bashrc
file to run the Python version of your script when the terminal opens:# Run AI Quote Generator when terminal starts python3 ~/path-to-your-script/ai_quote_generator.py
Replace
~/path-to-your-script/
with the actual path to the directory where yourai_quote_generator.py
is located. -
Save and close the file, then reload your terminal configuration:
source ~/.bashrc
The script will now run automatically each time you open a new Bash terminal session.
If you'd like the script to run only under certain conditions (like when you're in a specific directory), you can add a condition to your .bashrc
or .zshrc
file. For example:
# Only run the AI Quote Generator when in the home directory
if [[ $PWD == "$HOME" ]]; then
~/path-to-your-script/ai_quote_generator.sh
fi
This ensures the script only runs when your terminal is opened in the home directory.
The Python version uses boto3
to request a motivational quote from Amazon Bedrock, based on the prompt in the script. It displays the quote in your terminal with some basic formatting and color.
The Zsh version uses the AWS CLI to call Amazon Bedrock, parses the response with jq
, and displays the quote with a falling snowflake animation.