| Crates.io | pharm |
| lib.rs | pharm |
| version | 0.1.2 |
| created_at | 2025-10-22 19:53:22.573177+00 |
| updated_at | 2025-10-22 22:24:04.262912+00 |
| description | CLI-first medication management and reminder tool |
| homepage | |
| repository | https://github.com/sqrew/pharm |
| max_upload_size | |
| id | 1896185 |
| size | 106,230 |
A CLI-first medication management and reminder tool for the terminal.
pharm helps you track medications, log doses, and receive timely reminders through desktop notifications. Built in Rust for speed, safety, and reliability.
pharm t for take)~/.pharm.json)git clone https://github.com/sqrew/pharm
cd pharm
cargo install --path .
cargo install pharm
Verify installation:
pharm --version
# Add a scheduled medication
pharm add "Aspirin" --dose 500mg --time 8:00 --freq daily
# Add with notes
pharm add "Insulin" --dose 10u --time morning --freq daily --notes "Take with breakfast"
# Add as-needed medication
pharm add "Ibuprofen" --dose 200mg --time prn --freq prn --notes "For headaches"
# List all medications
pharm list
# List only medications due right now
pharm list --due
# Mark a dose as taken
pharm take "Aspirin"
# Start the reminder daemon
pharm daemon
pharm add <NAME> --dose <DOSE> --time <TIME> --freq <FREQUENCY> [--notes <NOTES>]
Examples:
# Standard format
pharm add "Lisinopril" -d 10mg -t 08:00 -f daily
# Named times (morning, noon, afternoon, evening, bedtime, midnight)
pharm add "Vitamin D" -d 1000IU -t morning -f daily
# Custom intervals
pharm add "B12 Shot" -d 1mg -t "9:00" -f "every 7 days"
pharm add "Allergy Med" -d 10mg -t evening -f "every 3 days"
# With notes
pharm add "Metformin" -d 500mg -t dinner -f "twice daily" -n "Take with food"
# PRN (as-needed) medications
pharm add "Tylenol" -d 500mg -t prn -f prn -n "For pain"
pharm add "Benadryl" -d 25mg -t prn -f "as needed" -n "For allergies"
Supported time formats:
8:00, 08:30, 14:15 (HH:MM format)8, 14 (hour only, assumes :00)morning (8am), noon (12pm), evening (6pm), bedtime (9pm)Supported frequencies:
daily, weekly, monthlyevery X days (e.g., every 3 days)every X weeks (e.g., every 2 weeks)twice daily, 3 times daily (treated as daily)prn, as needed (as-needed medications with no schedule)# List all active medications
pharm list
# List archived medications
pharm list --archived
# List only medications due right now
pharm list --due
The --due flag shows only untaken medications that are currently due (past their scheduled time and interval). Perfect for answering "What do I need to take right now?"
# Mark a single medication as taken
pharm take "Aspirin"
# Mark all medications as taken (for current interval)
pharm take-all
# Undo accidental marking
pharm untake "Aspirin"
# Edit any field(s)
pharm edit "Aspirin" --dose 1000mg
pharm edit "Aspirin" --time evening --freq weekly
pharm edit "Aspirin" --notes "New instructions"
# Clear notes
pharm edit "Aspirin" --notes ""
pharm remove "Aspirin"
When you remove a medication, it's archived with its complete history preserved. This means:
pharm history <name>pharm add again - it will unarchive automaticallyThe daemon monitors your medications and sends desktop notifications when doses are due.
# Start daemon (runs in foreground)
pharm daemon
# Run in background
nohup pharm daemon > ~/pharm.log 2>&1 &
# Check daemon logs
tail -f ~/pharm.log
Daemon features:
pharm tracks the last time each medication was taken and respects the specified frequency to prevent accidental overdose:
This means if you take a weekly medication on Monday, you won't get reminders again until the following Monday, even if the daemon restarts.
For medications taken only when needed (e.g., pain relievers, allergy meds):
# Add PRN medication
pharm add "Ibuprofen" --dose 200mg --time prn --freq prn --notes "For headaches"
# Take it whenever needed
pharm take "Ibuprofen"
# View history
pharm history "Ibuprofen"
PRN medications:
pharm list --due (no schedule)Supported PRN markers: prn, as needed, as-needed, when needed
Track your medication adherence over time:
# View all medication history (last 30 days by default)
pharm history
# View history for specific medication
pharm history "Aspirin"
# View last 7 days
pharm history --days 7
# View longer period
pharm history "Aspirin" --days 90
# View only archived medications
pharm history --archived
History includes:
View or manage archived medications:
# List archived medications
pharm list --archived
# View archived medication history
pharm history "Old Med" --archived
# Restart an archived medication (unarchive)
pharm add "Old Med" --dose 10mg --time morning --freq daily
When you unarchive a medication by adding it again:
All medication data is stored in ~/.pharm.json as human-readable JSON. You can:
cp ~/.pharm.json ~/.pharm.json.backupcat ~/.pharm.jsonnano ~/.pharm.jsonThe file contains:
medications: Active medications you're currently takingarchived_medications: Removed medications with complete history preservedFile permissions are automatically set to 0600 (owner read/write only) on Unix systems for medical data privacy.
Uses your desktop environment's native notification system:
⚠️ Important: This tool is designed to assist with medication management, not replace medical advice or professional healthcare.
| Command | Alias | Description |
|---|---|---|
pharm add |
a, ad |
Add a new medication (or unarchive if exists) |
pharm list |
l |
List active medications |
pharm list --archived |
l -a |
List archived medications |
pharm list --due |
l --due |
List only medications due right now |
pharm take <name> |
t |
Mark medication as taken |
pharm untake <name> |
u |
Undo marking as taken |
pharm take-all |
ta |
Mark all medications as taken |
pharm edit <name> |
e |
Edit medication details |
pharm remove <name> |
r |
Remove (archive) a medication |
pharm history |
h |
View medication history |
pharm history <name> |
h <name> |
View specific medication history |
pharm history --days 7 |
h -d 7 |
View last 7 days of history |
pharm daemon |
d |
Start reminder daemon |
pharm --help |
Show help | |
pharm --version |
Show version |
All commands support short aliases for faster typing:
# These are equivalent:
pharm add "Aspirin" -d 500mg -t morning -f daily
pharm a "Aspirin" -d 500mg -t morning -f daily
# More examples:
pharm t "Aspirin" # Take
pharm l # List
pharm h --days 7 # History
pharm r "Old Med" # Remove
git clone https://github.com/sqrew/pharm
cd pharm
cargo build --release
./target/release/pharm --version
cargo test
Contributions are welcome! This is a simple, focused tool that does one thing well. When contributing, please:
Licensed under the MIT License. See LICENSE for details.
Built with:
pharm - Your terminal pharmacist helper 💊