Skip to content

cursor rules cli #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 30, 2025
Merged

cursor rules cli #116

merged 3 commits into from
May 30, 2025

Conversation

skull8888888
Copy link
Collaborator

@skull8888888 skull8888888 commented May 30, 2025

Important

Adds add-cursor-rules CLI subcommand to download laminar.mdc file and updates version to 0.6.6.

  • CLI:
    • Adds add_cursor_rules() function in cli.py to download laminar.mdc from a hardcoded URL and save it to .cursor/rules/.
    • Updates cli() in cli.py to include add-cursor-rules subcommand for downloading the file.
  • Versioning:
    • Bumps version from 0.6.5 to 0.6.6 in pyproject.toml and version.py.

This description was created by Ellipsis for 68d1ac4. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added new CLI subcommand add-cursor-rules to download and install Laminar cursor rules from a hardcoded GitHub URL.

  • Downloads laminar.mdc from a hardcoded dev branch URL (https://raw.githubusercontent.com/lmnr-ai/lmnr/dev/rules/laminar.mdc), which could be unstable
  • Missing validation of downloaded content before writing to disk
  • Consider using pathlib.Path.write_bytes() instead of opening file in 'wb' mode for better error handling
  • Should verify HTTPS certificate when downloading from GitHub to prevent MITM attacks
  • Consider adding a --force flag to control overwriting of existing files

1 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

def add_cursor_rules(args):
"""Download laminar.mdc file from a hardcoded public URL and save it to .cursor/rules/laminar.mdc"""
# Hardcoded URL for the laminar.mdc file
url = "https://raw.githubusercontent.com/lmnr-ai/lmnr/dev/rules/laminar.mdc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: URL points to 'dev' branch which could be unstable. Consider using 'main' branch or making the branch configurable

src/lmnr/cli.py Outdated
@@ -16,6 +19,39 @@
EVAL_DIR = "evals"


def add_cursor_rules(args):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Function accepts args parameter but doesn't use it. Consider removing unused parameter

Suggested change
def add_cursor_rules(args):
def add_cursor_rules():

src/lmnr/cli.py Outdated
Comment on lines 142 to 146
parser_download = subparsers.add_parser(
"add-cursor-rules",
description="Download laminar.mdc file from a hardcoded public URL",
help="Download laminar.mdc file from a hardcoded public URL",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Description and help text are identical. Consider making help text more concise

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 7b92eb6 in 1 minute and 32 seconds. Click for details.
  • Reviewed 71 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_RXy2udHh7fORsoXU

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

src/lmnr/cli.py Outdated
@@ -16,6 +19,39 @@
EVAL_DIR = "evals"


def add_cursor_rules(args):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'args' parameter isn’t used in add_cursor_rules. Consider either using it or removing it from the signature.

Suggested change
def add_cursor_rules(args):
def add_cursor_rules():

LOG.info(f"Downloading laminar.mdc from {url}")

# Download the file
with urllib.request.urlopen(url) as response:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a timeout to urllib.request.urlopen to prevent hanging if the URL becomes unresponsive.

Suggested change
with urllib.request.urlopen(url) as response:
with urllib.request.urlopen(url, timeout=10) as response:

LOG.info(f"Successfully downloaded laminar.mdc to {target_file}")

except urllib.error.URLError as e:
LOG.error(f"Failed to download file from {url}: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of directly logging and calling sys.exit, consider using LOG.exception to capture the full stack trace for debugging.

Suggested change
LOG.error(f"Failed to download file from {url}: {e}")
LOG.exception(f"Failed to download file from {url}: {e}")

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 9fee6bb in 26 seconds. Click for details.
  • Reviewed 31 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/lmnr/cli.py:22
  • Draft comment:
    Good removal of the unused 'args' parameter from add_cursor_rules.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/lmnr/cli.py:152
  • Draft comment:
    Updated the call to add_cursor_rules() to match its new signature.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_6Ugzjmm1KCbL5Qgd

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 68d1ac4 in 28 seconds. Click for details.
  • Reviewed 26 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pyproject.toml:9
  • Draft comment:
    Version bump to 0.6.6 is applied correctly. Ensure changelog and related docs are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/lmnr/version.py:6
  • Draft comment:
    Updated version to 0.6.6. Consistent with pyproject.toml; looks good.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_YXZwzhd1jgXUitU2

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@skull8888888 skull8888888 merged commit a9d6b0d into main May 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant