TheDocumentation Index
Fetch the complete documentation index at: https://glotctl.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
clean command removes unused or orphan translation keys from your locale JSON files.
Usage
Options
Actually delete keys. Without this flag, glot runs in dry-run mode and only
shows what would be deleted.
Rules to clean. Can be specified multiple times. If not specified, all rules are applied.Possible values:
unused- Keys defined in locale files but not used in codeorphan- Keys in non-primary locales but not in primary locale
Override the source code root directory. Defaults to the value from configuration file.
Override the messages directory path. Defaults to the value from configuration file.
Override the primary locale. Defaults to the value from configuration file.
Enable verbose output for debugging.
Dry-Run Mode (Default)
By default, glot runs in dry-run mode to preview changes:Apply Changes
To actually delete the keys:Clean Specific Key Types
Unused Keys Only
Remove keys that exist in locale files but are never used in code:Orphan Keys Only
Remove keys that exist in non-primary locales but not in the primary locale:When
--rules is not specified, both unused and orphan keys are cleaned.Safety Checks
Glot includes safety mechanisms to prevent accidental data loss: If you see this message:- Replace dynamic keys with static alternatives
- Use
// glot-message-keys "pattern.*"to declare which keys are used dynamically
Handling Dynamic Keys
Examples
Preview All Cleanable Keys
Clean Everything
Clean Only Unused Keys with Custom Source Root
Related
Directives
Use glot-message-keys for dynamic keys
Orphan Keys
Understanding orphan key detection
Missing Keys
Understanding missing key detection