Keep .uid files in sync
godot_uidRepairs Godot 4.4 .uid files left behind when scripts or shaders are moved outside the editor: pair orphaned uids with moved files, rewrite ext_resource paths, and detect clashes before a reference fails to load.
Instructions
Since Godot 4.4 every script and shader has a .uid file next to it. A file moved outside the editor (git mv, a shell, an IDE, an agent) leaves its .uid behind, Godot gives the moved file a new uid, and nothing says so until a reference by the old uid fails to load. op sync (default) pairs each .uid whose file is gone with the file that moved: git renames first (staged or committed), then a case-only rename, then references that name the uid with the new path, then the content the file had at the last commit, then the same name when the file declares what its references use; two files that both fit, or one that only has the name, are never guessed but listed to check by hand, and a moved file the editor gave a new uid nothing uses gets the old one back. It moves the .uid there, rewrites ext_resource paths and quoted res:// paths that name the old place (uid kept), gives scripts and shaders without a .uid the uid their references use or a new one (so every machine has the same), deletes a .uid whose file is gone when nothing uses it, and reports uid clashes and references to uids no file has. Dry run by default: one line per change (move, path, new, restore, delete) or problem (by hand, clash, unowned); write: true applies it through the journal (godot_undo reverts it). op check writes nothing and says in sync or out of sync with the same lines. For a move you have not made yet, use godot_rename: it moves the file with its .uid.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "godot_uid"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | sync (default): the plan, applied with write: true; check: only what is out of sync | |
| git | No | ask git for renames and committed versions (default true when the project is in git) | |
| path | No | project folder, or a file or folder inside it (relative to the server's folder; default: the current project) | |
| write | No | sync: apply the plan (default false: show it) | |
| include_addons | No | also give scripts and shaders in res://addons/ without a .uid one |