Dev Package
Launchpad provides a dedicated command for installing and managing the dev
package, which is a powerful tool for development environment management.
What is the Dev Package?
The dev
package is a developer-focused tool that allows you to:
- Create project-specific development environments
- Activate tools and dependencies only when needed
- Maintain consistent environments across projects
You can learn more about the dev
package at https://github.com/pkgxdev/dev.
Installing Dev
Installing the dev
package is as simple as:
launchpad dev
This command:
- Checks if pkgx is installed (and installs it if needed)
- Creates a shim for the
dev
command - Adds the shim directory to your PATH (if configured to do so)
Installation Location
By default, the dev
shim is installed to:
/usr/local/bin
if it's writable by the current user~/.local/bin
as a fallback location
You can specify a different installation location:
launchpad dev --path ~/bin
Force Reinstallation
To reinstall the dev
package even if it's already installed:
launchpad dev --force
PATH Management
For the dev
shim to work, its directory must be in your PATH. Launchpad can automatically add the shim directory to your PATH:
# Launchpad will add the shim directory to your PATH (default behavior)
launchpad dev
If you don't want automatic PATH modifications:
launchpad dev --no-auto-path
How Dev Works
The dev
command leverages pkgx to create isolated, project-specific environments. When you run:
dev .
In a project directory, it:
- Looks for a
package.json
,dev.json
, or other configuration files - Sets up the proper environment with all required tools
- Activates the environment for your current shell
Implementation Details
When you install the dev
package with Launchpad, it creates a simple shim script:
#!/bin/sh
exec pkgx -q dev "$@"
This shim tells your system to execute pkgx -q dev
with any arguments you provide when you run the dev
command.
Benefits Over Direct Installation
Installing the dev
package through Launchpad offers several advantages:
- Simplified Installation: No need to manually install pkgx first
- PATH Management: Automatic PATH updates for easier access
- Cross-platform Support: Works on macOS, Linux, and Windows
- Consistent Interface: Same command structure as other Launchpad commands
Using Dev After Installation
After installing the dev
package, you can use it to activate development environments:
# Navigate to your project
cd your-project
# Activate the development environment
dev .
# Run project commands
npm run dev
Verifying Installation
You can verify that the dev
package is correctly installed:
dev --version
This should display the version of the dev
package that's installed.