Soracom

Users

開発者向けツール
Home 開発者向けツール SORACOM CLI 利用ガイド リファレンス

SORACOM CLI のヘルプを表示する

SORACOM CLI を実行するときに --help フラグまたは -h フラグを指定すると、ヘルプを確認できます。

ここでは、soracom sims list コマンドの使いかたを調べる操作を紹介します。

  1. soracom --help を実行します。

    soracom [command] のヘルプが表示されます。Available Commands:Flags: は、soracom [command][command] に指定できる文字列と、その説明です。

    $ soracom --help
    A command line tool to invoke SORACOM API
    
    Usage:
      soracom [command]
    
    Available Commands:
        :
      sims                 Manage SIMs.
        :
    
    Flags:
          --api-key string         Specify API key otherwise soracom-cli performs authentication on behalf of you
            :
    
    Use "soracom [command] --help" for more information about a command.
    

    この表示から、[command]sims--api-key が指定できることがわかります。

  2. soracom sims --help を実行します。

    soracom sims [command] のヘルプが表示されます。Available Commands:Flags:、および Global Flags: は、soracom sims [command][command] に指定できる文字列と、その説明です。

    $ soracom sims --help
    Manage SIMs.
    
    Usage:
      soracom sims [command]
    
    Available Commands:
        :
      list                                   List SIMs.
        :
    
    Flags:
      -h, --help   help for sims
    
    Global Flags:
          --api-key string         Specify API key otherwise soracom-cli performs authentication on behalf of you
            :
    
    Use "soracom sims [command] --help" for more information about a command.
    

    この表示から、[command]list--api-key が指定できることがわかります。

  3. soracom sims list --help を実行します。

    soracom sims list [flags] のヘルプが表示されます。Flags: および Global Flags: は、soracom sims list [flags][flags] に指定できる文字列と、その説明です。

    $ soracom sims list --help
    Returns a list of SIMs that match certain criteria. If the total number of SIMs does not fit in one page, a URL for accessing the next page is returned in the 'Link' header of the response.
    
    Usage:
      soracom sims list [flags]
    
    Flags:
          --fetch-all                   Do pagination automatically.
      -h, --help                        help for list
            :
    
    Global Flags:
          --api-key string         Specify API key otherwise soracom-cli performs authentication on behalf of you
            :
    

    この表示から、[flag]--fetch-all--api-key などが指定できることがわかります。

Windows で SORACOM CLI を利用する場合の注意

リクエストボディに JSON を指定するときは、JSON の「"」をエスケープしてください。

macOS または Linux でコマンドを実行する例と、Windows のコマンドプロンプトおよび PowerShell で実行する例を紹介します。

  • macOS または Linux の例:

    JSON 全体を「'」で囲みます。

    soracom auth verify-password-reset-token --body '{"password": "string", "token": "string"}'
    
  • Windows のコマンドプロンプトの例:

    JSON 全体を「"」で囲み、さらに JSON の「"」を「"""」に置き換えてください。具体的には、以下のように実行します。

    soracom auth verify-password-reset-token --body "{"""password""": """string""", """token""": """string"""}"
    
  • Windows の PowerShell の例:

    JSON 全体を「"」で囲み、さらに JSON の「"」を「\`"」に置き換えてください。具体的には、以下のように実行します。

    soracom auth verify-password-reset-token --body "{\`"password\`": \`"string\`", \`"token\`": \`"string\`"}"