
Product
Socket Zero Introduces Automated Remediation PRs
Put vulnerability remediation on autopilot with automated security patches and intelligent dependency upgrades across your GitHub repositories.
github.com/0xshariq/ruby_package_installer_cli
Advanced tools
A Ruby wrapper around the Package Installer CLI - a cross-platform, interactive CLI to scaffold modern web application templates with support for multiple frameworks, languages, and development tools. Create production-ready projects in seconds!
The gem automatically installs Node.js dependencies during installation:
gem install package-installer-cli
What happens during installation:
npm install (or pnpm/yarn if available)Before installing, ensure you have:
# Check Ruby version (>= 2.6.0 required)
ruby --version
# Check Node.js version (>= 18.0.0 required)
node --version
# Check npm availability
npm --version
If automatic dependency installation fails, follow these steps based on your installation type:
Step 1: Install the Ruby Gem Globally
gem install package-installer-cli
Step 2: Locate and Install Dependencies
# Method 1: Using gem environment (recommended)
cd $(gem environment gemdir)/gems/package-installer-cli-*/
npm install --production
# Method 2: Using gem which command
GEM_DIR=$(gem which package_installer_cli | xargs dirname | xargs dirname)
cd "$GEM_DIR" && npm install --production
# Method 3: Manual search
find $(gem environment gemdir) -name "package-installer-cli-*" -type d
cd /found/path && npm install --production
Step 1: Add to Gemfile
# Gemfile
gem 'package-installer-cli'
Step 2: Install with Bundle
bundle install
Step 3: Install Node.js Dependencies
# Method 1: Using bundle info (recommended)
GEM_DIR=$(bundle info package-installer-cli --path)
cd "$GEM_DIR" && npm install --production
# Method 2: Direct path
cd vendor/bundle/ruby/*/gems/package-installer-cli-*/
npm install --production
Step 4: Use with Bundle Exec
bundle exec pi create
bundle exec pi --version
Step 1: Install to User Directory
gem install --user-install package-installer-cli
Step 2: Install Dependencies
# Find user gem directory
USER_GEM_DIR=$(gem environment | grep "USER INSTALLATION DIRECTORY" | cut -d: -f2 | tr -d ' ')
cd "$USER_GEM_DIR"/gems/package-installer-cli-*/
npm install --production
# Alternative method
cd ~/.gem/ruby/*/gems/package-installer-cli-*/
npm install --production
# Test CLI availability
pi --version
pi --help
# Run diagnostics
pi doctor
# Check Node.js dependencies
cd $(dirname $(gem which package_installer_cli))/../..
ls -la node_modules/ | head -5
Add this line to your application's Gemfile:
gem 'package-installer-cli'
And then execute:
bundle install
❌ "Node.js not found" Error
# Install Node.js from official website
# Visit: https://nodejs.org/
# Or use a version manager:
# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install --lts
nvm use --lts
# Using fnm
curl -fsSL https://fnm.vercel.app/install | bash
fnm install --lts
fnm use lts-latest
❌ "Permission denied" during npm install
# Fix npm permissions (Linux/macOS)
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
# Or use npx to install without global permissions
npx package-installer-cli create
❌ "Gem installation failed"
# Update RubyGems
gem update --system
# Clean gem cache
gem cleanup
# Try installing with verbose output
gem install package-installer-cli --verbose
❌ Dependencies installation timeout
# Set longer npm timeout
npm config set timeout 300000
# Or install manually in gem directory
cd $(dirname $(gem which package_installer_cli))/../..
npm install --production --timeout=300000
For easier dependency installation, use the included automated script:
# After installing the gem, run the auto-install script
gem install package-installer-cli
# Find and run the installation script
SCRIPT_PATH=$(dirname $(gem which package_installer_cli))/../install_dependencies.sh
bash "$SCRIPT_PATH"
# Or download and run directly
curl -fsSL https://raw.githubusercontent.com/0xshariq/ruby_package_installer_cli/main/install_dependencies.sh | bash
The script automatically:
If you want to handle Node.js dependencies manually:
# Skip automatic npm install during gem installation
PACKAGE_INSTALLER_CLI_SKIP_NPM=1 gem install package-installer-cli
# Then install dependencies manually later (choose based on your installation)
# Global installation:
cd $(gem environment gemdir)/gems/package-installer-cli-*/
npm install --production
# Local/Bundler installation:
GEM_DIR=$(bundle info package-installer-cli --path)
cd "$GEM_DIR" && npm install --production
# User installation:
cd ~/.gem/ruby/*/gems/package-installer-cli-*/
npm install --production
# OR use the automated script
SCRIPT_PATH=$(dirname $(gem which package_installer_cli))/../install_dependencies.sh
bash "$SCRIPT_PATH"
# Dockerfile example
RUN gem install package-installer-cli
RUN cd $(gem environment gemdir)/gems/package-installer-cli-*/ && npm install --production --no-optional
# GitHub Actions example
- name: Install Package Installer CLI
run: |
gem install package-installer-cli
cd $(gem environment gemdir)/gems/package-installer-cli-*/
npm ci --production
# rbenv users
rbenv rehash
gem install package-installer-cli
# rvm users
rvm use ruby-3.0.0
gem install package-installer-cli
# asdf users
asdf reshim ruby
gem install package-installer-cli
# Create new project interactively
pi create
# Analyze project with enhanced dashboard
pi analyze
# Update project dependencies only
pi update
# Upgrade CLI to latest version
pi upgrade-cli
| Document | Description |
|---|---|
| 📋 Commands | Complete command reference with examples |
| ⚡ Features | Detailed feature documentation and usage |
| 🎨 Templates | Available templates and customization options |
| 🚀 Deployment | Deployment options and platform integration |
| Command | Description | Usage |
|---|---|---|
pi create | Create new project from templates | pi create [name] |
pi analyze | Enhanced project analytics dashboard | pi analyze [--detailed] |
pi update | Update project dependencies | pi update [--latest] |
pi upgrade-cli | Upgrade CLI to latest version | pi upgrade-cli |
pi add | Add features to existing projects | pi add [feature] |
pi doctor | Diagnose and fix project issues | pi doctor |
pi clean | Clean development artifacts | pi clean [--all] |
For complete command documentation, see commands
| Language/Framework | Templates | Package Managers |
|---|---|---|
| JavaScript/TypeScript | React, Next.js, Express, Angular, Vue | npm, yarn, pnpm |
| Python | Django, Flask, FastAPI | pip, poetry |
| Rust | Basic, Advanced, Web | cargo |
| Go | CLI, Web, API | go mod |
| Ruby | Rails, Sinatra | bundler |
| PHP | Laravel, Symfony | composer |
For detailed template information, see templates
# Run built-in diagnostics
pi doctor
# Check installation status
pi --version
node --version
ruby --version
# Verify gem installation
gem list package-installer-cli
gem which package_installer_cli
Solution 1: Check gem binaries
# Verify gem is installed
gem list package-installer-cli
# Check if gem bin directory is in PATH
echo $PATH | grep -o "$(gem environment | grep 'EXECUTABLE DIRECTORY' | cut -d: -f2 | tr -d ' ')"
# Add gem bin directory to PATH if missing
echo 'export PATH="$(gem environment | grep "EXECUTABLE DIRECTORY" | cut -d: -f2 | tr -d " "):$PATH"' >> ~/.bashrc
source ~/.bashrc
Solution 2: Use full path
# Find gem executable location
find $(gem environment gemdir) -name "pi" -type f
# Use full path to run
/path/to/gems/bin/pi --help
Solution: Installation-specific dependency installation
For Global Installation:
# Method 1: Using gem environment
cd $(gem environment gemdir)/gems/package-installer-cli-*/
npm install --production
# Method 2: Using gem which
GEM_DIR=$(gem which package_installer_cli | xargs dirname | xargs dirname)
cd "$GEM_DIR" && npm install --production
For Local/Bundler Installation:
# Using bundle info
GEM_DIR=$(bundle info package-installer-cli --path 2>/dev/null)
if [ -n "$GEM_DIR" ]; then
cd "$GEM_DIR" && npm install --production
else
echo "Run 'bundle install' first"
fi
For User Installation:
# Navigate to user gem directory
cd ~/.gem/ruby/*/gems/package-installer-cli-*/
npm install --production
# Or use user installation directory
USER_DIR=$(gem environment | grep "USER INSTALLATION DIRECTORY" | cut -d: -f2 | tr -d ' ')
cd "$USER_DIR"/gems/package-installer-cli-*/
npm install --production
Verification:
# Check if dependencies are installed
ls $(dirname $(gem which package_installer_cli))/../node_modules/ | head -5
Solution 1: Fix npm permissions
# Create npm directory in home folder
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Add to PATH
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Reinstall gem
gem uninstall package-installer-cli
gem install package-installer-cli
Solution 2: Use sudo (not recommended)
sudo gem install package-installer-cli
Solution: Configure timeouts and retry
# Increase npm timeout
npm config set timeout 300000
npm config set registry https://registry.npmjs.org/
# Retry installation
gem uninstall package-installer-cli
gem install package-installer-cli
# Manual fallback
cd $(dirname $(gem which package_installer_cli))/../..
npm install --production --timeout=300000
Solution: Reset and reinstall
# Complete reset
gem uninstall package-installer-cli
gem cleanup
# Clear npm cache
npm cache clean --force
# Reinstall with verbose output
gem install package-installer-cli --verbose
# Verify with diagnostics
pi doctor
If you're still having issues:
Check System Requirements:
ruby --versionnode --versionnpm --versionRun Diagnostics:
pi doctor --verbose
Manual Verification:
# Check gem files
ls -la $(dirname $(gem which package_installer_cli))
# Check Node.js dependencies
cd $(dirname $(gem which package_installer_cli))/../..
ls -la node_modules/ | head -10
Create Issue: GitHub Issues
pi doctorWe welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
💎 Note: This Ruby gem is a wrapper around the Node.js implementation. The actual CLI logic is executed via Node.js, so Node.js must be installed on your system.
Happy coding! 🚀 Create something amazing with Package Installer CLI.
FAQs
Unknown package

Product
Put vulnerability remediation on autopilot with automated security patches and intelligent dependency upgrades across your GitHub repositories.

Product
Socket Zero automates vulnerability remediation with upgrades and targeted patches, including fixes for 100% of known, patchable RubyGems CVEs.

Product
Explore Socket’s redesigned Alerts UI, multi-branch repository monitoring, and new tools for resolving findings, searching scans, and filtering security alerts.