feat(cli): lingo.dev init cursor Command for .cursorrules Setup (#1101)
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
.cursorrulesin your repo root by copying the contents ofagents.md(also in the root).
- Generates
-
File Handling:
- If
.cursorrulesalready exists:- Prompts user for overwrite (unless run with
--force, which skips prompt and overwrites directly). - Skips and notifies if user declines overwrite.
- Prompts user for overwrite (unless run with
- Fails with a clear error if
agents.mddoes not exist.
- If
-
User Feedback:
- Success and info spinners/messages for all operations.
- Clear warning/error output for missing templates or write issues.
-
CLI Structure:
- Refactored
initto support subcommands (projectfor the original logic,cursoras a sibling). - All code follows project structure and CLI command registration best practices.
- Refactored
Scenarios Tested
.cursorrulescreation 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.mdis missing. - Works both interactively and with
--forcefor 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.
Hii @sumitsaurabh927 Can you please review the code and give the workflow approval. Thanks
Hii @sumitsaurabh927 @The-Best-Codes Can you please review the code please
@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.
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
@maxprilutskiy Resolved all the issues pointed by Copilot. Ready for review.
Hii @sumitsaurabh927
Having some issue in release.yml check. Can you please help in troubleshooting. Thanks