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!
- Ruby >= 2.6.0
- Node.js >= 18.0.0 (required for the underlying CLI)
- 🎨 Multiple Frameworks: React, Next.js, Express, Angular, Vue, Rust
- 🔤 Language Support: TypeScript & JavaScript variants
- 🎭 UI Libraries: Tailwind CSS, Material-UI, shadcn/ui
- 📦 Smart Package Management: Auto-detects npm, yarn, pnpm
- ⚡ Lightning Fast: Optimized template generation with intelligent caching
- 🌈 Beautiful CLI: Gorgeous terminal interface with real-time analytics
- 🔍 Project Analysis: Advanced dependency analysis and project insights
- 📊 Enhanced Analytics Dashboard: Real-time usage analytics with detailed insights
- 🎯 Smart Dependency Updates: Project-specific dependency management for JS, Python, Rust, Go, Ruby, PHP
- 🚀 Intelligent CLI Upgrades: Separate upgrade system with breaking change detection
- 💾 .package-installer-cli Folder: All cache and history stored in dedicated folder
- 📈 Usage Tracking: Comprehensive command and feature usage tracking
- ⚡ Performance Insights: Productivity scoring and usage patterns
The gem automatically installs Node.js dependencies during installation:
gem install package-installer-cliWhat happens during installation:
- 💎 Ruby gem is installed via RubyGems
- 🔍 System checks for Node.js availability
- 📦 Automatically runs
npm install(orpnpm/yarnif available) - ✅ CLI is ready to use immediately
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 --versionIf automatic dependency installation fails, follow these steps based on your installation type:
Step 1: Install the Ruby Gem Globally
gem install package-installer-cliStep 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 --productionStep 1: Add to Gemfile
# Gemfile
gem 'package-installer-cli'Step 2: Install with Bundle
bundle installStep 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 --productionStep 4: Use with Bundle Exec
bundle exec pi create
bundle exec pi --versionStep 1: Install to User Directory
gem install --user-install package-installer-cliStep 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 -5Add 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=300000For 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/package_installer_cli/wrappers/ruby/main/install_dependencies.sh | bashThe script automatically:
- 🔍 Detects your installation type (global/local/user/bundler)
- 📋 Checks Node.js and npm availability
- 📦 Chooses the right package manager (npm/yarn/pnpm)
- ✅ Installs dependencies in the correct location
- 🧪 Verifies the installation
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
- Ruby: >= 2.6.0 (for the gem wrapper)
- Node.js: >= 18.0.0 (required for the underlying CLI)
- Operating Systems: Windows, macOS, Linux
- Package Managers: npm, yarn, or pnpm (for Node.js projects)
- Git: Required for project initialization
# 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_cliSolution 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 ~/.bashrcSolution 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 --helpSolution: 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 --productionFor 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"
fiFor 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 --productionVerification:
# Check if dependencies are installed
ls $(dirname $(gem which package_installer_cli))/../node_modules/ | head -5Solution 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-cliSolution 2: Use sudo (not recommended)
sudo gem install package-installer-cliSolution: 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=300000Solution: 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 doctorIf you're still having issues:
-
Check System Requirements:
- Ruby >= 2.6.0:
ruby --version - Node.js >= 18.0.0:
node --version - npm/yarn/pnpm:
npm --version
- Ruby >= 2.6.0:
-
Run 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
- Include output of
pi doctor - Include your OS, Ruby, and Node.js versions
- Include full error messages
- Include output of
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Ruby Gem: package-installer-cli
- GitHub Repository: ruby_package_installer_cli
- Issues & Feedback: GitHub Issues
💎 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.