このコンテンツは選択した言語では利用できません。

Chapter 2. Getting Started with the Management CLI


The management CLI is included with the JBoss EAP distribution. Once you launch the management CLI, you can connect to a running server instance or managed domains to perform management operations.

2.1. Launch the Management CLI

You can launch the management CLI by running the jboss-cli script provided with JBoss EAP.

$ EAP_HOME/bin/jboss-cli.sh
Copy to Clipboard Toggle word wrap
Note

For Windows Server, use the EAP_HOME\bin\jboss-cli.bat script to launch the management CLI.

See Connect to the Server for details on launching the management CLI and connecting to the server in one step using the --connect argument.

Important

The jboss-cli scripts set the com.ibm.jsse2.overrideDefaultTLS property to true. This setting is important if you are using the IBM JDK to prevent authentication issues when using SSL configured by Elytron.

Be sure to set this property if you are using the IBM JDK and using another method to start a CLI session, for example, programmatically using the classes available in EAP_HOME/bin/client/jboss-cli-client.jar.

For a complete listing of all available jboss-cli script arguments and their purposes, use the --help argument or see the Management CLI Startup Arguments section.

2.2. Connect to the Server

You can connect to a running standalone server or managed domain by using the connect command.

connect
Copy to Clipboard Toggle word wrap

The default host and port configuration is localhost:9990. If the server is listening on a different host and port, then these need to be provided to the connect command.

connect 192.168.0.1:9991
Copy to Clipboard Toggle word wrap

You can also launch the management CLI and connect to the server in one step using the --connect argument (and the --controller argument if necessary).

$ EAP_HOME/bin/jboss-cli.sh --connect --controller=192.168.0.1:9991
Copy to Clipboard Toggle word wrap

In JBoss EAP 7.3, to connect using the http-remoting protocol, use:

connect http-remoting://192.168.0.1:9990
Copy to Clipboard Toggle word wrap

2.3. Getting Help

The management CLI provides several ways for you to get help with using the management CLI.

  • View general help on using the management CLI.

    help
    Copy to Clipboard Toggle word wrap

    This provides detailed help with launching, navigating, and generating operation requests.

  • View help for a particular command or operation:

    help COMMAND_OR_OPERATION
    Copy to Clipboard Toggle word wrap

    This provides the usage, description, and arguments for the particular command or operation.

    For example:

    • View help for the patch command:

      help patch
      Copy to Clipboard Toggle word wrap
    • View help for the apply action of the patch command:

      help patch apply
      Copy to Clipboard Toggle word wrap
    • View help for the Elytron key-store resource add operation:

      help /subsystem=elytron/key-store=?:add
      Copy to Clipboard Toggle word wrap
  • View the list of available commands in the current context:

    help --commands
    Copy to Clipboard Toggle word wrap
    Note

    Commands that require a connection to either a standalone server or domain controller do not appear in the list unless the connection has been established.

See the Management CLI Commands section for a listing of management CLI commands.

2.4. Quit the Management CLI

You can quit the management CLI by entering the quit command.

quit
Copy to Clipboard Toggle word wrap

2.5. Run in Non-Interactive Mode

You can issue management CLI commands without launching and interacting with the management CLI. This is useful for processing batches of commands and executing commands from scripts. You can either pass in the commands or pass in a file that contains commands to the jboss-cli startup script.

Pass in Commands

You can use the --command argument to provide a single CLI command to execute. The management CLI will terminate once the commands have completed.

$ EAP_HOME/bin/jboss-cli.sh --connect --command="/interface=public:read-attribute(name=inet-address,resolve-expressions=true)"
Copy to Clipboard Toggle word wrap

The output from each command provided is displayed as it executes.

{
    "outcome" => "success",
    "result" => "127.0.0.1"
}
Copy to Clipboard Toggle word wrap

You can also use the --commands argument to provide a comma-separated list of CLI commands to execute.

Pass in a File of Commands

You can use the --file argument to pass in a text file of CLI commands to execute, with each command on a separate line in the file.

$ EAP_HOME/bin/jboss-cli.sh --connect --file=/path/to/cli_commands.txt
Copy to Clipboard Toggle word wrap

The output from each command in the file is displayed as it executes.

Example Output

{
    "outcome" => "success",
    "result" => "NORMAL"
}
helloworld.war
Copy to Clipboard Toggle word wrap

Note

You can include comments in a CLI script to aid understanding and maintenance. Comments are denoted by a pound sign (#) at the beginning of the line. While executing the script, JBoss EAP ignores the comments you included.

You can use the --echo-command argument to include the prompt and command with the output. This can be useful when resolving failures by matching the output to the command that was executed.

$ EAP_HOME/bin/jboss-cli.sh --connect --file=/path/to/cli_commands.txt --echo-command
Copy to Clipboard Toggle word wrap

The command and its output are displayed as it executes.

Example Output With Command Echo

[standalone@localhost:9990 /] :read-attribute(name=running-mode)
{
    "outcome" => "success",
    "result" => "NORMAL"
}
[standalone@localhost:9990 /] ls /deployment
helloworld.war
Copy to Clipboard Toggle word wrap

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat