1. Configure your PATH to access Puppet commands

Puppet's command line interface (CLI) consists of a single Puppet command with many subcommands, for example puppet --help.

Puppet commands are located in the bin directory — /opt/puppetlabs/bin/ on *nix and C:\Program Files\Puppet Labs\puppet\bin on Windows. The bin directory is not in your PATH environment variable by default. To have access to the Puppet commands, you must add the bin directory to your PATH.

Choose from the following options.

Linux: source a script for puppet-agent to install

If you are on Linux, you can source a script that puppet-agent installs. Run the following command:

source /etc/profile.d/puppet-agent.sh

*nix: Add the Puppet labs bin directory to your PATH

To add the bin directory to your PATH on *nix, run:

export PATH=/opt/puppetlabs/bin:$PATH
Alternatively, you can add this location wherever you configure your PATH, such as your .profile or .bashrc configuration files.

Windows: Add the Puppet labs bin directory to your PATH

To run Puppet commands on Windows, start a command prompt with administrative privileges. You can do so by right-clicking the Start Command Prompts with Puppet program and clicking Run as administrator. Click Yes if the system asks for UAC confirmation.

The Puppet agent .msi adds the Puppet bin directory to the system path automatically. If you are not using the Start Command Prompts, you may need to manually add the bin directory to your PATH using one of the following commands:

For cmd.exe, run:

set PATH=%PATH%;"C:\Program Files\Puppet Labs\Puppet\bin"

For PowerShell, run:

 $env:PATH += ";C:\Program Files\Puppet Labs\Puppet\bin"