codemap_label_migrate

Migrate assignments from one label to another. Useful for renaming or consolidating labels.

labelsmigraterenameconsolidate

Parameters

NameTypeRequiredDescription
fromLabelIdstring✅ RequiredSource label ID to migrate from
toLabelIdstring✅ RequiredDestination label ID to migrate to
targetstring|array❌ OptionalOptional: specific targets or glob patterns (omit for all)

Usage Examples

MCP Usage (for AI Agents like Claude)

json
{
  "name": "codemap_label_migrate",
  "arguments": {
    "fromLabelId": "lbl_old_wip",
    "toLabelId": "lbl_work_in_progress_241291"
  }
}

Example Output

JSON Response

json
{
  "ok": true,
  "migrated": 8,
  "fromLabel": {
    "id": "lbl_old_wip",
    "name": "Old WIP"
  },
  "toLabel": {
    "id": "lbl_work_in_progress_241291",
    "name": "Work In Progress"
  },
  "targets": [
    "src/features/auth/login.ts",
    "src/features/auth/signup.ts",
    "src/components/Dashboard.vue",
    "src/components/Header.vue",
    "src/api/auth-routes.ts",
    "src/services/auth-service.ts",
    "src/utils/validators.ts",
    "src/types/auth.ts"
  ]
}
ℹ️When to Use This Tool
  • Consolidate duplicate labels into one
  • Rename labels by migrating to new label with better name
  • Reorganize labeling scheme
  • Clean up deprecated labels
💡Common Patterns
Consolidation: Merge similar labels
Renaming: Create new label, migrate from old, delete old
Cleanup: Migrate before deleting unused labels
💡Pro Tips
  • Omit target to migrate ALL assignments
  • Use target patterns to migrate selectively
  • Verify with label_search before migrating
  • Source label remains after migration (use label_delete to remove)
  • Migration is tracked in session log

Related Tools