Create a connection profile that the ServiceNow CLI uses by default. You must create a default profile to set up the CLI's initial connection with an instance.

About this task

By default, the information in this profile is used when you run a command that does not explicitly specify a profile to use.

Note: Sensitive credential information is only stored in the OS keychain, not in the configuration file.

Procedure

  1. Open your system's command-line tool and execute this command.
    $ snc configure profile set
    The CLI prompts you for more information.
  2. Enter the requested values.
    When prompting for information, the CLI displays current values in brackets []. To keep an existing value, press the Enter key.
    $ snc configure profile set
    
    Host: 
    https://myinstance.service-now.com
    
    Login Method (Basic, OAuth, OAuth + MFA): 
    Basic
    
    Username: 
    myusername
    
    Password: 
    mypassword
  3. Run any command using the values specified in your default profile by omitting the --profile attribute from your command.
    $ snc record create
    The command creates a record in the instance specified in the default profile with the specified connection options.