lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

feat(cli): lingo.dev init cursor Command for .cursorrules Setup (#1101)

Open SK8-infi opened this issue 1 month ago • 6 comments

Add lingo.dev init cursor Command for .cursorrules Setup

Closes #1101

Summary

Adds a new cursor subcommand to lingo.dev init that automates the creation of a .cursorrules file in the project root by copying the template from agents.md.


Features & Implementation

  • New Command:
    lingo.dev init cursor

    • Generates .cursorrules in your repo root by copying the contents of agents.md (also in the root).
  • File Handling:

    • If .cursorrules already exists:
      • Prompts user for overwrite (unless run with --force, which skips prompt and overwrites directly).
      • Skips and notifies if user declines overwrite.
    • Fails with a clear error if agents.md does not exist.
  • User Feedback:

    • Success and info spinners/messages for all operations.
    • Clear warning/error output for missing templates or write issues.
  • CLI Structure:

    • Refactored init to support subcommands (project for the original logic, cursor as a sibling).
    • All code follows project structure and CLI command registration best practices.

Scenarios Tested

  • .cursorrules creation when file does not exist.
  • Overwriting an existing .cursorrules (prompt and forced mode).
  • Skipping overwrite if user answers "No".
  • Proper handling and messaging if agents.md is missing.
  • Works both interactively and with --force for scripted/non-interactive use.

User Experience

  • Usage:

    lingo.dev init cursor
    # or, for non-interactive scripting:
    lingo.dev init cursor --force
    
  • Output:

    ✓ Created .cursorrules
    📝 .cursorrules has been created with i18n-specific instructions for Cursor AI.
    

Ready for review!
This PR brings core parity with expected subcommand conventions and ensures proper rules bootstrapping for the Cursor AI developer workflow.

SK8-infi avatar Oct 30 '25 12:10 SK8-infi

Hii @sumitsaurabh927 Can you please review the code and give the workflow approval. Thanks

SK8-infi avatar Oct 30 '25 13:10 SK8-infi

Hii @sumitsaurabh927 @The-Best-Codes Can you please review the code please

SK8-infi avatar Nov 10 '25 03:11 SK8-infi

@The-Best-Codes Thanks for reviewing the code. Resolved all the issues. The code looks much cleaner now. Please also do point if anything else is off.

SK8-infi avatar Nov 10 '25 07:11 SK8-infi

Hii @The-Best-Codes Did some minor tweaks. It will now work for both windows and prod. For index.ts I left a reply and would appreciate some help Thanks

SK8-infi avatar Nov 11 '25 21:11 SK8-infi

@maxprilutskiy Resolved all the issues pointed by Copilot. Ready for review.

SK8-infi avatar Nov 12 '25 06:11 SK8-infi

Hii @sumitsaurabh927 Having some issue in release.yml check. Can you please help in troubleshooting. Thanks image

SK8-infi avatar Nov 12 '25 09:11 SK8-infi