Skip to content

Conversation

@SK8-infi
Copy link
Contributor

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 SK8-infi changed the title Add lingo.dev init cursor Command for .cursorrules Setup feat(cli): lingo.dev init cursor Command for .cursorrules Setup (#1101) Oct 30, 2025
@SK8-infi
Copy link
Contributor Author

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

@SK8-infi
Copy link
Contributor Author

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

Copy link
Contributor

@The-Best-Codes The-Best-Codes left a comment

Choose a reason for hiding this comment

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

Your PR is looking awesome @SK8-infi 🔥

I've left a review of a couple things that need fixed below. Also, some general reminders:

  • Run pnpm run format before committing
  • Run pnpm new to create a changeset (do this once for your PR)

@SK8-infi
Copy link
Contributor Author

@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.

Copy link
Contributor

@The-Best-Codes The-Best-Codes left a comment

Choose a reason for hiding this comment

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

Just one change I'd recommend making! I haven't tested locally to make sure everything is working fine, but your PR is looking great 😀

I also have two questions:

  • Will this work well on Windows
  • Will this work well in productions builds that are deployed to npm (the file tree is different in prod than in dev)

@SK8-infi
Copy link
Contributor Author

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new lingo.dev init cursor subcommand that automates the creation of a .cursorrules file by copying a template from the package's assets directory. The command supports interactive prompts for overwriting existing files and a --force flag for non-interactive usage.

Key changes:

  • New cursor subcommand under lingo.dev init for generating .cursorrules files
  • Asset template file (agents.md) added to the CLI package
  • Dependency updates in the monorepo lockfile (@types/node from 24.2.0 to 24.9.2)

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/cli/src/cli/cmd/init/cursor.ts Implements the new cursor subcommand with file copy logic, overwrite prompts, and --force flag support
packages/cli/src/cli/cmd/init.ts Registers the cursor subcommand to the init command; removes extraneous blank line
packages/cli/assets/agents.md Adds template file for .cursorrules content (currently contains placeholder text)
.changeset/nasty-nails-repair.md Documents the feature addition as a minor version bump
pnpm-lock.yaml Updates @types/node from 24.2.0 to 24.9.2 and associated transitive dependencies across the monorepo
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SK8-infi
Copy link
Contributor Author

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

@SK8-infi
Copy link
Contributor Author

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

@maxprilutskiy
Copy link
Contributor

@SK8-infi this happens when pakcage json and lockfile are out of sync. Typically the reason is you added a dependency to package.json manually or using a different package manager instead of using pnpm add. A typical solution is to run pnpm i from the root of the repo, and commit the updated lockfile

@maxprilutskiy
Copy link
Contributor

Let me know once that is done and let's merge the PR! @SK8-infi

@maxprilutskiy maxprilutskiy enabled auto-merge (squash) December 24, 2025 01:03
@maxprilutskiy
Copy link
Contributor

@SK8-infi Please enable commit signature in your account, and re-push the commits so they're signed - otherwise GitHub won't let us merge the PR due to the security settings. Thank you!

https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

auto-merge was automatically disabled December 24, 2025 08:32

Head branch was pushed to by a user without write access

@SK8-infi
Copy link
Contributor Author

@maxprilutskiy Thanks for approval. I have re-pushed the commits with signature. Please check. Thanks.

@SK8-infi
Copy link
Contributor Author

@maxprilutskiy just checking in
The changes are signed and ready to be merged. Thanks

Change after discussion with The-Best-Codes over Discord
@The-Best-Codes
Copy link
Contributor

For reference: last time I tested this locally, it didn't work. I'll try it again ASAP.

Updated path resolution for AGENTS_MD to handle both development and production environments.

Was causing error of "agents.md not found"
with help from @the_best_codes resolved the issue
@The-Best-Codes
Copy link
Contributor

Works great!

@maxprilutskiy
Copy link
Contributor

@SK8-infi @The-Best-Codes 🎉 🎉 🎉

@maxprilutskiy maxprilutskiy merged commit 978b817 into lingodotdev:main Jan 15, 2026
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.

Add lingo.dev init cursor command for .cursorrules setup

3 participants