Accessing Environments
Complete Flow: From Login to Deployment
┌─────────────────────────────────────────────────────────────────────────────┐
│ End-to-End Authentication Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ STEP 1: Authenticate to sfp-server (one-time until token expires) │
│ ───────────────────────────────────────────────────────────────── │
│ │
│ $ sfp server auth login --email [email protected] --provider github │
│ │
│ ┌────────────┐ │
│ │ Browser │ → GitHub OAuth → Authorize → Callback to CLI │
│ └────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────┐ │
│ │ Keychain │ Token stored securely (valid ~24h) │
│ └────────────┘ │
│ │
│ STEP 2: Get environment and authenticate locally │
│ ──────────────────────────────────────────────── │
│ │
│ $ sfp server environment get \ │
│ --name UAT \ │
│ --repository myorg/salesforce-app \ │
│ --auth-type accessToken \ │
│ --authenticate │
│ │
│ ┌────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Keychain │────>│ sfp-server │────>│ Salesforce │ │
│ │ (get token)│ │ API │ │ Auth │ │
│ └────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ │ │ Decrypt & │ │
│ │ │ return creds │ │
│ │<──────────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────┘ │
│ Create local SF auth (alias: "UAT") │
│ │
│ STEP 3: Use sfp commands with the authenticated org │
│ ─────────────────────────────────────────────────── │
│ │
│ $ sfp install --targetorg UAT --artifactdir ./artifacts │
│ $ sfp release --targetorg UAT --releasedefinition ./release.yaml │
│ │
│ ✅ The org "UAT" is now available for all sfp and sf commands │
│ │
└─────────────────────────────────────────────────────────────────────────────┘Quick Start Commands
Scenario 1: Local Development
One-time Setup
Installing an artifact
Switching Environments
Scenario 2: CI/CD Pipeline Deployment
Repository Secrets Setup
Basic Deployment Workflow
Production Deployment with Locking
Scenario 3: Multi-Environment Pipeline
Scenario 4: Team Access Setup
Initial Setup (Admin/Owner)
Developer Access
CI/CD Service Account
Scenario 5: Handling Sandbox Refreshes
Before Refresh
After Refresh
Scenario 6: Debugging Access Issues
Check Your Authentication
Verify Environment Details
Test Credential Access
Common Issues and Solutions
Quick Reference
Environment Access Commands
Task
Command
Common Flags
Flag
Purpose