Foreman CLI

Note: ForemanCLI is currently depreciated in favor of Hammer, the new command line tool.
You can find informations regarding Hammer here :

For ForemanCLI, see: export:extras/cli/foremancli


foremancli -h


gem install foremancli

Environment Variables

  • FOREMAN_SERVER Foreman Server URL
  • FOREMAN_USER Foreman user
  • FOREMAN_PASSWORD Foreman password

Note: Currently supports read-only API queries


gem install rest-client json


Support for RHEL/CentOS5 can be accomplished in three ways:

  1. gem install json_pure (slower since it is a pure ruby gem)
  2. yum install rubygem-json (installs an older version of the json gem, but it doesn't hit this bug).
  3. upgrade ruby to 1.8.7

This works around a broken interaction between Ruby 1.8.5 and the native json gem version 1.6.1

Specfile info

Name: foreman-cli
Version: 0.4
License: GPLv2+
Requires: ruby(abi) = 1.8
Requires: rubygems
Requires: rubygem(rest-client)
Requires: rubygem(json)

The binary name is foremancli, and should be installed in the default path somewhere.)