Today when at a customer we were trying to figure out the release versions the various sandboxes and development environments and compare this info with the version of the production instance. Of course all this is available from status.salesforce.com but clicking around got a bit tedious so I whipped up a quick set of bash aliases for the Terminal. Since the output is also available as JSON it was pretty easy. First I grabbed the jq JSON parser for bash and then I wrote 4 aliases for bash:
- sf_instance – returns the instance ID (e.g. “na44”) from the hostname. This is useful if you are using a custom domain to access the instance e.g. lekkim-trailhead-dev-ed.my.salesforce.com
- sf_release – shows only the release the instance is on e.g. “Spring ’17 Patch 5.5”
- sf_status – shows release version, whether active or not and type of instance (production, sandbox etc)
- sf_status_raw – returns the raw JSON
Below are examples of usage and the ailases are at github.com/lekkimworld/sf_aliases.
$ sf_help Salesforce CLI actions: ----------------------- - sf_status Shows status for instance ID Syntax : sf_status Example: sf_status na44 - sf_release Shows release version of supplied instance ID Syntax: sf_release Example: sf_release na44 - sf_instance Get instance ID from hostname Syntax: sf_instance Example: sf_instance org62.lightning.force.com - sf_status_raw Shows raw JSON Syntax: sf_status_raw ------------------------ $ sf_instance na44.salesforce.com na44 $ sf_instance lekkim-trailhead-dev-ed.my.salesforce.com eu11 $ sf_release eu11 Winter '17 Patch 18.10 $ sf_release na44 Spring '17 Patch 5.5 $ sf_status eu11 Release Version : Winter '17 Patch 18.10 Active : true Status : OK Environment : production $ sf_status cs85 Release Version : Spring '17 Patch 6 Active : true Status : OK Environment : sandbox