Skip to content

Instantly share code, notes, and snippets.

@kleneway
Last active March 13, 2025 08:02
Show Gist options
  • Save kleneway/5860bb574630313826ca34d1af608b0d to your computer and use it in GitHub Desktop.
Save kleneway/5860bb574630313826ca34d1af608b0d to your computer and use it in GitHub Desktop.
script to add today's date to your .cursor-updates file
#!/bin/bash
# Path to the .cursor-updates file (update this with your own .cursor-updates file)
CURSOR_FILE="/full/path/to/your/.cursor-updates"
# Get today's date in YYYY-MM-DD format
TODAY=$(date +%Y-%m-%d)
# Create a temporary file
TMP_FILE=$(mktemp)
# Write the new date line
echo "## ${TODAY}" > "$TMP_FILE"
# Append the rest of the file starting from line 4 (skipping the header and old date)
tail -n +4 "$CURSOR_FILE" >> "$TMP_FILE"
# Add the header back with today's date
(
echo "# Cursor Updates"
echo ""
echo "This file tracks significant changes made to the codebase through Cursor agent interactions. Today's date is: ${TODAY}"
cat "$TMP_FILE"
) > "$CURSOR_FILE"
# Clean up
rm "$TMP_FILE"
@kleneway
Copy link
Author

kleneway commented Jan 21, 2025

For macOS, to set this up to run every day at 1am (or when you next turn on your machine) you need a plist file. Ask o1 to create it or customize this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.psl.cursor-update</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/kleneway/Projects/psl-platform/scripts/update-cursor-date.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>1</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
    <key>StandardErrorPath</key>
    <string>/Users/kleneway/Projects/psl-platform/scripts/cursor-update.err</string>
    <key>StandardOutPath</key>
    <string>/Users/kleneway/Projects/psl-platform/scripts/cursor-update.log</string>
</dict>
</plist> 

Then run a command that looks like this:

mkdir -p ~/Library/LaunchAgents && mv com.psl.cursor-update.plist ~/Library/LaunchAgents/ && launchctl load ~/Library/LaunchAgents/com.psl.cursor-update.plist

You might need to set the shell script as executable using chmod. For PC / Linux users, ask o1 to generate the step by step instructions

@damianesteban
Copy link

Where is this file? I cannot find it anywhere.

@mathivhahy
Copy link

Where is this file? I cannot find it anywhere.

I think you have to create it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment