---
sourceDocument: Yokohama Build or modify applications
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/application-development

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# ServiceNow CLI available commands

# ServiceNow CLI available commands {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 8 minutes to read

Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of ServiceNow CLI Available Commands

The ServiceNow CLI (Command Line Interface) provides a comprehensive set of commands to interact with your ServiceNow instances efficiently.
It enables you to manage connection profiles, perform CRUD operations on records, handle output formatting, and extend CLI functionality through extensions.
This tool supports various login methods and output formats to fit different operational and automation needs.
Show full answer Show less  

## Global Command Arguments

* **--help:** Displays detailed help information for any command.
* **--debug:** Enables debug logging to troubleshoot command execution.
* **--profile:** Specifies which connection profile to use.
* **--output:** Controls output format; supports `json` (default), `yaml`, `text`, `table`, and `none`.
* **--no-interactive:** Prevents prompts, useful for automation.
* **--no-verbose:** Runs commands silently, ideal for automated tests.

## Configuring and Managing Connection Profiles

Profiles store connection details to ServiceNow instances, allowing multiple configurations for different instances or users.

* **Set up default profile:** Use `snc configure profile set` to define host, login method (Basic, OAuth, OAuth+MFA), user credentials, and default output format.
* **Named profiles:** Create profiles with specific names to use with particular commands, enabling flexible instance management.
* **View profiles:** List all or specific profiles using `snc configure profile list`.
* **Remove profiles:** Delete unused profiles via `snc configure profile remove`.
* **Refresh profiles:** Update available commands from instances with `snc configure profile refresh` to keep CLI in sync.

## Record Operations

The CLI supports full CRUD (Create, Read, Update, Delete) and query operations on ServiceNow tables, enabling direct data manipulation from the command line.

* **Create:** `snc record create` inserts a new record; requires table name and JSON data for fields.
* **Delete:** `snc record delete` removes a record by table name and sysid.
* **Get:** `snc record get` retrieves a single record by sysid.
* **Query:** `snc record query` fetches multiple records with filtering, pagination, and optional display values.
* **Update:** `snc record update` modifies an existing record using sysid, table name, and JSON data.

## Output Formats

Choose the output format best suited for your workflow or integration:

* **JSON:** Default, structured for programmatic parsing.
* **YAML:** Suited for tools that consume or emit YAML.
* **Text:** Tab-separated values compatible with UNIX text tools and PowerShell.
* **Table:** Human-readable tabular display.
* **None:** Suppresses output but shows success/error messages.

## Extensions Management

Extend the CLI capabilities by adding, updating, or removing extensions.

* List available extensions with `snc extension list-available`.
* Install extensions using `snc extension add`.
* Update and remove extensions with corresponding commands.

## UI-Component Extension

This extension supports development and deployment of UI components:

* **Add the extension:** Use `snc extension add --name ui-component`.
* **Project setup:** Create a UI component project with `snc ui-component project`, specifying name, description, scope, and offline mode.
* **Development server:** Test components locally using `snc ui-component develop` with options for entry point, browser launch, port, and host accessibility.
* **Deployment:** Deploy your component to your ServiceNow instance as an application plugin with `snc ui-component deploy`, optionally opening the UI Builder and forcing overwrite.

## Practical Benefits for ServiceNow Customers

By leveraging the ServiceNow CLI, customers can streamline instance management and automation tasks, reduce reliance on the UI, and integrate ServiceNow operations into scripts and CI/CD processes. Flexible connection profiles and output options ensure adaptability across environments and workflows. Extensions, especially the UI-component extension, empower developers to build, test, and deploy custom components efficiently.\</  
Commands and command arguments available to the base system ServiceNow CLI.

