光标全局配置
有关AI代理:请参阅 代理商.md
✨ 完全便携✨ - 把它放在机器上的任何地方!
用于AI辅助开发的便携式Cursor IDE配置
此目录包含所有可以在多台机器上轻松复制的全局Cursor IDE配置、工作流和自动化脚本。
🎯 主要特点:真正的便携性
把这个文件夹放在你想放的地方!
~/cursor-global/✅ 主目录~/Desktop/cursor-global/✅ 桌面~/Documents/tools/cursor-global/✅ 文件/Volumes/USB/cursor-global/✅ U盘~/Dropbox/cursor-global/✅ 云同步文件夹
跑 ./setup.sh 无论你把它放在哪里,一切都会自动适应!
所有脚本都使用自位置检测,不需要硬编码路径!
______________________________________________________________________
📁 目录结构
~/cursor-global/
├── config/ # Cursor IDE configuration files
│ ├── workflows.json # Global workflows (ai-*, mcp-*)
│ ├── mcp.json # MCP server configuration
│ ├── settings.json # Cursor IDE settings
│ └── global-scripts.json # Script registry
├── scripts/ # Automation scripts
│ ├── session-*.sh # AI session management
│ ├── git-*.sh # Git automation
│ ├── *-mcp-*.sh # MCP server management
│ └── *.sh # Other utilities
├── changelogs/ # AI session summaries and context
│ ├── config.json # Changelog configuration
│ ├── context-summary.md # Development context
│ └── session-*.md # Individual session summaries
├── docs/ # Documentation
└── README.md # This file______________________________________________________________________
🚀 快速设置(新机器)
超级简单-适用于任何地方!
# 1. Place cursor-global ANYWHERE you want
# Examples:
# - ~/cursor-global/
# - ~/Desktop/cursor-global/
# - ~/Documents/tools/cursor-global/
# - /Volumes/USB/cursor-global/
# 2. Navigate to wherever you placed it
cd /path/to/cursor-global
# 3. Run setup (auto-detects location!)
./setup.sh
# 4. Reload shell
source ~/.zshrc # or ~/.bashrc
# 5. Restart Cursor IDE
# Done! ✅就是这样! 安装程序会自动检测您放置文件夹的位置,并相应地配置所有内容。
高级:自动下载
# Download from Git and setup in one go
git clone https://github.com/YOUR_USERNAME/cursor-global.git ~/Desktop/cursor-global
cd ~/Desktop/cursor-global
./setup.sh______________________________________________________________________
🔬 便携性如何工作
自定位脚本
每个脚本都会自动检测自己的位置:
# At the top of each script:
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CURSOR_GLOBAL_DIR="$(dirname "$SCRIPT_DIR")"
# Then uses calculated paths:
CONFIG_DIR="$CURSOR_GLOBAL_DIR/config"
CHANGELOGS_DIR="$CURSOR_GLOBAL_DIR/changelogs"
SCRIPTS_DIR="$CURSOR_GLOBAL_DIR/scripts"结果: 无论你把文件夹放在哪里,脚本都能工作!
智能设置
当你奔跑时 ./setup.sh:
- 检测位置: 找出光标全局的位置
- 更新workflows.json: 写入您所在位置的绝对路径
- 更新路径: 将实际脚本目录添加到shell PATH
- 创建符号链接: 将~/.cursor/指向您的配置/
移动文件夹? 跑 ./setup.sh 再次从新的位置!
______________________________________________________________________
🔧 配置文件
config/workflows.json
全局游标工作流在所有项目中都可用:
config/recommended-extensions.txt
推荐的Cursor IDE扩展列表。看 docs/RECOMMENDED-EXTENSIONS.md 了解详情。
AI会话管理:
ai-start-加载会话上下文ai-end-保存会话和更改日志ai-update-记录进度ai-repeat-重新加载上下文ai-compress-压缩上下文ai-clean-清理临时文件
Git操作:
ai-local-commit-提交更改日志更新ai-local-merge-智能合并(防止更改日志冲突!)ai-merge-finalize-冲突解决后完成合并ai-docs-sync-生成工作流.md
MCP管理:
mcp-health-检查MCP服务器运行状况mcp-restart-重新启动所有MCP服务器
总计: 12个全球工作流程
config/mcp.json
MCP(模型上下文协议)服务器配置:
- 文件系统操作
- Shell命令执行
- GitHub集成
- 代理人自主权
- Asana任务管理(最少6个工具)
- 盒式文件存储(最少6个工具)
config/settings.json
针对AI辅助开发优化的游标IDE设置
______________________________________________________________________
📜 脚本
会话管理
session-start.sh-使用完整上下文初始化AI会话session-end.sh-保存会话摘要和更改日志session-update.sh-记录中期进度compress-context.sh-将会话上下文压缩为摘要
Git自动化
git-local-commit.sh-自动提交更改日志更新git-local-merge.sh-智能合并与变更日志冲突预防
- 从功能分支提取新的更改日志条目 - Git合并前预合并到main - 消除更改日志冲突(~100%→~0%) - 自动更新合并状态
MCP服务器管理
start-mcp-servers.sh-启动所有已配置的MCP服务器restart-mcp-servers.sh-重新启动MCP服务器check-mcp-health.sh-验证MCP服务器状态check-mcp-tool-count.sh-监控刀具数量(40个刀具限制)
公用事业
generate-workflows-doc.sh-自动生成工作流.mdconfigure-cursor-autonomy.sh-设置自主AI权限setup-cursor-environment.sh-完整环境设置
______________________________________________________________________
💡 用法示例
启动AI会话
# In Cursor chat, type:
ai-start
# Or run directly:
session-start.sh提交更改
# Auto-updates changelog and commits
ai-local-commit合并功能分支
# Smart merge with changelog conflict prevention
git checkout feature-branch
ai-local-merge
# If conflicts occur:
# ... resolve conflicts ...
git commit
ai-merge-finalize检查MCP状态
# Quick health check
mcp-health
# Restart if needed
mcp-restart______________________________________________________________________
🔄 与其他机器同步
导出当前配置
cd ~
tar -czf cursor-global-backup.tar.gz cursor-global/
# Copy cursor-global-backup.tar.gz to new machine在新机器上导入
tar -xzf cursor-global-backup.tar.gz -C ~/
cd ~/cursor-global
./setup.sh # If you have the setup script使用Git(推荐)
# On current machine (first time)
cd ~/cursor-global
git init
git add .
git commit -m "Initial cursor-global configuration"
git remote add origin https://github.com/YOUR_USERNAME/cursor-global.git
git push -u origin main
# On new machine
cd ~
git clone https://github.com/YOUR_USERNAME/cursor-global.git
cd cursor-global
# Follow "Quick Setup" steps above______________________________________________________________________
🎯 主要特点
智能变更日志合并
这 git-local-merge.sh 脚本使用智能算法来防止更改日志冲突:
- 识别 合并前main的最后一个更改日志条目
- 提取物 仅来自功能分支的新条目
- 预合并 main更改日志中的新条目
- 阶段 Git合并前的更新日志(无冲突!)
- 结果:变更日志冲突从100%减少→ ~0%
自动上下文管理
会话脚本跨会话维护开发上下文:
- 项目特定上下文跟踪
- 包含关键决策的会议总结
- 自动生成变更日志
- 进度跟踪
MCP集成
完整的MCP服务器生命周期管理:
- 会话初始化时自动启动
- 健康监测
- 刀具数量优化(40个刀具限制)
- 优雅的重启
______________________________________________________________________
📊 项目特定集成
在您的项目中
在中添加特定于项目的工作流 .cursor/workflows.json:
{
"proj-custom": {
"description": "Project-specific workflow",
"commands": ["./scripts/custom-script.sh"],
"auto_approve": true,
"timeout": 30000
}
}这些将自动与全球工作流程相结合!
自动文档
跑 ai-docs-sync 在任何项目中生成 workflows.md 它结合了:
- 全局工作流(来自
~/cursor-global/config/workflows.json) - 项目工作流(来自
.cursor/workflows.json)
______________________________________________________________________
🔧 定制
添加新工作流
- 编辑
~/cursor-global/config/workflows.json - 添加您的工作流条目
- 在中创建相应的脚本
~/cursor-global/scripts/如有需要 - 跑
ai-docs-sync更新文档
修改脚本
所有脚本都在 ~/cursor-global/scripts/ -直接编辑!
脚本中使用的关键路径:
~/cursor-global/config/-配置文件~/cursor-global/scripts/-脚本目录~/cursor-global/changelogs/-会话数据.cursor/-项目特定配置(每个项目中)
______________________________________________________________________
🐛 故障排除
未找到脚本
# Verify PATH
echo $PATH | grep cursor-global
# If not found, add to shell config
echo 'export PATH="$HOME/cursor-global/scripts:$PATH"' >> ~/.zshrc
source ~/.zshrc工作流未显示在光标中
# Verify symlink
ls -la ~/.cursor/workflows.json
# If missing, create it
ln -s ~/cursor-global/config/workflows.json ~/.cursor/workflows.json
# Restart Cursor IDEMCP服务器未启动
# Check MCP configuration
cat ~/.cursor/mcp.json # or ~/cursor-global/config/mcp.json
# Verify Node.js is installed
node --version
# Check MCP server logs
ls ~/.cursor/*.pid # Should show running servers______________________________________________________________________
📝 版本历史
- 2025-10-15 -初始便携式配置
- 智能变更日志合并实现 - 12个全球工作流程 - 完成MCP集成 - 会话管理自动化
______________________________________________________________________
🤝 贡献
如果您改进了这些工作流程或脚本:
- 在您的环境中进行彻底测试
- 本README中的文档更改
- 更新相关脚本/配置
- 考虑分享改进!
______________________________________________________________________
📄 许可证
这些配置和脚本按原样提供,供个人使用。自由修改以适应您的工作流程!
______________________________________________________________________
最后更新时间: 2025年10月15日 维护者: 您的开发团队 存储库: https://github.com/YOUR_USERNAME/cursor-global(可选)
