Cursor Shortcuts: A CLI Tool for Opening Related Files with Shortcuts
Create shortcuts.json, run a command, open all related files instantly. Stop searching, start coding.
📋 TLDR - Quick Setup
Install:
npm install -g cursor-shortcuts
Create shortcuts.json:
json
{
"auth": {
"files": [
"src/components/LoginForm.tsx",
"src/app/actions/auth.ts",
"src/app/api/auth/login/route.ts"
]
}
}
Use:
s auth → opens all files instantly
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#
bash
npm install -g cursor-shortcuts2. Create shortcuts.json#
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#
bash
s auth # Opens all auth files
s contact # Opens all contact files
s list # Shows all available shortcutsReal Examples#
User Registration#
json
{
"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#
json
{
"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