Implement innovative two-character option scheme
- Replace single-character options with memorable two-character alternatives - Based on syllable mapping: -to (target-org), -qy (query), -fm (format), etc. - Updated all bash and PowerShell scripts with consistent options - Added comprehensive documentation and examples to README.md - Maintains backward compatibility with long options - More intuitive and self-documenting than traditional CLI options
This commit is contained in:
50
README.md
50
README.md
@@ -28,6 +28,46 @@ Data and logs:
|
||||
- **[`sf-data-import` / `sf-data-import.ps1`](#sf-data-import--sf-data-importps1)** - Import CSV/JSON with insert/update/upsert
|
||||
- **[`sf-logs-tail` / `sf-logs-tail.ps1`](#sf-logs-tail--sf-logs-tailps1)** - Real-time debug logs tail with filtering
|
||||
|
||||
## Two-Character Option Scheme
|
||||
|
||||
All scripts use an innovative **two-character option scheme** based on syllables, making options more memorable and self-documenting than traditional single-character flags:
|
||||
|
||||
### Core Options (consistent across scripts)
|
||||
- `-to, --target-org` - **T**arget **O**rg
|
||||
- `-hp, --help` - **H**el**P**
|
||||
- `-vb, --verbose` - **V**er**B**ose
|
||||
|
||||
### File & I/O Options
|
||||
- `-fl, --file` - **F**i**L**e
|
||||
- `-ot, --output` - **O**u**T**put
|
||||
- `-fm, --format` - **F**or**M**at
|
||||
|
||||
### Data & Query Options
|
||||
- `-qy, --query` - **Q**uer**Y**
|
||||
- `-so, --sobject` - **S**-**O**bject
|
||||
- `-bk, --bulk` - **B**ul**K**
|
||||
|
||||
### Operation & Control Options
|
||||
- `-op, --operation` - **Op**eration
|
||||
- `-wt, --wait` - **W**ai**T**
|
||||
- `-lv, --level` - **L**e**V**el
|
||||
|
||||
### Benefits
|
||||
- **More Memorable**: `-to` for target-org is intuitive vs cryptic `-o`
|
||||
- **Self-Documenting**: Users can often guess what `-fm` means (format)
|
||||
- **No Conflicts**: Two characters eliminates option conflicts between scripts
|
||||
- **Consistent**: Same long option always maps to same short option across all scripts
|
||||
- **Scalable**: Room for many more options without running out of meaningful combinations
|
||||
|
||||
### Example Usage
|
||||
```bash
|
||||
# Traditional approach would be:
|
||||
# sf-data-export -q "SELECT Id FROM Account" -o myorg -f csv
|
||||
|
||||
# Our approach:
|
||||
sf-data-export -qy "SELECT Id FROM Account" -to myorg -fm csv
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
### Unix/Linux/macOS (Bash)
|
||||
@@ -161,10 +201,10 @@ Export data via SOQL to CSV/JSON with optional Bulk API.
|
||||
|
||||
Usage:
|
||||
```bash
|
||||
sf-data-export --query "SELECT Id, Name FROM Account" | --file query.soql | --sobject Account [--format csv|json] [--bulk] [--output out.csv]
|
||||
sf-data-export -qy "SELECT Id, Name FROM Account" | -fl query.soql | -so Account [-to ORG] [-fm csv|json] [-bk] [-ot out.csv]
|
||||
```
|
||||
```powershell
|
||||
sf-data-export.ps1 -Query "SELECT Id FROM User" -Format json -Output users.json
|
||||
sf-data-export.ps1 -qy "SELECT Id FROM User" -fm json -ot users.json
|
||||
```
|
||||
|
||||
### sf-data-import / sf-data-import.ps1
|
||||
@@ -173,10 +213,10 @@ Import CSV/JSON with insert/update/upsert operations.
|
||||
|
||||
Usage:
|
||||
```bash
|
||||
sf-data-import --file data.csv --sobject Account --operation insert|update|upsert [--external-id Field] [--bulk]
|
||||
sf-data-import -fl data.csv -so Account [-to ORG] [-op insert|update|upsert] [-ei Field] [-bk]
|
||||
```
|
||||
```powershell
|
||||
sf-data-import.ps1 -File data.json -SObject Contact -Operation upsert -ExternalId Email
|
||||
sf-data-import.ps1 -fl data.json -so Contact -op upsert -ei Email
|
||||
```
|
||||
|
||||
### sf-logs-tail / sf-logs-tail.ps1
|
||||
@@ -185,7 +225,7 @@ Real-time debug logs tail with filtering, levels, and Apex-only mode.
|
||||
|
||||
Usage:
|
||||
```bash
|
||||
sf-logs-tail [--target-org ORG] [--user-id USER] [--level DEBUG] [--duration 60] [--filter PATTERN] [--apex-only]
|
||||
sf-logs-tail [-o ORG] [--user-id USER] [--level DEBUG] [--duration 60] [--filter PATTERN] [--apex-only]
|
||||
```
|
||||
```powershell
|
||||
sf-logs-tail.ps1 -TargetOrg sandbox -Level DEBUG -Duration 60 -ApexOnly -Filter "MyClass"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
.PARAMETER Code
|
||||
Inline Apex code to execute (alternative to -File)
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
.PARAMETER o
|
||||
Target org username or alias (uses default if not specified)
|
||||
|
||||
.PARAMETER Verbose
|
||||
@@ -27,7 +27,7 @@
|
||||
.EXAMPLE
|
||||
.\sf-apex-run.ps1 -File "scripts/setup.apex"
|
||||
.\sf-apex-run.ps1 -Code "System.debug('Hello World');"
|
||||
.\sf-apex-run.ps1 -File "test.apex" -TargetOrg "sandbox"
|
||||
.\sf-apex-run.ps1 -File "test.apex" -o "sandbox"
|
||||
.\sf-apex-run.ps1 -Code "Database.insert(new Account(Name='Test'));" -Verbose
|
||||
|
||||
.NOTES
|
||||
@@ -42,7 +42,7 @@ param(
|
||||
[Parameter(ParameterSetName="Code")]
|
||||
[string]$Code,
|
||||
|
||||
[string]$TargetOrg,
|
||||
[string]$o,
|
||||
[switch]$Verbose,
|
||||
[switch]$Help
|
||||
)
|
||||
@@ -158,10 +158,10 @@ if ($File) {
|
||||
$sfArgs = @("apex", "run")
|
||||
|
||||
# Add target org if specified
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$sfArgs += "--target-org"
|
||||
$sfArgs += $TargetOrg
|
||||
Write-Host "Target org: $TargetOrg" -ForegroundColor Cyan
|
||||
$sfArgs += $o
|
||||
Write-Host "Target org: $o" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Add verbose flag if requested
|
||||
|
||||
@@ -20,22 +20,22 @@ show_usage() {
|
||||
echo " sf-data-export [OPTIONS]"
|
||||
echo ""
|
||||
echo "OPTIONS:"
|
||||
echo " -q, --query QUERY SOQL query to export data"
|
||||
echo " -f, --file FILE File containing SOQL query"
|
||||
echo " -s, --sobject SOBJECT Standard object query (exports all records)"
|
||||
echo " -o, --output FILE Output file path (default: export.csv)"
|
||||
echo " -t, --target-org ORG Target org username or alias"
|
||||
echo " --format FORMAT Output format: csv, json (default: csv)"
|
||||
echo " --bulk Use bulk API for large datasets"
|
||||
echo " --wait MINUTES Wait time in minutes (default: 10)"
|
||||
echo " -v, --verbose Enable verbose output"
|
||||
echo " -h, --help Show this help message"
|
||||
echo " -qy, --query QUERY SOQL query to export data"
|
||||
echo " -fl, --file FILE File containing SOQL query"
|
||||
echo " -so, --sobject SOBJECT Standard object query (exports all records)"
|
||||
echo " -to, --target-org ORG Target org username or alias"
|
||||
echo " -ot, --output FILE Output file path (default: export.csv)"
|
||||
echo " -fm, --format FORMAT Output format: csv, json (default: csv)"
|
||||
echo " -bk, --bulk Use bulk API for large datasets"
|
||||
echo " -wt, --wait MINUTES Wait time in minutes (default: 10)"
|
||||
echo " -vb, --verbose Enable verbose output"
|
||||
echo " -hp, --help Show this help message"
|
||||
echo ""
|
||||
echo "EXAMPLES:"
|
||||
echo " sf-data-export --query \"SELECT Id, Name FROM Account LIMIT 100\""
|
||||
echo " sf-data-export --sobject Account --format json --output accounts.json"
|
||||
echo " sf-data-export --file queries/contacts.soql --bulk --wait 15"
|
||||
echo " sf-data-export --query \"SELECT Id FROM User\" --target-org production"
|
||||
echo " sf-data-export -qy \"SELECT Id, Name FROM Account LIMIT 100\""
|
||||
echo " sf-data-export -so Account -fm json -ot accounts.json"
|
||||
echo " sf-data-export -fl queries/contacts.soql -bk -wt 15"
|
||||
echo " sf-data-export -qy \"SELECT Id FROM User\" -to production"
|
||||
echo ""
|
||||
echo "This script automatically checks for Salesforce CLI installation."
|
||||
}
|
||||
@@ -123,43 +123,43 @@ VERBOSE=false
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-q|--query)
|
||||
-qy|--query)
|
||||
QUERY="$2"
|
||||
shift 2
|
||||
;;
|
||||
-f|--file)
|
||||
-fl|--file)
|
||||
QUERY_FILE="$2"
|
||||
shift 2
|
||||
;;
|
||||
-s|--sobject)
|
||||
-so|--sobject)
|
||||
SOBJECT="$2"
|
||||
shift 2
|
||||
;;
|
||||
-o|--output)
|
||||
OUTPUT_FILE="$2"
|
||||
shift 2
|
||||
;;
|
||||
-t|--target-org)
|
||||
-to|--target-org)
|
||||
TARGET_ORG="$2"
|
||||
shift 2
|
||||
;;
|
||||
--format)
|
||||
-ot|--output)
|
||||
OUTPUT_FILE="$2"
|
||||
shift 2
|
||||
;;
|
||||
-fm|--format)
|
||||
FORMAT="$2"
|
||||
shift 2
|
||||
;;
|
||||
--bulk)
|
||||
-bk|--bulk)
|
||||
USE_BULK=true
|
||||
shift
|
||||
;;
|
||||
--wait)
|
||||
-wt|--wait)
|
||||
WAIT_TIME="$2"
|
||||
shift 2
|
||||
;;
|
||||
-v|--verbose)
|
||||
-vb|--verbose)
|
||||
VERBOSE=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
-hp|--help)
|
||||
show_usage
|
||||
exit 0
|
||||
;;
|
||||
|
||||
@@ -9,40 +9,40 @@
|
||||
from Salesforce orgs with SOQL query support, multiple formats, and intelligent defaults.
|
||||
|
||||
.PARAMETER Query
|
||||
SOQL query to export data
|
||||
SOQL query to export data (alias: -qy)
|
||||
|
||||
.PARAMETER File
|
||||
File containing SOQL query
|
||||
File containing SOQL query (alias: -fl)
|
||||
|
||||
.PARAMETER SObject
|
||||
Standard object query (exports common fields)
|
||||
Standard object query (exports common fields) (alias: -so)
|
||||
|
||||
.PARAMETER Output
|
||||
Output file path (default: export.csv)
|
||||
Output file path (default: export.csv) (alias: -ot)
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
Target org username or alias
|
||||
Target org username or alias (alias: -to)
|
||||
|
||||
.PARAMETER Format
|
||||
Output format: csv, json (default: csv)
|
||||
Output format: csv, json (default: csv) (alias: -fm)
|
||||
|
||||
.PARAMETER Bulk
|
||||
Use bulk API for large datasets
|
||||
Use bulk API for large datasets (alias: -bk)
|
||||
|
||||
.PARAMETER Wait
|
||||
Wait time in minutes (default: 10)
|
||||
Wait time in minutes (default: 10) (alias: -wt)
|
||||
|
||||
.PARAMETER Verbose
|
||||
Enable verbose output
|
||||
Enable verbose output (alias: -vb)
|
||||
|
||||
.PARAMETER Help
|
||||
Show this help message
|
||||
Show this help message (alias: -hp)
|
||||
|
||||
.EXAMPLE
|
||||
.\sf-data-export.ps1 -Query "SELECT Id, Name FROM Account LIMIT 100"
|
||||
.\sf-data-export.ps1 -SObject Account -Format json -Output accounts.json
|
||||
.\sf-data-export.ps1 -File queries/contacts.soql -Bulk -Wait 15
|
||||
.\sf-data-export.ps1 -Query "SELECT Id FROM User" -TargetOrg production
|
||||
.\sf-data-export.ps1 -qy "SELECT Id, Name FROM Account LIMIT 100"
|
||||
.\sf-data-export.ps1 -so Account -fm json -ot accounts.json
|
||||
.\sf-data-export.ps1 -fl queries/contacts.soql -bk -wt 15
|
||||
.\sf-data-export.ps1 -qy "SELECT Id FROM User" -to production
|
||||
|
||||
.NOTES
|
||||
This script automatically checks for Salesforce CLI installation and runs
|
||||
@@ -51,21 +51,37 @@
|
||||
|
||||
param(
|
||||
[Parameter(ParameterSetName="Query")]
|
||||
[Alias("qy")]
|
||||
[string]$Query,
|
||||
|
||||
[Parameter(ParameterSetName="File")]
|
||||
[Alias("fl")]
|
||||
[string]$File,
|
||||
|
||||
[Parameter(ParameterSetName="SObject")]
|
||||
[Alias("so")]
|
||||
[string]$SObject,
|
||||
|
||||
[Alias("ot")]
|
||||
[string]$Output = "export.csv",
|
||||
|
||||
[Alias("to")]
|
||||
[string]$TargetOrg,
|
||||
|
||||
[ValidateSet("csv", "json")]
|
||||
[Alias("fm")]
|
||||
[string]$Format = "csv",
|
||||
|
||||
[Alias("bk")]
|
||||
[switch]$Bulk,
|
||||
|
||||
[Alias("wt")]
|
||||
[int]$Wait = 10,
|
||||
|
||||
[Alias("vb")]
|
||||
[switch]$Verbose,
|
||||
|
||||
[Alias("hp")]
|
||||
[switch]$Help
|
||||
)
|
||||
|
||||
|
||||
@@ -20,23 +20,23 @@ show_usage() {
|
||||
echo " sf-data-import [OPTIONS]"
|
||||
echo ""
|
||||
echo "OPTIONS:"
|
||||
echo " -f, --file FILE CSV or JSON file to import"
|
||||
echo " -s, --sobject SOBJECT Target sObject type"
|
||||
echo " -o, --operation OP Operation: insert, update, upsert (default: insert)"
|
||||
echo " -e, --external-id FIELD External ID field for upsert/update operations"
|
||||
echo " -t, --target-org ORG Target org username or alias"
|
||||
echo " --bulk Use bulk API for large datasets"
|
||||
echo " --wait MINUTES Wait time in minutes (default: 10)"
|
||||
echo " --batch-size SIZE Batch size for bulk operations (default: 10000)"
|
||||
echo " --ignore-errors Continue on errors (don't fail entire job)"
|
||||
echo " -v, --verbose Enable verbose output"
|
||||
echo " -h, --help Show this help message"
|
||||
echo " -fl, --file FILE CSV or JSON file to import"
|
||||
echo " -so, --sobject SOBJECT Target sObject type"
|
||||
echo " -to, --target-org ORG Target org username or alias"
|
||||
echo " -op, --operation OP Operation: insert, update, upsert (default: insert)"
|
||||
echo " -ei, --external-id FIELD External ID field for upsert/update operations"
|
||||
echo " -bk, --bulk Use bulk API for large datasets"
|
||||
echo " -wt, --wait MINUTES Wait time in minutes (default: 10)"
|
||||
echo " -bs, --batch-size SIZE Batch size for bulk operations (default: 10000)"
|
||||
echo " -ie, --ignore-errors Continue on errors (don't fail entire job)"
|
||||
echo " -vb, --verbose Enable verbose output"
|
||||
echo " -hp, --help Show this help message"
|
||||
echo ""
|
||||
echo "EXAMPLES:"
|
||||
echo " sf-data-import --file accounts.csv --sobject Account"
|
||||
echo " sf-data-import --file contacts.json --sobject Contact --operation upsert --external-id Email"
|
||||
echo " sf-data-import --file leads.csv --sobject Lead --bulk --batch-size 5000"
|
||||
echo " sf-data-import --file updates.csv --sobject Account --operation update --external-id AccountNumber"
|
||||
echo " sf-data-import -fl accounts.csv -so Account"
|
||||
echo " sf-data-import -fl contacts.json -so Contact -op upsert -ei Email"
|
||||
echo " sf-data-import -fl leads.csv -so Lead -bk -bs 5000"
|
||||
echo " sf-data-import -fl updates.csv -so Account -op update -ei AccountNumber"
|
||||
echo ""
|
||||
echo "SUPPORTED FORMATS:"
|
||||
echo " • CSV files with header row"
|
||||
@@ -171,47 +171,47 @@ VERBOSE=false
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-f|--file)
|
||||
-fl|--file)
|
||||
FILE="$2"
|
||||
shift 2
|
||||
;;
|
||||
-s|--sobject)
|
||||
-so|--sobject)
|
||||
SOBJECT="$2"
|
||||
shift 2
|
||||
;;
|
||||
-o|--operation)
|
||||
OPERATION="$2"
|
||||
shift 2
|
||||
;;
|
||||
-e|--external-id)
|
||||
EXTERNAL_ID="$2"
|
||||
shift 2
|
||||
;;
|
||||
-t|--target-org)
|
||||
-to|--target-org)
|
||||
TARGET_ORG="$2"
|
||||
shift 2
|
||||
;;
|
||||
--bulk)
|
||||
-op|--operation)
|
||||
OPERATION="$2"
|
||||
shift 2
|
||||
;;
|
||||
-ei|--external-id)
|
||||
EXTERNAL_ID="$2"
|
||||
shift 2
|
||||
;;
|
||||
-bk|--bulk)
|
||||
USE_BULK=true
|
||||
shift
|
||||
;;
|
||||
--wait)
|
||||
-wt|--wait)
|
||||
WAIT_TIME="$2"
|
||||
shift 2
|
||||
;;
|
||||
--batch-size)
|
||||
-bs|--batch-size)
|
||||
BATCH_SIZE="$2"
|
||||
shift 2
|
||||
;;
|
||||
--ignore-errors)
|
||||
-ie|--ignore-errors)
|
||||
IGNORE_ERRORS=true
|
||||
shift
|
||||
;;
|
||||
-v|--verbose)
|
||||
-vb|--verbose)
|
||||
VERBOSE=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
-hp|--help)
|
||||
show_usage
|
||||
exit 0
|
||||
;;
|
||||
|
||||
@@ -9,43 +9,43 @@
|
||||
to Salesforce orgs with CSV/JSON support, upsert operations, and intelligent validation.
|
||||
|
||||
.PARAMETER File
|
||||
CSV or JSON file to import
|
||||
CSV or JSON file to import (alias: -fl)
|
||||
|
||||
.PARAMETER SObject
|
||||
Target sObject type
|
||||
Target sObject type (alias: -so)
|
||||
|
||||
.PARAMETER Operation
|
||||
Operation: insert, update, upsert (default: insert)
|
||||
Operation: insert, update, upsert (default: insert) (alias: -op)
|
||||
|
||||
.PARAMETER ExternalId
|
||||
External ID field for upsert/update operations
|
||||
External ID field for upsert/update operations (alias: -ei)
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
Target org username or alias
|
||||
Target org username or alias (alias: -to)
|
||||
|
||||
.PARAMETER Bulk
|
||||
Use bulk API for large datasets
|
||||
Use bulk API for large datasets (alias: -bk)
|
||||
|
||||
.PARAMETER Wait
|
||||
Wait time in minutes (default: 10)
|
||||
Wait time in minutes (default: 10) (alias: -wt)
|
||||
|
||||
.PARAMETER BatchSize
|
||||
Batch size for bulk operations (default: 10000)
|
||||
Batch size for bulk operations (default: 10000) (alias: -bs)
|
||||
|
||||
.PARAMETER IgnoreErrors
|
||||
Continue on errors (don't fail entire job)
|
||||
Continue on errors (don't fail entire job) (alias: -ie)
|
||||
|
||||
.PARAMETER Verbose
|
||||
Enable verbose output
|
||||
Enable verbose output (alias: -vb)
|
||||
|
||||
.PARAMETER Help
|
||||
Show this help message
|
||||
Show this help message (alias: -hp)
|
||||
|
||||
.EXAMPLE
|
||||
.\sf-data-import.ps1 -File accounts.csv -SObject Account
|
||||
.\sf-data-import.ps1 -File contacts.json -SObject Contact -Operation upsert -ExternalId Email
|
||||
.\sf-data-import.ps1 -File leads.csv -SObject Lead -Bulk -BatchSize 5000
|
||||
.\sf-data-import.ps1 -File updates.csv -SObject Account -Operation update -ExternalId AccountNumber
|
||||
.\sf-data-import.ps1 -fl accounts.csv -so Account
|
||||
.\sf-data-import.ps1 -fl contacts.json -so Contact -op upsert -ei Email
|
||||
.\sf-data-import.ps1 -fl leads.csv -so Lead -bk -bs 5000
|
||||
.\sf-data-import.ps1 -fl updates.csv -so Account -op update -ei AccountNumber
|
||||
|
||||
.NOTES
|
||||
This script automatically checks for Salesforce CLI installation and runs
|
||||
@@ -58,21 +58,39 @@
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[Alias("fl")]
|
||||
[string]$File,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[Alias("so")]
|
||||
[string]$SObject,
|
||||
|
||||
[ValidateSet("insert", "update", "upsert")]
|
||||
[Alias("op")]
|
||||
[string]$Operation = "insert",
|
||||
|
||||
[Alias("ei")]
|
||||
[string]$ExternalId,
|
||||
|
||||
[Alias("to")]
|
||||
[string]$TargetOrg,
|
||||
|
||||
[Alias("bk")]
|
||||
[switch]$Bulk,
|
||||
|
||||
[Alias("wt")]
|
||||
[int]$Wait = 10,
|
||||
|
||||
[Alias("bs")]
|
||||
[int]$BatchSize = 10000,
|
||||
|
||||
[Alias("ie")]
|
||||
[switch]$IgnoreErrors,
|
||||
|
||||
[Alias("vb")]
|
||||
[switch]$Verbose,
|
||||
|
||||
[Alias("hp")]
|
||||
[switch]$Help
|
||||
)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ show_usage() {
|
||||
echo " sf-logs-tail [OPTIONS]"
|
||||
echo ""
|
||||
echo "OPTIONS:"
|
||||
echo " -t, --target-org ORG Target org username or alias"
|
||||
echo " -o, --target-org ORG Target org username or alias"
|
||||
echo " -u, --user-id USER Specific user ID to monitor (default: current user)"
|
||||
echo " -l, --level LEVEL Log level: ERROR, WARN, INFO, DEBUG, FINE, FINER, FINEST"
|
||||
echo " --duration MINUTES How long to tail logs in minutes (default: 30)"
|
||||
@@ -35,7 +35,7 @@ show_usage() {
|
||||
echo " sf-logs-tail # Tail logs for default org"
|
||||
echo " sf-logs-tail --level DEBUG --duration 60 # Debug level for 1 hour"
|
||||
echo " sf-logs-tail --filter \"MyClass\" --apex-only # Filter Apex logs for MyClass"
|
||||
echo " sf-logs-tail --target-org sandbox --user-id USER123 # Specific org and user"
|
||||
echo " sf-logs-tail -o sandbox --user-id USER123 # Specific org and user"
|
||||
echo ""
|
||||
echo "KEYBOARD SHORTCUTS:"
|
||||
echo " Ctrl+C Stop tailing logs and exit"
|
||||
@@ -153,7 +153,7 @@ VERBOSE=false
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-t|--target-org)
|
||||
-o|--target-org)
|
||||
TARGET_ORG="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
A user-friendly wrapper around 'sf apex tail log' that provides real-time
|
||||
debug log monitoring with filtering, formatting, and intelligent output colorization.
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
.PARAMETER o
|
||||
Target org username or alias
|
||||
|
||||
.PARAMETER UserId
|
||||
@@ -39,7 +39,7 @@
|
||||
.\sf-logs-tail.ps1
|
||||
.\sf-logs-tail.ps1 -Level DEBUG -Duration 60
|
||||
.\sf-logs-tail.ps1 -Filter "MyClass" -ApexOnly
|
||||
.\sf-logs-tail.ps1 -TargetOrg sandbox -UserId USER123
|
||||
.\sf-logs-tail.ps1 -o sandbox -UserId USER123
|
||||
|
||||
.NOTES
|
||||
This script automatically checks for Salesforce CLI installation and runs
|
||||
@@ -49,7 +49,7 @@
|
||||
#>
|
||||
|
||||
param(
|
||||
[string]$TargetOrg,
|
||||
[string]$o,
|
||||
[string]$UserId,
|
||||
[ValidateSet("ERROR", "WARN", "INFO", "DEBUG", "FINE", "FINER", "FINEST")]
|
||||
[string]$Level,
|
||||
@@ -190,9 +190,9 @@ if ($Duration -lt 1) {
|
||||
$sfArgs = @("apex", "tail", "log")
|
||||
|
||||
# Add optional parameters
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$sfArgs += "--target-org"
|
||||
$sfArgs += $TargetOrg
|
||||
$sfArgs += $o
|
||||
}
|
||||
|
||||
if ($UserId) {
|
||||
@@ -212,8 +212,8 @@ Set-SignalHandlers
|
||||
Write-Host "📡 Starting Debug Log Tail" -ForegroundColor Blue
|
||||
Write-Host "===========================" -ForegroundColor Blue
|
||||
|
||||
if ($TargetOrg) {
|
||||
Write-Host "Target org: $TargetOrg" -ForegroundColor Cyan
|
||||
if ($o) {
|
||||
Write-Host "Target org: $o" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
if ($UserId) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
quick access to org information, limits, and authentication status with
|
||||
clean, formatted output.
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
.PARAMETER o
|
||||
Target org username or alias (uses default if not specified)
|
||||
|
||||
.PARAMETER Limits
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
.EXAMPLE
|
||||
.\sf-org-info.ps1
|
||||
.\sf-org-info.ps1 -TargetOrg "production"
|
||||
.\sf-org-info.ps1 -o "myorg" -Limits -Verbose
|
||||
.\sf-org-info.ps1 -Limits
|
||||
.\sf-org-info.ps1 -ListOrgs
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#>
|
||||
|
||||
param(
|
||||
[string]$TargetOrg,
|
||||
[string]$o,
|
||||
[switch]$Limits,
|
||||
[switch]$ListOrgs,
|
||||
[switch]$Verbose,
|
||||
@@ -132,10 +132,10 @@ if ($ListOrgs) {
|
||||
$sfArgs = @("org", "display")
|
||||
|
||||
# Add target org if specified
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$sfArgs += "--target-org"
|
||||
$sfArgs += $TargetOrg
|
||||
Write-Host "Target org: $TargetOrg" -ForegroundColor Cyan
|
||||
$sfArgs += $o
|
||||
Write-Host "Target org: $o" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
# Add verbose flag if requested
|
||||
@@ -158,9 +158,9 @@ if ($Limits) {
|
||||
# Build limits command
|
||||
$limitsArgs = @("org", "list", "limits")
|
||||
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$limitsArgs += "--target-org"
|
||||
$limitsArgs += $TargetOrg
|
||||
$limitsArgs += $o
|
||||
}
|
||||
|
||||
$success = Invoke-SafeSfCommand $limitsArgs
|
||||
@@ -186,9 +186,9 @@ if ($Verbose) {
|
||||
Write-Host "👤 Current User Info:" -ForegroundColor Yellow
|
||||
$userArgs = @("org", "display", "user")
|
||||
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$userArgs += "--target-org"
|
||||
$userArgs += $TargetOrg
|
||||
$userArgs += $o
|
||||
}
|
||||
|
||||
$success = Invoke-SafeSfCommand $userArgs
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
.PARAMETER OutputDir
|
||||
Output directory for retrieved metadata (default: current directory)
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
.PARAMETER o
|
||||
Target org username or alias (uses default if not specified)
|
||||
|
||||
.PARAMETER Wait
|
||||
@@ -33,9 +33,9 @@
|
||||
Show this help message
|
||||
|
||||
.EXAMPLE
|
||||
.\sf-retrieve.ps1 -MetadataTypes "ApexClass,CustomObject"
|
||||
.\sf-retrieve.ps1 -MetadataTypes "ApexClass,CustomObject" -o myorg -OutputDir retrieved
|
||||
.\sf-retrieve.ps1 -Manifest "manifest/package.xml"
|
||||
.\sf-retrieve.ps1 -Package "MyPackage" -TargetOrg "myorg"
|
||||
.\sf-retrieve.ps1 -Package "MyPackage" -o "myorg"
|
||||
.\sf-retrieve.ps1 -MetadataTypes "Flow" -OutputDir "./retrieved" -Verbose
|
||||
|
||||
.NOTES
|
||||
@@ -54,7 +54,7 @@ param(
|
||||
[string]$Package,
|
||||
|
||||
[string]$OutputDir,
|
||||
[string]$TargetOrg,
|
||||
[string]$o,
|
||||
[int]$Wait = 10,
|
||||
[switch]$Verbose,
|
||||
[switch]$Help
|
||||
@@ -154,10 +154,10 @@ if ($OutputDir) {
|
||||
$sfArgs += $OutputDir
|
||||
}
|
||||
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$sfArgs += "--target-org"
|
||||
$sfArgs += $TargetOrg
|
||||
Write-Host "Target org: $TargetOrg" -ForegroundColor Cyan
|
||||
$sfArgs += $o
|
||||
Write-Host "Target org: $o" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
if ($Wait -ne 10) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
.PARAMETER Wait
|
||||
Wait time in minutes for test execution (default: 10)
|
||||
|
||||
.PARAMETER TargetOrg
|
||||
.PARAMETER o
|
||||
Target org username or alias (uses default if not specified)
|
||||
|
||||
.PARAMETER OutputDir
|
||||
@@ -42,7 +42,7 @@
|
||||
.\sf-test-run.ps1 -TestClasses "AccountTest,ContactTest"
|
||||
.\sf-test-run.ps1 -TestLevel "RunLocalTests" -Coverage
|
||||
.\sf-test-run.ps1 -TestMethods "AccountTest.testCreate,ContactTest.testUpdate"
|
||||
.\sf-test-run.ps1 -Suite "AllTests" -Wait 15 -TargetOrg "staging"
|
||||
.\sf-test-run.ps1 -Suite "AllTests" -Wait 15 -o "staging"
|
||||
|
||||
.NOTES
|
||||
This script automatically checks for Salesforce CLI installation and runs
|
||||
@@ -65,7 +65,7 @@ param(
|
||||
|
||||
[switch]$Coverage,
|
||||
[int]$Wait = 10,
|
||||
[string]$TargetOrg,
|
||||
[string]$o,
|
||||
[string]$OutputDir,
|
||||
[switch]$Verbose,
|
||||
[switch]$Help
|
||||
@@ -150,10 +150,10 @@ if ($TestClasses) {
|
||||
}
|
||||
|
||||
# Add optional parameters
|
||||
if ($TargetOrg) {
|
||||
if ($o) {
|
||||
$sfArgs += "--target-org"
|
||||
$sfArgs += $TargetOrg
|
||||
Write-Host "Target org: $TargetOrg" -ForegroundColor Cyan
|
||||
$sfArgs += $o
|
||||
Write-Host "Target org: $o" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
if ($Wait -ne 10) {
|
||||
|
||||
Reference in New Issue
Block a user