Part 3: How to Manage Your SN-CLI Profiles   


When developing components, you’ll need to leverage an SN-CLI profile. This is especially important if you’re working with multiple development environments (for instance, if you have a personal and organizational profile or work with multiple clients). While some people may be able to set and forget their default profile, we at esolutionsONE have found ourselves having to update, remove, replace, and refresh our profiles frequently enough to warrant a blog post! 

 

Cases where you’ll have to update / remove / refresh / add a profile: 

  • Your developer instance times out, and you want to connect your SN-CLI to your new dev instance > Remove your old profile and set a new one with a profile name provided 

  • You need to work on a new ServiceNow instance > add a new profile 

  • Your connection is no longer working > Refresh your profile 

  • You want to create your first profile and set it as default > set profile with no name provided 

 

Cases where you’ll have to use your profile to run a command 

  • When you want to develop (and you want to use a profile other than your default) 

  • When you want to deploy (and you want to use a profile other than your default)  

 

Profile Management Commands >> These can also be found in the SN-CLI Cheat Sheet

Profile Commands can be found here -> Configure and Manage your ServiceNow CLI Profiles 

  • Creates a default profile if no other profile exists 

  • snc configure profile set 

  • Creates a profile with the name specified 

  • snc configure profile set --profile [profile-name] 

  • Displays all configured profiles 

  • snc configure profile list 

  • Removes the configured profile using the name specified 

  • snc configure profile remove --profile [profile-name] 

  • CLI refreshes the connection for default profile 

  • snc configure profile refresh 

  • CLI refreshes the connection for named profile 

  • snc configure profile refresh --profile [profile-name] 

  • Starts Development ***** 

  • snc ui-component develop --open --profile [profile name] 

  • Deploys the component to your specified profile's instance if you have permissions to do so 

  • snc ui-component deploy --profile [profile name] --force 

 

Hopefully, this helps demystify SN-CLI profiles! Now that you’re an expert, you may want to bookmark our SN-CLI cheat sheet to have a quick list of helpful commands! 


Previous
Previous

Part 4: Common Pitfalls, Snags, and Issues When Creating UIB Components 

Next
Next

Part 2: How to Configure Your PC for ServiceNow UIB Component Development