## Global command arguments {#sn-cli-commands__section_orq_sps_l4b}

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](https://servicenow-prod.fluidtopics.net/ZHxcoGWwguWGVuCxRdLjOQ "See available commands, command options, and examples, or generate debug logging output.").

        $ snc --help

--debug

:   provides debug logging output when executing a command. For more information, see
    [Get help with ServiceNow CLI](https://servicenow-prod.fluidtopics.net/ZHxcoGWwguWGVuCxRdLjOQ "See available commands, command options, and examples, or generate debug logging output.").

        $ snc record delete --table incident --sysid 552c48888c033300964f4932b03eb092 --debug

--profile

:   Specifies the named profile to use for a command. For more information, see [Configuring and managing your ServiceNow CLI connection profiles](https://servicenow-prod.fluidtopics.net/IEl1AJB6K9sP~j0thJR6GQ "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.").

        $ snc configure profile set --profile <profilename>

--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.  


          {
             "default": {
                "appversion": "1.0.8",
                "host": "https://myinstance.service-now.com",
                "hostversion": "Paris",
                "loginmethod": "basic",
                "output": "json",
                "username": "admin"
             },
             "user1": {
                "appversion": "1.0.8",
                "host": "https://otherinstance.service-now.com",
                "hostversion": "Paris",
                "loginmethod": "basic",
                "output": "yaml",
                "username": "admin"
             }
          }

    * `yaml`: The output is formatted as YAML. Use YAML to handle the output with services and tools that emit or consume YAML-formatted strings.  

          default:
             appversion: 1.0.8
             host: https://myinstance.service-now.com
             hostversion: Paris
             loginmethod: basic
             output: json
             username: admin
          user1:
             appversion: 1.0.8
             host: https://otherinstance.service-now.com
             hostversion: Paris
             loginmethod: basic
             output: yaml
             username: admin

    * `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.  

          default   https://myinstance.service-now.com   Paris   1.0.8   basic   admin   json 
          user1   https://otherinstance.service-now.com   Paris   1.0.8   basic   admin   yaml

    * `table`: The output is formatted as a table which presents the information in a human-readable format.  

          NAME   HOST   HOST   VERSION   APP   VERSION   LOGIN   METHOD   USERNAME   OUTPUT 
          -------------------------------------------------------------------------------
          default   myinstance   Paris   1.0.8   basic   admin   json 
          user1   otherinstance   Paris   1.0.8   basic   admin   yaml

    * `none`: The CLI does not print the output to the console. Success, error, and progress messages still display.
    {#sn-cli-commands__ul_iwy_c2t_l4b}  

        $ snc record query --table incident --query 'active=true' --output json

--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 {#sn-cli-commands__section_rv3_b4s_l4b}

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](https://servicenow-prod.fluidtopics.net/IEl1AJB6K9sP~j0thJR6GQ "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.").  

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.

        $ snc configure profile set

    The system prompts you for the following information:  
    {#sn-cli-commands__id_mvn_zft_l4b__entry__2}

    | Requested information | Description |
    |-|-|
    | Host | The host name of the instance to connect to. Supports both the full URL (https://my-instance.service-now.com) or just the host name (my-instance). |
    | Login method | The login method to use to connect to the instance. Supports <kbd class="ph userinput">Basic</kbd>, <kbd class="ph userinput">OAuth</kbd>, and <kbd class="ph userinput">OAuth + MFA</kbd>. |
    | Username | The user name to use to connect to the instance. |
    | Password | The password to use to connect to the instance. |
    | Client id | The client ID to use to connect to the instance when the login method is OAuth or OAuth + MFA. |
    | Client secret | The client secret to use to connect to the instance when the login method is OAuth or OAuth + MFA. |
    | Authentication code | The authentication code to use to connect to the instance when the login method is OAuth + MFA. |
    | Default output format | Specifies how to format the command results. Options are <kbd class="ph userinput">json</kbd>, <kbd class="ph userinput">yaml</kbd>, <kbd class="ph userinput">text</kbd>, and <kbd class="ph userinput">table</kbd>. |
    [ ]

    {#sn-cli-commands__id_mvn_zft_l4b}

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.

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

    The system prompts you for the following information:  
    {#sn-cli-commands__table_drn_ggt_l4b__entry__2}

    | Requested information | Description |
    |-|-|
    | Host | The host name of the instance to connect to. Supports both the full URL (https://my-instance.service-now.com) or just the host name (my-instance). |
    | Login method | The login method to use to connect to the instance. Supports <kbd class="ph userinput">Basic</kbd>, <kbd class="ph userinput">OAuth</kbd>, and <kbd class="ph userinput">OAuth + MFA</kbd>. |
    | Username | The user name to use to connect to the instance. |
    | Password | The password to use to connect to the instance. |
    | Client id | The client ID to use to connect to the instance when the login method is OAuth or OAuth + MFA. |
    | Client secret | The client secret to use to connect to the instance when the login method is OAuth or OAuth + MFA. |
    | Authentication code | The authentication code to use to connect to the instance when the login method is OAuth + MFA. |
    | Default output format | Specifies how to format the command results. Options are <kbd class="ph userinput">json</kbd>, <kbd class="ph userinput">yaml</kbd>, <kbd class="ph userinput">text</kbd>, and <kbd class="ph userinput">table</kbd>. |
    [ ]

    {#sn-cli-commands__table_drn_ggt_l4b}

View profiles

:   View all connection profiles set in the configuration file, or view information about a specific profile.

        $ snc configure profile list [--profile profile-name]

Remove a profile

:   Remove a named connection profile that you no longer need from the configuration file.

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

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.

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

## Perform record operations {#sn-cli-commands__section_wbn_b4s_l4b}

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](https://servicenow-prod.fluidtopics.net/t3W56Qjd78fmEX9QXB4e2Q "Create, read, update, delete, and query records in your instance using the ServiceNow CLI command-line tool.").  

Create a record

:   Inserts a single record in a specified table.

        $ snc record create [--table table --data data]

    Pass in values for these arguments.  
    {#sn-cli-commands__id_sll_wxf_m4b__entry__2}

    | 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. |
    [ ]

    {#sn-cli-commands__id_sll_wxf_m4b}

Delete a record

:   Deletes the specified record from the specified table.

        $ snc record delete [--table table --sysid sys_id]

    Pass in values for these arguments.  
    {#sn-cli-commands__id_dtm_cyf_m4b__entry__2}

    | Parameter | Description |
    |-|-|
    | table | Required. Name of the table in which to delete the record. |
    | sysid | Required. Sys_id of the record to delete. |
    [ ]

    {#sn-cli-commands__id_dtm_cyf_m4b}

Get a record

:   Retrieves a single record based on the specified sys_id from the specified table.

        $ snc record get [--table table --sysid sys_id]

    Pass in values for these arguments.  
    {#sn-cli-commands__id_kfw_myf_m4b__entry__2}

    | Parameter | Description |
    |-|-|
    | table | Required. Name of the table from which to retrieve the record. |
    | sysid | Required. Sys_id of the record to retrieve. |
    [ ]

    {#sn-cli-commands__id_kfw_myf_m4b}

Query records

:   Retrieves multiple records from a specified table.

        $ snc record query [--displayvalue displayValue --fields fields --limit limit --offset offset --query query --table table]

    Pass in values for these arguments.  
    {#sn-cli-commands__id_b5x_qyf_m4b__entry__2}

    | Parameter | Description |
    |-|-|
    | displayValue | Include `--displayvalue` to retrieve the display value from the database for reference and choice fields. Do not include this parameter to retrieve the actual values. |
    | fields | Comma-separated list of field names to return from the database. |
    | limit | Maximum number of records to return. |
    | offset | Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. |
    | query | Required. Encoded query used to filter the result set in the following format: `--query '<column_name><operator><value>'`. |
    | table | Required. Name of the table in which to query the records. |
    [ ]

    {#sn-cli-commands__id_b5x_qyf_m4b}

Update a record

:   Updates the specified record with the given data attributes.

        $ snc record update [--sysid sys_id --table table --data data]

    Pass in values for these arguments.  
    {#sn-cli-commands__id_kj3_vyf_m4b__entry__2}

    | 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. |
    [ ]

    {#sn-cli-commands__id_kj3_vyf_m4b}

## Work with extensions {#sn-cli-commands__section_s5q_b4s_l4b}

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](https://servicenow-prod.fluidtopics.net/7zt_Y3EvopZ1dqqZyto3lQ "Add extensions to the ServiceNow CLI to load additional functionality and commands, update existing extensions, or remove extensions you no longer need.").  

Find available extensions
:

        $ snc extension list-available -o table

Install an extension
:

        $ snc extension add --name <extension-name>

Update an extension
:

        $ snc extension update --name <extension-name>

Remove an extension
:

        $ snc extension remove --name <extension-name>

## Use the ui-component extension {#sn-cli-commands__section_is3_24s_l4b}

Add the ui-component extension

:   Add the ui-component extension to the ServiceNow CLI.

        $ snc extension add --name ui-component

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.

        $ snc ui-component project [--name name --description description --scope scope --offline]

    Pass in values for these arguments.  
    {#sn-cli-commands__table_gsw_mbg_m4b__entry__2}

    | Name | Description |
    |-|-|
    | name | Required. The project name. Must be a valid and unique npm package name. |
    | description | The project description to be available in the npm registry and the plugins list in your instance. |
    | scope | Suggested application scope to assign to this project and its components. If provided, the instance validates the name. Use the namespace identifier guidelines for application development on the instance. For more information, see [Application scope](https://servicenow-prod.fluidtopics.net/ch6j1iJjd63nAIt7ogF27A "Application scoping protects applications by identifying and restricting access to application files and data."). Maximum: 18 characters. Case: snake case. Default: `x_customerprefix_componentname`, where: * `customerprefix` is the value in the glide.appcreator.company.code system property on your instance. * `componentname` is the value provided in the component's `name` parameter when you created the project. {#sn-cli-commands__scope-params} Alternatively, you can add a value to the `scopeName` parameter in the now-ui.json file. |
    | offline | When true, creates and scaffolds a component while disconnected from your instance. Skips validation of the given scope name. Default: `false`. |
    [ ]

    {#sn-cli-commands__table_gsw_mbg_m4b}

Run the development server

:   Add your component code and test it using a local development server.

        $ snc ui-component develop [--entry entry --open --port port --host host]

    Pass in values for these arguments.  
    {#sn-cli-commands__table_lnx_bzt_vkb__entry__2}

    | Name | Description |
    |-|-|
    | entry | Path to the test module in your component project. Default: example/index.js. |
    | open | Opens the default browser and navigates to the test page. Default: false. |
    | port | Port where the development server runs. Default: 8081. |
    | host | Host address to use if you want your local development server to be accessible externally by others. Typically set to `0.0.0.0` |
    [ ]

    {#sn-cli-commands__table_lnx_bzt_vkb}

Deploy a component to an instance

:   Deploy your component to display in your instance as an application plugin.

        $ snc ui-component deploy [--open --force]

    Pass in values for these arguments.  
    {#sn-cli-commands__table_ck1_qzt_vkb__entry__2}

    | 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. |
    [ ]

    {#sn-cli-commands__table_ck1_qzt_vkb}

