cursor-link
v1.1.0
Published
CLI tool to sync cursor rules with cursor.link
Maintainers
Readme
cursor-link CLI
A command-line tool to sync your cursor rules with cursor.link.
Installation
Install globally via npm/pnpm:
npm install -g cursor-link
# or
pnpm add -g cursor-link
# or run directly with npx
npx cursor-link --helpQuick Start
Authenticate with cursor.link:
cursor-link auth loginThis will open your browser for device authorization.
Push your local cursor rules:
cursor-link pushPull rules from cursor.link:
cursor-link pull
Commands
cursor-link auth [action]
Manage authentication with cursor.link.
cursor-link auth login- Sign in using device authorizationcursor-link auth logout- Sign outcursor-link auth status- Check authentication status
cursor-link push [options]
Push local cursor rules to cursor.link.
Options:
--public- Make rules public (default: private)--force- Overwrite existing rules without confirmation
Example:
cursor-link push --publiccursor-link pull [options]
Pull cursor rules from cursor.link to your local project.
Options:
--list- List available rules without downloading--all- Include public rules from other users (default: only your rules)
Example:
cursor-link pull --all --listHow it Works
Push Process
- Scans your
.cursor/rules/directory for.mdcfiles - Parses each file to extract title, content, and settings
- Uploads rules to your cursor.link account
- Handles conflicts by asking for your preference
Pull Process
- Fetches available rules from cursor.link
- Shows an interactive selection interface
- Downloads selected rules to
.cursor/rules/ - Preserves frontmatter settings like
alwaysApply
File Format
The CLI works with cursor rule files in the .cursor/rules/ directory. Each file should be a .mdc file with this format:
---
alwaysApply: true
---
# My Rule Title
Rule content goes here...Environment Variables
CURSOR_LINK_URL- Override the default server URL (default: https://cursor.link)
Requirements
- Node.js 18+
- A cursor.link account
- Project with
.cursor/rules/directory
Authentication
The CLI uses OAuth 2.0 Device Authorization Grant (RFC 8628) for secure authentication. When you run cursor-link auth login:
- A device code is generated
- Your browser opens to the verification page
- You enter the displayed code to authorize the CLI
- The CLI receives an access token and stores it securely
Your authentication token is stored in ~/.cursor-link/token.json.
Troubleshooting
"Not authenticated" error
Run cursor-link auth login to sign in.
"Cursor rules directory not found"
Make sure you're in a project directory with a .cursor/rules/ folder.
Rules not showing up
Check that your .mdc files are properly formatted with frontmatter.
Network errors
Verify your internet connection and that cursor.link is accessible.
Development
To set up for development:
git clone <repo>
cd cursor-link-cli
pnpm install
pnpm run build
npm link # Makes cursor-link command available globally