ServiceNow CLI available commands
-
- UpdatedJan 30, 2025
- 7 minutes to read
- Yokohama
- Building applications
Commands and command arguments available to the base system ServiceNow CLI.
Global command arguments
Use command arguments to set options for any CLI commands.
- --help
Provides help information for the specified command, which includes the description, supported arguments, and examples. For more information, see Get help with ServiceNow CLI.
- --debug
provides debug logging output when executing a command. For more information, see Get help with ServiceNow CLI.
- --profile
Specifies the named profile to use for a command. For more information, see Configuring and managing your ServiceNow CLI connection profiles.
- --output
Specifies the output format to use for a command. The ServiceNow CLI supports the following output formats.
json
: The output is formatted as JSON. This is the default.yaml
: The output is formatted as YAML. Use YAML to handle the output with services and tools that emit or consume YAML-formatted strings.text
: The output is formatted as multiple lines of tab-separated string values. Use this output with traditional UNIX text tools such as grep, sed, and awk, and the text processing performed by PowerShell.table
: The output is formatted as a table which presents the information in a human-readable format.none
: The CLI does not print the output to the console. Success, error, and progress messages still display.
- --no-interactive
- Prevents the CLI from prompting the user for argument values. If the user does not pass a value for a required argument, the system uses the default value. If no default value is defined, the system throws an error.
- --no-verbose
- The command executes silently without messages. Use this argument in automated testing scenarios.
Configure profile
Create a connection profile to connect with your instance, view connection profiles, refresh your connection and available commands, or delete profiles you no longer need. For more information about configuring your profile, see Configuring and managing your ServiceNow CLI connection profiles.
- Set up a default profile
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.
The system prompts you for the following information:
- Set up a named profile
Create a named connection profile to use with specific commands. This allows you to specify a different instance or connection protocol for a specific command.
The system prompts you for the following information:
- View profiles
View all connection profiles set in the configuration file, or view information about a specific profile.
- Remove a profile
Remove a named connection profile that you no longer need from the configuration file.
- Refresh a profile
Update the available commands from the instance for the given profile. Refresh your connection after modifying any of the commands on the corresponding instance in order to keep the CLI up-to-date.
Perform record operations
Create, read, update, delete, and query records in your instance using the ServiceNow CLI command-line tool. For more information about performing record operations, see Perform record operations using ServiceNow CLI.
- Create a record
Inserts a single record in a specified table.
Pass in values for these arguments.
Parameter Description table Required. Name of the table in which to save the record. data Required. Field name and the associated value for each field to define in the specified record in JSON string format. - Delete a record
Deletes the specified record from the specified table.
Pass in values for these arguments.
Parameter Description table Required. Name of the table in which to delete the record. sysid Required. Sys_id of the record to delete. - Get a record
Retrieves a single record based on the specified sys_id from the specified table.
Pass in values for these arguments.
Parameter Description table Required. Name of the table from which to retrieve the record. sysid Required. Sys_id of the record to retrieve. - Query records
Retrieves multiple records from a specified table.
Pass in values for these arguments.
- Update a record
Updates the specified record with the given data attributes.
Pass in values for these arguments.
Parameter Description table Required. Name of the table in which to save the record. sysid Required. Sys_id of the record to update. data Required. Field name and the associated value for each field to define in the specified record in JSON string format.
Work with extensions
Add extensions to the ServiceNow CLI to load additional functionality and commands, update existing extensions, or remove extensions you no longer need. For more information, see Manage ServiceNow CLI extensions.
- Find available extensions
- Install an extension
- Update an extension
- Remove an extension
Use the ui-component extension
- Add the ui-component extension
Add the ui-component extension to the ServiceNow CLI.
- Set up your project
Create the component project and the set of files required to develop a component. You can connect to your instance and create an application scope for your component, or you can reserve a scope to verify later.
Pass in values for these arguments.
- Run the development server
Add your component code and test it using a local development server.
Pass in values for these arguments.
- Deploy a component to an instance
Deploy your component to display in your instance as an application plugin.
Pass in values for these arguments.
Name Description open When true, opens the default browser and navigates to UI Builder in your instance. Default: false
force Deploys component changes and overwrites any existing component records. Default: false.