### Start Tenant Services Source: https://github.com/flxbl-io/docs-sfp/blob/main/cli-reference/server/start.md This section covers the basic usage of the `sfp server start` command to initiate services for a specified tenant. It highlights the required `--tenant` flag and provides examples for common scenarios. ```APIDOC ## `sfp server start` ### Description Start or restart the services for a specified tenant. ### Method CLI Command ### Parameters #### Required Flags - **-t, --tenant** (string) - Required - Name of the tenant to start #### Optional Flags - **-j, --[no-]json** (boolean) - Output in JSON format - **--daemon** (boolean) - Run server in daemon mode (detached) - **--no-browser** (boolean) - Disable automatic browser opening - **--base-dir** (string) - [default: ./sfp-server] Base Directory which contains the sfp-server - **--restart** (boolean) - Restart server if already running - **--config-file** (string) - Path to JSON config file containing server configuration values ### SSH OPTIONS #### Optional Flags - **--ssh-connection** (string) - SSH connection string in the format user@host[:port] - **--identity-file** (string) - Path to SSH private key file - **--passphrase** (string) - Passphrase for the SSH private key if required ### SECRETS MANAGEMENT #### Optional Flags - **--secrets-provider** (string) - [default: custom] Secret provider to use for managing secrets (options: infisical|aws-secretsmanager|custom) - **--infisical-token** (string) - Infisical API token (required when secrets-provider is "infisical") - **--aws-region** (string) - AWS region for Secrets Manager (required when secrets-provider is "aws-secretsmanager") - **--aws-access-key-id** (string) - AWS access key ID (optional, can use instance profile) - **--aws-secret-access-key** (string) - AWS secret access key (optional, can use instance profile) ### OTHER OPTIONS #### Optional Flags - **-g, --logsgroupsymbol** (string array) - Symbol used by CICD platform to group/collapse logs - **--loglevel** (string) - [default: info] logging level for this command invocation (options: trace|debug|info|warn|error|fatal) ### Request Example ```bash sfp server start --tenant my-app ``` ### Modes of Operation #### Daemon Mode Run the server in the background (detached): ```bash sfp server start --tenant my-app --daemon ``` #### Interactive Mode Run the server in the foreground (default): ```bash sfp server start --tenant my-app ``` ### Secrets Management #### Custom Provider (Default) Use environment variables injected by external tools: ```bash # Using Infisical CLI infisical run -- sfp server start --tenant my-app --secrets-provider custom # Using AWS CLI with SSM Parameter Store aws ssm get-parameters-by-path --path /sfp/my-app --recursive | \ jq -r ".Parameters[] | \"export \( .Name | split(\" / \") | last )=\( .Value )\"" | \ source /dev/stdin && \ sfp server start --tenant my-app --secrets-provider custom ``` #### Infisical Provider Direct integration with Infisical: ```bash sfp server start --tenant my-app \ --secrets-provider infisical \ --infisical-token your-token ``` #### AWS Secrets Manager Direct integration with AWS Secrets Manager: ```bash sfp server start --tenant my-app \ --secrets-provider aws-secretsmanager \ --aws-region us-east-1 ``` ### Remote Server Management Start a tenant on a remote server via SSH: ```bash sfp server start --tenant my-app \ --ssh-connection admin@production.example.com:2222 \ --identity-file ~/.ssh/production_key ``` > **Note**: When using `--restart`, the server will be stopped and started again if it's already running. > **Tip**: Use `--daemon` mode for production deployments to run the server in the background. ``` -------------------------------- ### Register Salesforce Orgs and Create Environments Source: https://github.com/flxbl-io/docs-sfp/blob/main/environment-management/environments/README.md This outlines the complete flow for environment setup, starting with registering Salesforce orgs (production, DevHub, sandboxes) and then creating environments linked to repository branches. ```bash ┌─────────────────────────────────────────────────────────────────────────────┐ │ Environment Setup Flow │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ STEP 1: Register Salesforce Orgs │ │ ──────────────────────────────── │ │ │ │ # Production org (requires local auth first) │ │ $ sf org login web --alias production │ │ $ sfp server org register --targetusername production │ │ │ │ # DevHub (if using scratch orgs) │ │ $ sf org login web --alias devhub │ │ $ sfp server org register --targetusername devhub --devhub --default │ │ │ │ # Sandboxes (option A: JIT - recommended) │ │ $ sfp server org register-sandbox \ │ --sandboxname uat \ │ --productionusername admin@production.com │ │ │ │ # Sandboxes (option B: direct registration) │ │ $ sf org login web --alias uat --instance-url https://test.salesforce.com │ │ $ sfp server org register --targetusername uat │ │ │ │ STEP 2: Create Environments │ │ ─────────────────────────── │ │ │ │ $ sfp server environment create \ │ --repository myorg/salesforce-app \ │ --name UAT \ │ --category test \ │ --branch release/* \ │ --targetusername admin@production--uat.sandbox.com │ │ │ │ STEP 3: Access Environments │ │ ─────────────────────────── │ │ │ │ $ sfp server environment get \ │ --name UAT \ │ --repository myorg/salesforce-app \ │ --auth-type accessToken \ │ --authenticate │ │ │ │ ✅ Ready to use: sfp install --targetorg UAT --artifactdir ./artifacts │ │ │ └─────────────────────────────────────────────────────────────────────────────┘ ``` -------------------------------- ### Example: Basic Server Initialization Source: https://github.com/flxbl-io/docs-sfp/blob/main/cli-reference/server/init.md A basic example of initializing an SFP server instance for a tenant named 'my-app'. ```bash sfp server init --tenant my-app ``` -------------------------------- ### Example Pre-Validation Script Source: https://github.com/flxbl-io/docs-sfp/blob/main/validating-a-change/validation-scripts.md This bash script demonstrates parsing context, performing setup based on validation mode, and notifying an external system. ```bash #!/bin/bash set -e CONTEXT_FILE="$1" TARGET_ORG="$2" HUB_ORG="$3" echo "🔧 Pre-validation setup starting..." # Parse context PACKAGES=$(cat "$CONTEXT_FILE" | jq -r '.packages[].name' | tr '\n' ' ') VALIDATION_MODE=$(cat "$CONTEXT_FILE" | jq -r '.validationMode') echo "📦 Packages to validate: $PACKAGES" echo "🎯 Validation mode: $VALIDATION_MODE" echo "🏢 Target org: $TARGET_ORG" # Custom setup logic if [ "$VALIDATION_MODE" = "thorough" ]; then echo "🔧 Setting up comprehensive validation environment..." # Setup test data, configure external systems, etc. fi # Example: Notify external systems curl -X POST "https://internal-api.company.com/validation/started" \ -H "Content-Type: application/json" \ -d "{\"packages\": \"$PACKAGES\", \"targetOrg\": \"$TARGET_ORG\"}" echo "✅ Pre-validation setup completed" ``` -------------------------------- ### Example: Update tenant 'my-tenant' Source: https://github.com/flxbl-io/docs-sfp/blob/main/cli-reference/server/update.md A basic example of updating services for a tenant named 'my-tenant'. ```bash sfp server update --tenant my-tenant ``` -------------------------------- ### Example: Update tenant 'my-tenant' and restart services Source: https://github.com/flxbl-io/docs-sfp/blob/main/cli-reference/server/update.md An example of updating services for 'my-tenant' and automatically restarting them afterward. ```bash sfp server update --tenant my-tenant --restart ``` -------------------------------- ### Start Tenant Services Source: https://github.com/flxbl-io/docs-sfp/blob/main/cli-reference/server/start.md Starts the services for a specified tenant. This is the default interactive mode. ```bash sfp server start --tenant my-app ``` -------------------------------- ### Install sfp-pro on macOS Source: https://github.com/flxbl-io/docs-sfp/blob/main/getting-started/install-sfp/install-sfp-pro.md Install sfp-pro by first mounting the DMG, dragging the app to Applications, and then running the installer script. Alternatively, run the script from the installed application if the DMG is unmounted. ```bash sudo bash /Volumes/sfp-pro-*/install-cli.sh ``` ```bash sudo /Applications/sfp-pro.app/Contents/Resources/install-cli.sh ``` -------------------------------- ### Install Artifacts Locally Source: https://github.com/flxbl-io/docs-sfp/blob/main/releasing-artifacts/overview.md Use the `sfp install` command for local development and testing. It installs artifacts directly from a local directory to a specified target org. ```bash sfp install --artifacts ./artifacts --targetusername myorg ``` -------------------------------- ### Install Changes to Review Environment Source: https://github.com/flxbl-io/docs-sfp/blob/main/development/development-workflow.md Install the built artifacts into the fetched review environment for testing. ```bash # Install the changes sfp install --target-org pr-123-review \ --artifacts artifacts ``` -------------------------------- ### Example Monitor Sandbox Pools Command Source: https://github.com/flxbl-io/docs-sfp/blob/main/environment-management/pools/sandbox-pools/monitor-sandbox-pools.md An example demonstrating how to use the monitor command with specific Dev Hub, repository, and configuration files. ```bash sfp pool sandbox monitor -v my-devhub -r myorg/myrepo -f config/pool-config-1.json config/pool-config-2.json ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/flxbl-io/docs-sfp/blob/main/cli-reference/utilities/dependency.md This command installs all external dependencies for a given project. It requires the target org username and Dev Hub username. Optionally, installation keys can be provided for key-protected packages using the `-k` flag. ```bash USAGE $ @flxbl-io/sfp dependency install -o -v [-k ] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] FLAGS -k, --installationkeys= Installation key for key-protected packages (format is packagename:key --> core:key nCino:key vlocity:key to allow some packages without installation key) -o, --targetusername= (required) Username or alias of the target org. -v, --targetdevhubusername= (required) Username or alias of the Dev Hub org. --loglevel=