AgentSkillsCN

tool-config-backup

备份并记录 IDE 及工具配置。当您需要在修改前保存工具设置、了解配置文件的位置、创建恢复点,或梳理各配置文件所控制的功能时,此功能不可或缺。当用户输入“备份 DataGrip 配置”、“保存我的 IDE 设置”、“VS Code 的设置在哪里?”、“修改前先备份”或“配置备份”等指令时,此功能便可派上用场。

SKILL.md
--- frontmatter
name: tool-config-backup
description: Backup and document IDE and tool configurations. Use when needing to save tool settings before changes, understand config file locations, create restore points, or document what configuration files control. Triggers on phrases like "backup DataGrip config", "save my IDE settings", "where are VS Code settings", "backup before changes", or "config backup".

Tool Config Backup

Backup, document, and restore IDE and tool configurations.

Supported Tools

ToolConfig LocationKey Files
DataGrip~/Library/Application Support/JetBrains/DataGrip<version>/options/dataSources.xml, options/dataSources.local.xml
IntelliJ IDEA~/Library/Application Support/JetBrains/IntelliJIdea<version>/options/, keymaps/
VS Code~/Library/Application Support/Code/User/settings.json, keybindings.json
Cursor~/Library/Application Support/Cursor/User/settings.json, keybindings.json
iTerm2~/Library/Preferences/com.googlecode.iterm2.plist
Homebrew/opt/homebrew/ or /usr/local/Brewfile (generate with brew bundle dump)

Workflow

1. Identify Config Files

For the requested tool, locate config files:

bash
ls -la "<config-location>"

2. Create Timestamped Backup

bash
TOOL="datagrip"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="$HOME/.config-backups/$TOOL/$TIMESTAMP"

mkdir -p "$BACKUP_DIR"
cp -r "<source-config-path>" "$BACKUP_DIR/"

3. Document Backup

Create manifest in backup directory:

markdown
# Backup Manifest

Tool: DataGrip 2021.3
Date: 2026-02-02 09:30:00
Reason: Before regenerating data source configs

## Files Backed Up

- options/dataSources.xml (database connections)
- options/dataSources.local.xml (credentials reference)

## Restore Command

cp -r ~/.config-backups/datagrip/20260202_093000/\* \
 "~/Library/Application Support/JetBrains/DataGrip2021.3/"

Tool-Specific Guides

DataGrip

What to backup:

  • options/dataSources.xml - Data source definitions (connections, drivers)
  • options/dataSources.local.xml - Local credential references
  • Project .idea/dataSources.xml - Project-level connections

What controls what:

FileControls
dataSources.xmlConnection URLs, drivers, SSH tunnels
dataSources.local.xmlPassword storage references (points to keychain)
workspace.xmlUI layout, open tabs, panel positions

Note: Passwords stored in macOS Keychain, not in XML files.

VS Code / Cursor

What to backup:

  • settings.json - All editor preferences
  • keybindings.json - Custom keyboard shortcuts
  • extensions/ - Installed extensions (or just list with code --list-extensions)

Quick backup:

bash
code --list-extensions > extensions.txt
cp settings.json keybindings.json ~/.config-backups/vscode/

JetBrains IDEs (General)

Common locations:

  • options/ - IDE settings, plugins, appearance
  • keymaps/ - Custom keyboard shortcuts
  • codestyles/ - Code formatting rules
  • templates/ - Live templates and file templates

Restore Workflow

  1. Close the application
  2. Copy backup files to config location
  3. Restart application
  4. Verify settings loaded correctly
bash
# Example restore
cp -r ~/.config-backups/datagrip/20260202_093000/options/* \
  "~/Library/Application Support/JetBrains/DataGrip2021.3/options/"

Best Practices

  • Always backup before making config changes
  • Use descriptive reason in manifest
  • Keep last 3-5 backups per tool
  • Test restore on non-critical settings first