Santa - A package manager meta-tool
Santa is a comprehensive package manager abstraction layer that provides unified interfaces across different package managers and platforms. It supports multiple package sources (apt, brew, cargo, etc.) and offers features like caching, configuration management, and async command execution.
Quick Start
use ;
use Path;
#
Features
- Multi-platform Support: Works across Linux, macOS, and Windows
- Unified Interface: Common API for different package managers
- Async Operations: Non-blocking package operations using tokio
- Caching: Intelligent caching of package lists and metadata
- Configuration: Flexible YAML-based configuration system
- Security: Input sanitization and shell escape protection
- Hot Reload: Configuration changes without restart
Architecture
Santa is built around several core concepts:
- [
PackageSource]: Individual package manager implementations - [
SantaConfig]: Configuration management and validation - [
SantaData]: Platform detection and source management - [
PackageCache]: Caching layer for performance - [
SantaError]: Unified error handling
Error Handling
All fallible operations return [Result<T>] where the error type is [SantaError].
This provides structured error information with context about what operation failed.
use ;
use Path;
match load_from
Safety
Santa takes security seriously, especially around shell command execution:
- All user inputs are sanitized before shell execution
- Package names are validated against known-safe patterns
- Command injection protection using
shell-escapecrate - No raw shell command execution from user input
Performance Considerations
- Caching reduces repeated package manager queries
- Async operations prevent blocking on slow package managers
- Lazy loading of configuration and package data
- Memory-efficient data structures with reference counting where appropriate