<h2>ServiceNow SDK CLI</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="reference" /><meta name="DC.title" content="ServiceNow SDK CLI" /><meta name="abstract" content="Use the ServiceNow SDK command-line interface (CLI) to manage changes between a local application and the application on an instance." /><meta name="description" content="Use the ServiceNow SDK command-line interface (CLI) to manage changes between a local application and the application on an instance." /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-11-07T11:40:04-06:00" /><meta name="DC.date.modified" content="2024-02-01" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="servicenow-sdk-cli-commands" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>ServiceNow SDK CLI</title></head><body> <div class="nested0" id="servicenow-sdk-cli-commands"> <h1 class="title topictitle1" id="ariaid-title1"><span class="ph">ServiceNow</span> SDK CLI</h1> <div class="body refbody"><p class="shortdesc">Use the <span class="ph">ServiceNow</span> SDK command-line interface (CLI) to manage changes between a local application and the application on an instance.</p> <div class="section" id="servicenow-sdk-cli-commands__section_dhf_brh_jzb"> <p class="p">From the command-line tool on your system, enter <code class="ph codeph">now-sdk</code> to start the CLI and return a list of available commands or <code class="ph codeph">now-sdk [command]</code> to begin using the <span class="ph">ServiceNow</span> SDK.</p> <p class="p">The CLI includes the following commands and global options:</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="servicenow-sdk-cli-commands__table_ynq_2fh_jzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>Global options</span></caption><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d530390e77">Option</th><th class="entry cellrowborder" style="vertical-align:top;" id="d530390e80">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e77 ">--version</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e80 ">Return the version of the CLI.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e77 ">--help, -h</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e80 ">Return information about commands, subcommands, and parameters.</td></tr></tbody></table> </div> </div> </div> <div class="topic reference nested1" id="now-sdk-auth-command"> <h2 class="title topictitle2" id="ariaid-title2">auth</h2> <div class="body refbody"><p class="shortdesc">Authenticate with an instance and store, update, or view user credentials for accessing an instance on your system.</p> <div class="section" id="now-sdk-auth-command__section_umc_lzy_mzb"> <div class="p">The <code class="ph codeph">auth</code> command has <code class="ph codeph">save</code>, <code class="ph codeph">clear</code>, <code class="ph codeph">list</code>, and <code class="ph codeph">set-default</code> subcommands and the following structure:<pre class="pre codeblock language-cmd">now-sdk auth [<subcommand>]</pre></div> </div> <div class="section" id="now-sdk-auth-command__section_kkt_dml_rzb"><h3 class="title sectiontitle">save</h3> <p class="p">Store credentials in the device keychain or credential manager on your system. At the prompt, provide a password to authenticate with the instance.</p> <div class="p">The <code class="ph codeph">save</code> subcommand has the following structure:<pre class="pre codeblock language-cmd">now-sdk auth save [<alias>] [--host <hostname>] [--username <username>] [--default]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-auth-command__table_udn_jml_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 2. </span>Required parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e203">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e206">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e209">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e212">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e203 ">alias</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e206 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e209 "><span class="ph">A unique identifier for the host and user credentials.</span><p class="p">The alias can be used for authentication with the <code class="ph codeph">create</code>, <code class="ph codeph">convert</code>, <code class="ph codeph">fetch</code>, and <code class="ph codeph">deploy</code> commands.</p> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e212 ">—</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e203 ">--host</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e206 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e209 ">The target instance to access and to which you deploy and fetch applications. The instance must be on the <span class="ph">Washington DC</span> release.</td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e212 ">—</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e203 ">--username</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e206 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e209 ">A user name for authenticating to the instance. The user must have admin access.</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e212 ">—</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-auth-command__table_wdn_jml_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 3. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e305">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e308">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e311">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e314">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e305 ">--default, -d</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e308 ">Boolean</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e311 ">Option to set the <code class="ph codeph">alias</code> as the default alias.</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e314 ">false</td></tr></tbody></table> </div> <p class="p">For example:</p> <pre class="pre codeblock language-cmd">now-sdk auth save devuser1 --host https://myinstance.service-now.com --username user1 --default</pre> </div> <div class="section" id="now-sdk-auth-command__section_rgz_dml_rzb"><h3 class="title sectiontitle">clear</h3> <p class="p">Remove credentials in the device keychain or credential manager on your system.</p> <div class="p">The <code class="ph codeph">clear</code> subcommand has the following structure: <pre class="pre codeblock language-cmd">now-sdk auth clear [<alias>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-auth-command__table_vvj_c2r_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 4. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e386">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e389">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e392">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e395">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e386 ">alias</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e389 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e392 "><span class="ph">A unique identifier for the host and user credentials.</span></td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e395 ">all</td></tr></tbody></table> </div> <div class="p">For example:<pre class="pre codeblock language-cmd">now-sdk auth clear devuser1</pre></div> </div> <div class="section" id="now-sdk-auth-command__section_iqs_2ml_rzb"><h3 class="title sectiontitle">list</h3> <p class="p">View credentials saved in the device keychain or credential manager on your system. Passwords aren't returned.</p> <div class="p">The <code class="ph codeph">list</code> subcommand has the following structure: <pre class="pre codeblock language-cmd">now-sdk auth list [<alias>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-auth-command__table_pkb_n2r_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 5. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e463">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e466">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e469">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e472">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e463 ">alias</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e466 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e469 "><span class="ph">A unique identifier for the host and user credentials.</span></td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e472 ">all</td></tr></tbody></table> </div> <div class="p">For example:<pre class="pre codeblock language-cmd">now-sdk auth list devuser1</pre></div> </div> <div class="section" id="now-sdk-auth-command__section_zbs_fml_rzb"><h3 class="title sectiontitle">set-default</h3> <p class="p">Set the credentials to be used by commands by default.</p> <div class="p">The <code class="ph codeph">set-default</code> subcommand has the following structure: <pre class="pre codeblock language-cmd">now-sdk auth <strong class="hl-keyword">set</strong>-default [<alias>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-auth-command__table_ok3_r2r_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 6. </span>Required parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e540">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e543">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e546">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e549">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e540 ">alias</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e543 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e546 "><span class="ph">A unique identifier for the host and user credentials.</span></td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e549 ">—</td></tr></tbody></table> </div> <div class="p">For example:<pre class="pre codeblock language-cmd">now-sdk auth <strong class="hl-keyword">set</strong>-default devuser1</pre></div> </div> </div> </div> <div class="topic reference nested1" id="now-sdk-create-command"> <h2 class="title topictitle2" id="ariaid-title3">create</h2> <div class="body refbody"><p class="shortdesc">Create a custom scoped application and, if specified, deploy it to an instance.</p> <div class="section" id="now-sdk-create-command__section_qvg_mzy_mzb"> <div class="p">The <code class="ph codeph">create</code> command has the following structure:<pre class="pre codeblock language-cmd">now-sdk create <projectName> <scopeName> [<directory>] [--description <description>] [--sampleTable <flag>] [--offline <flag>] [--auth <alias>] [--open-browser <flag>] [--interactive <flag>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-create-command__table_lfx_51l_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 7. </span>Required parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e645">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e648">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e651">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e654">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e645 ">projectName</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e648 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e651 ">The name of the application. <p class="p">The application name should adhere to NPM package naming conventions.</p> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e654 ">—</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e645 ">scopeName</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e648 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e651 ">The scope of the application. <p class="p">The scope name must be unique on the instance, begin with x_<prefix>, and be fewer than 18 characters. For more information, see <a class="xref" href="../../../build/applications/concept/c_NamespaceIdentifier.html" title="The system adds a namespace identifier to the front of application artifacts such as tables, scripts, and configuration records.">Namespace identifier</a>.</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e654 ">—</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-create-command__table_mfx_51l_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 8. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e730">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e733">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e736">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e739">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">directory</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e733 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e736 "><span class="ph">The local directory in which to create the application directories and files.</span></td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e739 "><span class="ph">Current working directory</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">--description</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e733 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e736 ">A short description of your application.</td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e739 ">—</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">--sampleTable</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e733 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e736 ">An option for creating a sample table in the application.<p class="p">If true, the sample table (<span class="ph filepath"><scope>_to_do.xml</span>) is created in the <span class="ph filepath">.metadata</span> directory.</p> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e739 ">false</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">--offline</span>, <span class="ph">-o</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e733 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e736 ">An option for skipping deploying an application to the instance. <p class="p">If true, the scope name isn’t validated during creation so you must verify that the scope name is valid before deploying to your instance.</p> <div class="note"><span class="notetitle">Note:</span> This parameter is ignored when the <code class="ph codeph">auth</code> parameter is set.</div> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e739 ">false</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">--auth</span>, <span class="ph">-a</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e733 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e736 "><span class="ph">An alias for the credentials to use to authenticate to the instance.</span></td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e739 "><span class="ph">If set, the default alias.</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">--open-browser</span>, <span class="ph">-b</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e733 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e736 "><span class="ph">An option to open the application record (sys_app) in your default browser after successfully deploying the application.</span><div class="note"><span class="notetitle">Note:</span> This parameter is ignored when the <code class="ph codeph">offline</code> parameter is set to true.</div> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e739 ">false</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e730 "><span class="ph">--interactive</span>, <span class="ph">-i</span></td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e733 ">Boolean</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e736 ">An option to answer a guided set of prompts to create the application.</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e739 ">false</td></tr></tbody></table> </div> <div class="p">For example:<pre class="pre codeblock language-cmd">now-sdk create example-app x_snc_example /<strong class="hl-keyword">path</strong>/to/app_folder --description example_app_description --sampleTable true --auth devuser1 --open-browser true</pre></div> </div> </div> </div> <div class="topic reference nested1" id="now-sdk-convert-command"> <h2 class="title topictitle2" id="ariaid-title4">convert</h2> <div class="body refbody"><p class="shortdesc">Convert an existing application from an instance to support modifying it locally in <span class="ph">Visual Studio Code</span> and deploying application changes to the instance with the <span class="ph">ServiceNow</span> SDK.</p> <div class="section" id="now-sdk-convert-command__section_a23_rcz_mzb"> <p class="p">Converting an application downloads the metadata XML files of the application and adds the necessary files and directories for using the SDK locally. The application isn't changed on the instance. For more information, see the <a class="xref" href="../concept/servicenow-sdk.html#servicenow-sdk__section_ipd_3md_mzb">Application structure</a> section of the <span class="ph">ServiceNow</span> SDK topic.</p> <div class="p">The <code class="ph codeph">convert</code> command has the following structure:<pre class="pre codeblock language-cmd">now-sdk <strong class="hl-keyword">convert</strong> <scopeName> <packageName> [<directory>] [--auth <alias>] [--scopeId <app_scope_id>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-convert-command__table_sx4_gtr_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 9. </span>Required parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e991">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e994">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e997">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e1000">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e991 ">scopeName</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e994 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e997 ">The scope of the existing application. <p class="p">For global applications, use the application name.</p> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1000 ">—</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e991 ">packageName</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e994 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e997 ">A name for the application package used in the <span class="ph filepath">package.json</span> file. <p class="p">The package name should conform to the NPM package naming conventions.</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e1000 ">—</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-convert-command__table_tx4_gtr_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 10. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1067">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1070">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1073">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e1076">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1067 ">directory</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1070 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1073 "><span class="ph">The local directory in which to create the application directories and files.</span></td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1076 "><span class="ph">Current working directory</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1067 ">--auth, -a</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1070 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1073 "><span class="ph">An alias for the credentials to use to authenticate to the instance.</span></td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1076 "><span class="ph">If set, the default alias.</span></td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1067 ">--scopeId</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1070 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1073 ">The sys_id of the existing application.<div class="note"><span class="notetitle">Note:</span> This parameter is required to convert global applications.</div> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e1076 ">—</td></tr></tbody></table> </div> <p class="p">For example:</p> <pre class="pre codeblock language-cmd">now-sdk <strong class="hl-keyword">convert</strong> x_snc_example example-app /<strong class="hl-keyword">path</strong>/to/app_folder --auth user1-dev --scopeId example_app_scope_id</pre> <p class="p"></p> </div> </div> </div> <div class="topic reference nested1" id="now-sdk-fetch-command"> <h2 class="title topictitle2" id="ariaid-title5">fetch</h2> <div class="body refbody"><p class="shortdesc">Download application metadata from an instance and update the metadata XML files in your local application to match.</p> <div class="section" id="now-sdk-fetch-command__section_rqr_mzy_mzb"> <div class="p">The <code class="ph codeph">fetch</code> command has the following structure:<pre class="pre codeblock language-cmd">now-sdk fetch [--directory <package <strong class="hl-keyword">path</strong>>] [--<strong class="hl-keyword">mode</strong> <fetch <strong class="hl-keyword">mode</strong>>] [--auth <alias>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-fetch-command__table_sbb_xds_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 11. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1213">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1216">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1219">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e1222">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1213 ">--directory</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1216 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1219 ">The path to your application.</td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1222 "><span class="ph">Current working directory</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1213 ">--mode, -m</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1216 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1219 ">An option for which metadata to fetch.<ul class="ul" id="now-sdk-fetch-command__ul_pqr_dfs_rzb"><li class="li">complete: Fetch all metadata of the application.</li><li class="li">incremental: Fetch only changes to the application metadata since your last fetch.</li></ul> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1222 ">incremental</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1213 ">--auth, -a</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1216 ">String</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1219 "><span class="ph">An alias for the credentials to use to authenticate to the instance.</span></td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e1222 "><span class="ph">If set, the default alias.</span></td></tr></tbody></table> </div> <div class="p">For example: <pre class="pre codeblock language-cmd">now-sdk fetch --auth devuser1 --directory /<strong class="hl-keyword">path</strong>/to/package --<strong class="hl-keyword">mode</strong> inc<em class="hl-comment">remental</em></pre></div> </div> </div> </div> <div class="topic reference nested1" id="now-sdk-build-command"> <h2 class="title topictitle2" id="ariaid-title6">build</h2> <div class="body refbody"><p class="shortdesc">Compile source files and generate a deployable package. Third-party library dependencies are converted into XML files that can be installed with the application.</p> <div class="section" id="now-sdk-build-command__section_isb_nzy_mzb"> <div class="p">The <code class="ph codeph">build</code> command has the following structure:<pre class="pre codeblock language-cmd">now-sdk build <source> [--debug <flag>] [--generate-deletes <flag>] [--lint <flag>] [--optimize <flag>]</pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-build-command__table_vx2_vvr_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 12. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1361">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1364">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1367">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e1370">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1361 ">source</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1364 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1367 ">The path to the <span class="ph filepath">package.json</span> file for your application. <p class="p">The <span class="ph filepath">package.json</span> should be in the base directory of your application.</p> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1370 "><span class="ph">Current working directory</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1361 ">--debug, -d</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1364 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1367 ">An option to return the debug logs generated during the build process.</td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1370 ">false</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1361 ">--generate-deletes</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1364 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1367 ">An option to generate delete record updates for files removed between builds.</td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1370 ">true</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1361 ">--lint</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1364 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1367 ">An option to lint source files before building.</td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1370 ">true</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1361 ">--optimize, -o</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1364 ">Boolean</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1367 ">An option to optimize packaging by reusing unchanged dependency XML files.</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e1370 ">true</td></tr></tbody></table> </div> <div class="p">For example:<pre class="pre codeblock language-cmd">now-sdk build /<strong class="hl-keyword">path</strong>/to/package --debug true --generate-deletes true --lint true --optimize true</pre></div> </div> </div> </div> <div class="topic reference nested1" id="now-sdk-deploy-command"> <h2 class="title topictitle2" id="ariaid-title7">deploy</h2> <div class="body refbody"><p class="shortdesc">Deploy an application to an instance. Before using the <code class="ph codeph">deploy</code> command, you must use the <code class="ph codeph">build</code> command to generate a deployable package.</p> <div class="section" id="now-sdk-deploy-command__section_gtn_nzy_mzb"> <p class="p">The <code class="ph codeph">deploy</code> command has the following structure:</p> <pre class="pre codeblock language-cmd">now-sdk deploy [--source <package <strong class="hl-keyword">path</strong>>] [--<strong class="hl-keyword">mode</strong> <deploy <strong class="hl-keyword">mode</strong>>] [--auth <alias>] [--open-browser <flag>]</pre> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="now-sdk-deploy-command__table_xh2_5hs_rzb" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 13. </span>Optional parameters</span></caption><colgroup><col /><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1547">Parameter</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1550">Type</th><th class="entry nocellnorowborder" style="vertical-align:top;" id="d530390e1553">Description</th><th class="entry cell-norowborder" style="vertical-align:top;" id="d530390e1556">Default value</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1547 "><span class="ph">--source</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1550 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1553 ">The path to the <span class="ph filepath">package.json</span> file for your application. <p class="p">The <span class="ph filepath">package.json</span> should be in the base directory of your application.</p> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1556 "><span class="ph">Current working directory</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1547 "><span class="ph">--mode</span>, <span class="ph">-m</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1550 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1553 ">An option for how to deploy the application.<ul class="ul" id="now-sdk-deploy-command__ul_dpd_k3s_rzb"><li class="li">complete: Deploy the entire application.</li><li class="li">reinstall: Uninstall and reinstall the application on the instance to ensure that the metadata on the instance matches the metadata in the deployment package. <div class="note warning"><span class="warningtitle">Warning:</span> Metadata that is on the instance but not in your local application is removed.</div> </li><li class="li">incremental: Deploy only changes to the application metadata since your last deploy.</li></ul> </td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1556 ">incremental</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1547 "><span class="ph">--auth</span>, <span class="ph">-a</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1550 ">String</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1553 "><span class="ph">An alias for the credentials to use to authenticate to the instance.</span></td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1556 "><span class="ph">If set, the default alias.</span></td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1547 "><span class="ph">--open-browser</span>, <span class="ph">b</span></td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1550 ">Boolean</td><td class="entry nocellnorowborder" style="vertical-align:top;" headers="d530390e1553 "><span class="ph">An option to open the application record (sys_app) in your default browser after successfully deploying the application.</span></td><td class="entry cell-norowborder" style="vertical-align:top;" headers="d530390e1556 ">false</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1547 ">--info, -i</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1550 ">Boolean</td><td class="entry row-nocellborder" style="vertical-align:top;" headers="d530390e1553 ">An option to return details about the most recent deployment of this application, such as the status and records updated. When this parameter is used, the application isn’t deployed.</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d530390e1556 ">false</td></tr></tbody></table> </div> <div class="p">For example: <pre class="pre codeblock language-cmd">now-sdk deploy --auth devuser1 --source /<strong class="hl-keyword">path</strong>/to/package --<strong class="hl-keyword">mode</strong> inc<em class="hl-comment">remental --open-browser true</em></pre></div> </div> </div> </div> </div> </body></html></div>