Keeping track of your cat's health can be difficult, especially when changes happen gradually over time. CataLogger is a CLI tool that lets you log daily metrics like weight, activity, appetite, water intake, and litter habits for each of your cats. When you want to check in on how they're doing, the built-in AI analyzes the logged data and provides a clear health overview, highlighting trends and flagging anything that might need a vet visit.
(Built for the HacktheKitty hackathon)
The CLI is built with Python and SQLite3. It uses the third-party library Click to allow the user to interact with the script via a command line along with supporting user inputs as arguments. The user runs the main .exe by using it in the Windows Terminal or using the main.py script in other supported operating systems. There are 3 Python scripts found in the source code;
main.py: The link between the user (front-end) and the other scripts (back-end).sql.py: Handles all connections with the database. (stored locally ascat-a-log.db)analyze.py: Contains all the AI connections. (usesgroqas the main endpoint,llama-3.3-70b-versatileas the AI model)
When the user uses the app for the first time, they would probably think to add their cat as an entry to the database first before logging. When they use the add-entry command, this is what happens on the backend;
- The arguments the user passed in (name, birth date, breed) will be received by
main.py. - It then passes the arguments to
sql.py, and runs theaddEntryfunction. - The function executes a SQL command
INSERTwithcursor.execute. Using the '?' placeholders is good practice as it prevents SQL Injection. - The code block runs, but if the cat already exists inside the database, a
sqlite3.IntegrityErroris returned, indicating the cat's name is already recorded. (better hope you don't have multiple cats with the same name!) - It prints a confirmation statement, informing the user that the cat has been added to the database.
So in short: command is run -> passed into SQL INSERT command -> checks for existing entries -> prints confirmation
When the user wants to log their cat's daily metrics using the log command:
command is run → input validated → user confirms → INSERT into log table → prints confirmation
When the user wants an AI-generated health overview using the overview command:
command is run → fetches logs from SQLite → sends to llama-3.3-70b via Groq → streams health overview to terminal
- Contains a
logcommand, which takes in arguments directly from the terminal, or prompts the user for them if some values are not given. - Look back at how much your cats have changed with the
historycommand and visualize it withgraph. - An
overviewcan be provided of a specific cat, using Llama 3.3 to analyze the.db. - View saved cats with
list-catsand when they were last logged withstatus. - Directly modify the database with
editanddelete. - Send the data to someone as a spreadsheet with
export. - Run the CLI in interactive mode, where your commands don't need to be prefixed and runs as it's own proccess.
- Go to the releases tab and download the latest
catalogger-cli.exe. (or self generate theexe.) - Save it to a seperate folder, (Optional, but recommended) as the
cat-a-log.db,cat_a_log.csv, and.env(explained in AI Overview Setup) all need to be in the same location ascatalogger-cli.exe.
- Click the green "Code" button at the top of the repo and click
Download ZIP. - Make sure Python 3 is installed.
- Extract the
.zipand open a terminal window inside the newly created folder. - Create a virtual enviroment:
python -m venv .venv - Activate it:
source .venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Run the CLI:
python src/main.py(Note: All files created will be outside thesrcfolder as that is where the terminal is running from)
- In the same folder where the CLI is being ran from (folder in Windows, terminal running location in Mac/Linux), create a file named
.env - Go to Groq API Keys, log in and generate your own API key. (Don't share it with anyone)
- When you copy your key, open
.envand add the lineAPI_KEY=[replace with your key] - Save
.envand rerun the CLI.
If you want to package the CLI yourself locally as an .exe, you can open the terminal in the main catalogger folder and run these commands with Python installed:
pip install pyinstallerpyinstaller --onefile --name catalogger-cli --icon "images/logo.ico" src/main.py
Add one of your feline companions to your local database.
| Arguments | Explanation | Required |
|---|---|---|
--name |
Name of the cat you want to add | YES |
--birth |
When your cat was born (Best formatted asYYYY-MM-DD) |
NO |
--breed |
Breed of your cat | NO |
Log health metrics of a specific cat.
(If an argument is not provided when the command is initially run, the CLI will prompt you to insert it via an input box.)
| Arguments | Explanation | Required |
|---|---|---|
--cat |
Name of the cat you want to log | NO |
--weight |
Current weight of the cat in kilograms | NO |
--activity |
How active the cat is on a scale of 1-5 | NO |
--appetite |
How hungry is the cat:None, (N)ormal, (L)ow, (H)igh |
NO |
--water |
How much water does the cat drink:None, (N)ormal, (L)ow, (H)igh |
NO |
--litter |
Litter of the cat:(N)ormal, (S)training, (D)iarrhea, (C)onstipated |
NO |
--notes |
Extra notes the AI can use to better its understanding of the cat's current situation | NO |
Shows saved cats and when they were last logged.
Prints out all cats currently stored in the database alongside their birth dates and breeds.
Show metrics of all cats or a specific cat.
| Arguments | Explanation | Required |
|---|---|---|
--cat |
If not provided, all saved metrics will be returned | NO |
Create a graph of your cat's weight over time
| Arguments | Explanation | Required |
|---|---|---|
--cat |
Choose a cat whose weight will be graphed | YES |
Edit an entry of a cat or a log.
| Arguments | Explanation | Required |
|---|---|---|
--mode |
Edit an entry from thecats table or the log tableAccepted arguments: cat, cats, log, logs |
YES |
--id |
Select a row ID to edit. If not provided, possible options will be displayed with their ID's |
NO |
Deleta an entry of a cat or a log.
| Arguments | Explanation | Required |
|---|---|---|
--mode |
Delete an entry from thecats table or the log tableAccepted arguments: cat, cats, log, logs |
YES |
--id |
Select a row ID to delete. If not provided, possible options will be displayed with their ID's |
NO |
Uses AI to create a health overview by checking the logged metrics of the cat you selected.
| Arguments | Explanation | Required |
|---|---|---|
--cat |
The cat you want the AI to provide an overview on | YES |
Export selected data or the entire database as a .csv
| Arguments | Explanation | Required |
|---|---|---|
--cat |
If not provided, all data will be exported | NO |
--output |
Where the.csv should be saved.If not provided, it will save in the same location where the CLI was run. |
NO |

