Run this one-liner in your project root to install or update the rule:
curl -s https://gist.githubusercontent.com/codekiln/242b572c64c1097277fd4c831db91c10/raw/update.sh | bash
This will:
- Install the rule if it doesn't exist
- Update it if a newer version is available
- Let you know if you're already on the latest version
- This script is designed for macOS. Linux users will need to modify the
awk
commands in the script. - The script requires:
curl
for downloading files- GitHub CLI (
gh
) for version checking jq
for parsing JSON responsesawk
for text processing
If you prefer to install manually or need to modify for Linux, you can:
- First, get the latest gist version:
VERSION=$(gh api /gists/242b572c64c1097277fd4c831db91c10/commits | jq -r ".[0].version" | cut -c1-8)
- Download and prepare the file:
# Create directory if needed
mkdir -p .cursor/rules
# Download the file
curl -o .cursor/rules/cursor-project-rule-editor.mdc "https://gist.githubusercontent.com/codekiln/242b572c64c1097277fd4c831db91c10/raw/cursor-project-rule-editor.mdc"
# Add version number (macOS syntax)
awk -v ver="$VERSION" 'BEGIN {p=1} /^---/ && p==1 {print; print "versionNum:", ver; p++; next} {print}' \
.cursor/rules/cursor-project-rule-editor.mdc > .cursor/rules/cursor-project-rule-editor.mdc.tmp && \
mv .cursor/rules/cursor-project-rule-editor.mdc.tmp .cursor/rules/cursor-project-rule-editor.mdc
- cursor-project-rule-editor.mdc - The main rule file
- update.sh - The installation/update script