@tywalk/pcf-helper-run
v1.2.15
Published
A simple command-line utility for building and publishing PCF controls to Dataverse.
Readme
PCF Helper Run 🎯
Unified CLI interface for all Power Platform Component Framework (PCF) operations.
This package provides a single, consolidated command-line interface that brings together all PCF Helper functionality under one roof. Perfect for developers who prefer a unified experience and simplified command structure.
📋 Table of Contents
- Installation
- Quick Start
- Command Structure
- Available Subcommands
- Usage Examples
- Workflow Examples
- Global Options
- Troubleshooting
📦 Installation
Global Installation (Recommended)
npm install -g @tywalk/pcf-helper-runLocal Installation
npm install @tywalk/pcf-helper-runVerify Installation
pcf-helper-run --version
pcf-helper-run --help🚀 Quick Start
Basic Usage Pattern
pcf-helper-run <subcommand> [options]Your First PCF Control
# 1. Initialize a new PCF project
pcf-helper-run init -n "MyFirstControl" --publisher-name "My Company"
# 2. Navigate to the created project
cd MyFirstControl
# 3. Build the control
pcf-helper-run build -p .
# 4. Import to your solution
pcf-helper-run import -p .🏗️ Command Structure
PCF Helper Run uses a subcommand structure for organized functionality:
pcf-helper-run <subcommand> [options]Each subcommand corresponds to a specific PCF operation, with consistent option patterns across all commands.
🛠️ Available Subcommands
| Subcommand | Description | Equivalent Individual Command |
|------------|-------------|-------------------------------|
| init | Initialize new PCF project | pcf-helper-init |
| build | Build and compile controls | pcf-helper-build |
| import | Import controls to solution | pcf-helper-import |
| deploy | Deploy to environment (upgrade + build + import) | pcf-helper-deploy |
| upgrade | Upgrade project dependencies | pcf-helper-upgrade |
| session | Manage development sessions | pcf-helper-session |
📖 Detailed Command Reference
🏗️ init - Initialize New Project
Create a new PCF project with proper scaffolding.
pcf-helper-run init -n <control-name> [options]Required Parameters
-n, --name <name>- Name of the PCF control
Optional Parameters
--publisher-name <name>- Publisher name--publisher-prefix <prefix>- Publisher prefix-p, --path <path>- Creation path (default: current directory)--run-npm-install- Run npm install after creation (default: true)
Examples
# Simple initialization
pcf-helper-run init -n "CustomerLookup"
# Full configuration
pcf-helper-run init -n "CustomerLookup" \
--publisher-name "Contoso Corporation" \
--publisher-prefix "con" \
-p ./my-controls \
--verbose
# Skip npm install for faster scaffolding
pcf-helper-run init -n "QuickControl" --run-npm-install false⚡ build - Build Controls
Compile and build your PCF controls for deployment.
pcf-helper-run build -p <solution-path> [options]Required Parameters
-p, --path <path>- Path to the solution folder
Optional Parameters
-e, --environment <environment>- Target environment configuration--env <environment>- (Deprecated: use--environment) Target environment-t, --timeout <milliseconds>- Build timeout (default: 300000)
Examples
# Basic build
pcf-helper-run build -p ./MySolution
# Build with environment and extended timeout
pcf-helper-run build -p ./MySolution --environment Production --timeout 120000
# Verbose build for debugging
pcf-helper-run build -p ./MySolution --verbose📦 import - Import to Solution
Import your built PCF controls into a Dataverse solution.
pcf-helper-run import -p <solution-path> [options]Required Parameters
-p, --path <path>- Path to the solution folder
Optional Parameters
-e, --environment <environment>- Target environment--env <environment>- (Deprecated: use--environment) Target environment-t, --timeout <milliseconds>- Import timeout
Examples
# Import to default environment
pcf-helper-run import -p .
# Import to specific environment
pcf-helper-run import -p . --environment "Test Environment"
# Extended timeout for large solutions
pcf-helper-run import -p . --timeout 180000🚀 deploy - Deploy to Environment
Deploy your PCF controls to the target Dataverse environment. This command runs upgrade, build, and import in sequence.
pcf-helper-run deploy -p <solution-path> [options]Required Parameters
-p, --path <path>- Path to the solution folder
Optional Parameters
-e, --environment <environment>- Target environment for deployment--env <environment>- (Deprecated: use--environment) Target environment-t, --timeout <milliseconds>- Deployment timeout
Examples
# Deploy to default environment
pcf-helper-run deploy -p .
# Deploy to production with extended timeout
pcf-helper-run deploy -p . --environment "Production" --timeout 300000🔄 upgrade - Upgrade Project
Upgrade your PCF project dependencies and framework versions.
pcf-helper-run upgrade -p <solution-path> [options]Required Parameters
-p, --path <path>- Path to the solution folder
Examples
# Upgrade project dependencies
pcf-helper-run upgrade -p .
# Upgrade with verbose output
pcf-helper-run upgrade -p . --verbose🎯 session - Manage Development Sessions
Manage development sessions with live reloading capabilities.
pcf-helper-run session [options]Optional Parameters
-u, --url <url>- Remote environment URL-s, --script <path>- Remote script to intercept-t, --stylesheet <path>- Remote stylesheet to intercept-b, --bundle <path>- Local bundle path-c, --css <path>- Local CSS path-f, --config <path>- Config file path (default:session.config.json)
Examples
# Start session with default config
pcf-helper-run session
# Session with custom configuration
pcf-helper-run session -u "https://contoso.crm.dynamics.com" -s ./bundle.js⚙️ Global Options
These options are available for all subcommands:
| Option | Description | Default |
|--------|-------------|---------|
| -v, --verbose | Enable detailed logging | false |
| --version | Display version information | - |
| -h, --help | Show help for command | - |
| -t, --timeout <ms> | Operation timeout in milliseconds | 300000 |
Global Usage Examples
# Enable verbose logging for any command
pcf-helper-run build -p . --verbose
# Set custom timeout
pcf-helper-run import -p . --timeout 120000
# Get help for specific subcommand
pcf-helper-run build --help💼 Workflow Examples
Complete Development Workflow
#!/bin/bash
# Complete PCF development and deployment script
set -e # Exit on any error
echo "🏗️ Initializing PCF project..."
pcf-helper-run init -n "SalesCalculator" \
--publisher-name "Contoso Sales" \
--publisher-prefix "cs" \
-p ./sales-calculator
echo "📂 Navigating to project directory..."
cd ./sales-calculator
echo "⚡ Building the control..."
pcf-helper-run build -p . --verbose
echo "📦 Importing to solution..."
pcf-helper-run import -p . --timeout 120000
echo "🚀 Deploying to test environment..."
pcf-helper-run deploy -p . --environment "Test"
echo "✅ Deployment complete!"Development with Multiple Environments
# Build and test locally
pcf-helper-run build -p .
# Deploy to development environment
pcf-helper-run deploy -p . --environment "Development"
# After testing, deploy to staging
pcf-helper-run deploy -p . --environment "Staging"
# Finally, deploy to production
pcf-helper-run deploy -p . --environment "Production"🐛 Troubleshooting
Common Issues and Solutions
Command Not Found
# Verify installation
npm list -g @tywalk/pcf-helper-run
# Reinstall if necessary
npm uninstall -g @tywalk/pcf-helper-run
npm install -g @tywalk/pcf-helper-runBuild Failures
# Enable verbose mode for detailed error info
pcf-helper-run build -p . --verbose
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Verify prerequisites
pac --version
dotnet --versionTimeout Errors
# Increase timeout for large projects
pcf-helper-run build -p . --timeout 120000 # 2 minutesDeprecated Flag Warnings
# Replace deprecated --env with --environment
pcf-helper-run deploy -p . --environment "Production"Debug Information
# Show detailed version and environment information
pcf-helper-run --version --verbose
# Get help for specific command
pcf-helper-run deploy --help📚 Additional Resources
Documentation Links
- Power Platform Component Framework Documentation
- Power Platform CLI Documentation
- PCF Community Gallery
🔗 Related Packages
- @tywalk/pcf-helper - Individual CLI commands and core library
- @tywalk/color-logger - Enhanced logging utilities
🏠 ← Back to Main Package
For questions, feature requests, or bug reports, please visit our GitHub Issues page.
Happy PCF development! 🎉
