What Is a Provider?
A provider is a shell module in lib/providers/ that implements the backend-specific logic for a package manager. Each provider handles the actual CLI calls for install, search, remove, list, update, and run.
Provider Interface
Every provider should implement these functions:
Required Functions
- install - install a package via the backend
- search - search for packages
- remove - remove a package
- list - list installed packages
Optional Functions
- update - update all packages from this backend
- run - launch an installed application
- check - verify the backend is available (used by
doctor)
How Providers Are Loaded
When TinyPM receives a command with a backend flag (e.g. -f for Flatpak), the core:
- Parses the flag to determine the backend
- Sources the appropriate provider from
lib/providers/ - Calls the provider function matching the action
If no flag is provided, TinyPM uses default selection logic to pick a backend.
Existing Providers
Flatpak Provider
Wraps the flatpak CLI. Handles reverse-DNS package names, Flathub remotes, and sandboxed app launching.
Snap Provider
Wraps the snap CLI. Handles simple package names, snapd service checks, and confinement.
APT Provider
Wraps the apt CLI. Handles sudo elevation, repository management, and native package names.
Future: pacman Provider
A planned provider for Arch Linux's pacman package manager, designed for Abora integration. This will follow the same interface pattern.