Show Table of Contents
Chapter 22. Command Line Reference
hammer is the CLI management tool for Red Hat Satellite functionality. It can:
- Provision hosts.
- Edit the attributes of a resource or group.
- Interact and manipulate hosts, capsules and domains.
hammer can be executed on the command line through its parameters and options or through the interactive shell. To invoke the shell:
Example 22.1. Invoking the hammer Shell
[root@satellite.example.com ~]# hammer shell Welcome to the hammer interactive shell Type 'help' for usage information Command completion is disabled on ruby < 1.9 due to compatibility problems. hammer> organization list ---|------------------|------------------|------------------------------ ID | NAME | LABEL | DESCRIPTION ---|------------------|------------------|------------------------------ 1 | ACME_Corporation | ACME_Corporation | ACME_Corporation Organization 3 | Test Corp | Test_Corp | ---|------------------|------------------|------------------------------ hammer>
The full list of options and subcommands are available in the help file:
# hammer -h
22.1. Configuring hammer
By default, if you run
hammer from the command line, you need to enter your credentials for each operation. To avoid this, you can either use hammer shell as described in Example 22.1, “Invoking the hammer Shell” or you can create a configuration file in your home directory with your login credentials.
Important
Saving credentials in plain text files is a potential security risk. Take the necessary precautions to ensure your passwords and other sensitive information are protected.
Procedure 22.1. To Configure hammer to Use Saved Credentials:
- Create a
~/.hammer/cli_config.ymlfile if it does not already exist. - Add the following contents to the file. Ensure you replace the example values with your own details.
:foreman: :host: 'https://satellite.example.com/' :username: 'admin' :password: 'changeme' - Save and close the file. Now when you run
hammerit should not prompt you for your credentials.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.