Last active
July 1, 2021 23:03
-
-
Save sjurgis/2d080a9ae6bfbf1f68d40d13db6f4daf to your computer and use it in GitHub Desktop.
list of sfdx aliases (zsh)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Push source, notify when done | |
alias dxp='sfdx force:source:push && osascript -e "display notification \"Push completed\""' | |
# Get an org list and show custom fields (devhub, instance URL) | |
alias dxl="sfdx force:org:list --verbose --json --skipconnectionstatus | jq -r '.result.scratchOrgs[] | [.defaultMarker, .alias, .username, .devHubUsername, .instanceUrl] | @tsv'" | |
# Set default username | |
dxd() { sfdx force:config:set defaultusername=$1 } | |
# Get tail of logs also while logging everything into file | |
alias dxtail="sfdx force:apex:log:tail | tee ../dxtail.log" | |
# Get tail of logs but only display System.debug (no multiline tho), exceptions or start of class | |
alias dxtaild="sfdx force:apex:log:tail --loglevel debug | grep -o 'USER_DEBUG.*\|EXCEPTION_THROWN.*\|CODE_UNIT_STARTED.*' --color=never" | |
# Delete org by username | |
alias dxrm='sfdx force:org:delete -p -u ' | |
# Run apex tests, but prevent mac from sleep and notify when done | |
dxtest(){ | |
caffeinate sfdx force:apex:test:run -r human -c -w 20 | |
osascript -e "display notification \"Apex tests completed\"" | |
} | |
# Get org login url, default or by username | |
dxo(){ | |
if [ -z $1 ] | |
then | |
sfdx force:org:open -r --json | jq -r .result.url | |
else | |
sfdx force:org:open -r -u $1 --json | jq -r .result.url | |
fi | |
} | |
# Delete logs | |
alias dxcl='echo "delete [select id from MyNS__Logs__c limit 10000];" | sfdx force:apex:execute' | |
# Enable lightning debug mode | |
alias dxdb='echo "update new User(Id = UserInfo.getUserId(), UserPreferencesUserDebugModePref=true);" | sfdx force:apex:execute' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment