Cursor Shortcuts: A CLI Tool for Opening Related Files with Shortcuts
The Problem
You're working on a login form. You need to open:
- The form component
- The server action
- The API endpoint
- The validation file
Current workflow: Search, click, search, click, search, click... 😤
The Solution
Create shortcuts.json, run a command, done. 🚀
Quick Setup
1. Install
npm install -g cursor-shortcuts
2. Create shortcuts.json
{
"auth": {
"description": "Login form and API",
"files": [
"src/components/LoginForm.tsx",
"src/app/actions/auth.ts",
"src/app/api/auth/login/route.ts",
"src/lib/validations/auth.ts"
]
},
"contact": {
"description": "Contact form workflow",
"files": [
"src/components/ContactForm.tsx",
"src/app/actions/contact.ts",
"src/app/api/contact/route.ts"
]
}
}
3. Use
s auth # Opens all auth files
s contact # Opens all contact files
s list # Shows all available shortcuts
Real Examples
User Registration
{
"register": {
"files": [
"src/components/RegisterForm.tsx",
"src/app/actions/auth.ts",
"src/app/api/auth/register/route.ts",
"src/lib/db/schema.ts"
]
}
}
Product Management
{
"product": {
"files": [
"src/components/ProductForm.tsx",
"src/app/actions/product.ts",
"src/app/api/products/route.ts",
"src/lib/upload.ts"
]
}
}
That's It
Stop searching, start coding.
- ✅ Create shortcuts.json
- ✅ Run
s your-shortcut
- ✅ All related files open instantly
Installation: npm install -g cursor-shortcuts
Repository: https://github.com/jerrickhakim/cursor-shortcuts
NPM Package: https://npmjs.com/package/cursor-shortcuts