Cleanup Entrypoints
cleanup_entrypoints() -> None:
Section titled “cleanup_entrypoints() -> None:”Remove all registered command aliases and clean up completely
Removes all command aliases created with register_entrypoint and cleans up the registry.
Raises:
OSError: If unable to remove script files or registry
import angreal
# Create multiple aliasesangreal.register_entrypoint("tool1")angreal.register_entrypoint("tool2")angreal.register_entrypoint("tool3")
# List current aliasesprint("Before cleanup:", angreal.list_entrypoints())# Output: ['tool1', 'tool2', 'tool3']
# Remove all aliasesangreal.cleanup_entrypoints()
# Verify cleanupprint("After cleanup:", angreal.list_entrypoints())# Output: []What Gets Removed:
- All executable scripts from
~/.local/bin/ - The entire aliases registry file
- Cross-platform cleanup for all registered aliases
Use Cases:
- Development cleanup: Remove test aliases during development
- Uninstallation: Clean up all aliases before uninstalling angreal
- Fresh start: Reset alias configuration