Calcxporte_r
August 12, 2025 ยท View on GitHub
calcxporte_r is a Rust command-line tool that integrates with the calcure TUI calendar. It reads your scheduled events from calcure's data file, formats them into a styled HTML email, and sends you a daily reminder using the Resend email API.
How It Works
The application executes the following steps:
- Loads environment variables (API Key, recipient emails) from a
.envfile. - Locates the
calcureevents file at~/.config/calcure/events.csv. - Creates a temporary copy of this file named
events.csvin the project's root directory. It prepends the necessary CSV headers (id,year,month,day,...) to this copy to enable correct parsing, without modifying your originalcalcurefile. - Parses the event data from the temporary CSV file.
- Generates a clean, styled HTML body that lists each event with its date and urgency level. Events marked as
importantare highlighted differently from those markednormal. - Uses the Resend API to send the generated HTML as an email to your configured recipient address.
Prerequisites
Before you begin, ensure you have the following:
- Rust: Version 1.65 or higher.
- Calcure: A working installation of
calcurewith events stored in~/.config/calcure/events.csv. - Resend Account: A Resend account with a generated API key and a configured sending domain/email address.
Setup and Configuration
-
Clone the Repository
git clone https://github.com/sponkurtus2/calcxporte_r.git cd calcxporte_r -
Configure Environment Variables Create a
.envfile in the project root by copying the example file:cp .env.example .envOpen the
.envfile and fill in your details:# Your secret API key from Resend. API_KEY=YOUR_RESEND_API_KEY # The email address that will receive the reminder. RECEIVER_EMAIL=your.email@example.com # The "from" email address configured in your Resend account. FROM_RESEND_EMAIL=sender@your-resend-domain.com
Usage
To run the application and send a reminder email, execute the following command from the project's root directory:
cargo run --release
The program will read your calcure events and send the email immediately.
Automating Daily Reminders
For automatic daily reminders, you can schedule the application to run using a cron job.
-
First, build the optimized release binary:
cargo build --releaseThe executable will be located at
target/release/calcxporteR. -
Open your crontab for editing:
crontab -e -
Add a new line to schedule the job. The following example runs the application every day at 8:00 AM. Make sure to replace
/path/to/your/projectwith the absolute path to thecalcxporte_rdirectory.# Send calcure email reminder every day at 8:00 AM 0 8 * * * cd /path/to/your/project/calcxporte_r && ./target/release/calcxporteR