Remove Orphan Keys
remove_orphan_keysDetect and delete orphan translation keys not used in source code, with an initial dry run to preview changes.
Instructions
Find orphan keys (not referenced in source code) and remove them from all locale files. Always does a dry run first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | Layer name to clean up (e.g., "root", "app-admin"). If omitted, cleans all layers. Call discover to discover available layers. | |
| locale | No | Locale code to read translation keys from for orphan detection (e.g., "en", "en-US"). Defaults to the project default locale. | |
| scanDirs | No | Absolute paths to directories to scan for source code usage. Defaults to all layer root directories. Example: ["/home/user/my-app/apps/admin"]. | |
| excludeDirs | No | Directory names to skip when scanning source files. Example: ["storybook", "__tests__", "node_modules"]. | |
| dryRun | No | When true (default), only reports what would be removed without deleting anything. Set to false to permanently delete orphan keys. | |
| projectDir | No | Absolute path to the Nuxt project root. Defaults to server cwd. Example: "/home/user/my-app". | |
| outputFile | No | Absolute path to write full JSON output. Returns only a compact summary to the caller — use this for large outputs to avoid flooding the conversation context. Example: "/tmp/cleanup-unused.json" |