Package Management
One of the core features of Launchpad is its ability to manage packages through the install
command, which leverages pkgx under the hood.
Installation Basics
Installing packages with Launchpad is straightforward:
# Install a single package
launchpad install node
# Install multiple packages at once
launchpad install python ruby go
How Package Installation Works
When you run an installation command, Launchpad:
- Checks if pkgx is installed (and installs it if needed)
- Queries pkgx for the package information
- Creates the necessary installation directories
- Installs the package using pkgx
- Optionally creates shims for executables
Installation Location
By default, packages are installed to:
/usr/local
if it's writable by the current user~/.local
as a fallback location
You can specify a custom installation path:
launchpad install --path ~/my-packages node
Handling Permissions
When installing to system directories like /usr/local
, you might need elevated permissions. Launchpad provides two options:
Auto-sudo mode (enabled by default):
bash# Launchpad will automatically use sudo if needed launchpad install node
Manual sudo mode:
bash# Explicitly use sudo sudo launchpad install node # Or disable auto-sudo and specify when needed launchpad install --sudo node
You can disable auto-sudo in the configuration:
{
"autoSudo": false
}
Version Control
Launchpad can install specific versions of packages:
# Install a specific version
launchpad install node@16
Force Reinstallation
If a package is already installed, Launchpad will skip it by default. You can force reinstallation:
launchpad install --force node
Retries and Timeouts
Launchpad handles network issues with automatic retries:
- Default retries: 3 attempts
- Default timeout: 60 seconds (60000ms)
You can customize these in the configuration:
{
"maxRetries": 5,
"timeout": 120000
}
Verbose Mode
For debugging or to see detailed installation information:
launchpad install --verbose node
Bun Installation
Launchpad provides a dedicated command for installing Bun directly from official GitHub releases:
# Install latest version of Bun
launchpad bun
# Install a specific version
launchpad bun --version 1.2.3
# Customize installation path
launchpad bun --path ~/my-bin
# Force reinstallation
launchpad bun --force
This command:
- Automatically detects your platform and architecture
- Downloads the appropriate Bun binary from GitHub releases
- Installs it to the specified path
- Adds the installation directory to your PATH (if needed)
Unlike the general install
command, launchpad bun
doesn't require pkgx as it downloads directly from GitHub.
Listing Installed Packages
You can see all installed packages:
launchpad list
# or
launchpad ls
The output shows each package name and its version.