ServiceNow CLI のヘルプ

  • リリースバージョン: Zurich
  • 更新日 2025年07月31日
  • 所要時間:3分
  • 利用可能なコマンド、コマンドオプション、例を表示するか、デバッグログ出力を生成します。

    始める前に

    このタスクについて

    デバッグログ出力オプションに加えて、CLI は次の場所にあるログファイルにすべてのコマンド実行を記録します。

    • Linux および Mac: ~/.snc/.logs
    • Windows:%USERprofile%\.snc\.logs

    手順

    1. 利用可能なコマンドと引数を表示するには、システムのコマンドラインツールを開き、ヘルプを参照したいコマンドを入力し、続けて --help 引数を指定します。

      次の例では、使用可能なトップレベルのコマンドのヘルプを表示しています。

      $ snc --help

      次の例では、使用可能なプロファイル固有のコマンドを表示しています。

      $ snc configure profile --help

      CLI は、要求されたコマンドのヘルプを 8 つのセクションに分割して表示します。

      名前

      コマンドの名前。

      Name
           set
      説明

      コマンドの実行内容とその戻り値の説明。

      Description
           Configure connection profiles. This command is interactive and will prompt you for each configuration value.
      概要

      コマンドとそのオプションを使用するための基本的な構文。

      Synopsis
           snc configure profile set [arguments]
      利用可能なコマンド

      現在のコマンドグループで使用可能なコマンド。

      Available Commands
       list    : Lists the configured connection profiles.
       refresh : Updates the available commands from the instance for the given profile.
       remove  : Removes the specified connection profile.
       set     : Configures connection profiles in order to communicate with an instance.
      コマンドグループ

      現在のコマンドグループで使用可能なコマンドグループ。

      Command Groups
           profile : Set, view, and remove connection profiles.
      引数

      コマンドが受け入れる各引数の説明。

      Arguments
           -p, --profile string : Use a specific connection profile when executing a command.
      グローバル引数

      コマンドが受け入れるグローバル引数。

      Global Arguments
           -d, --debug Print logs to console.
           -h, --help Display detailed help information.
           -o, --output string Set the format for printing command output.

      要求されるコマンドの例。

      Examples
         Create a new profile to save as the default:
            $ snc configure profile set
               Host:
               Login method:
               Username:
               Password:
               Client id:
               Client secret:
    2. デバッグログ出力を生成するには、システムのコマンドラインツールを開き、デバッグするコマンドに続けて --debug 引数を入力します。

      次の例では、操作を実行しようとすると、デバッグログ出力が生成されます。

      $ snc record delete --table incident --sysid 552c48888c033300964f4932b03eb092 --debug
      CLI は、コマンドを実行するとデバッグログ出力を生成します。