github.com/smintz/nomad@v0.8.3/website/source/docs/commands/index.html.md.erb (about) 1 --- 2 layout: "docs" 3 page_title: "Commands (CLI)" 4 sidebar_current: "docs-commands" 5 description: > 6 Nomad can be controlled via a command-line interface. This page documents all 7 the commands Nomad accepts. 8 --- 9 10 # Nomad Commands (CLI) 11 12 Nomad is controlled via a very easy to use command-line interface (CLI). 13 Nomad is only a single command-line application: `nomad`, which 14 takes a subcommand such as "agent" or "status". The complete list of 15 subcommands is in the navigation to the left. 16 17 The Nomad CLI is a well-behaved command line application. In erroneous cases, 18 a non-zero exit status will be returned. It also responds to `-h` and `--help` 19 as you would most likely expect. 20 21 To view a list of the available commands at any time, just run Nomad 22 with no arguments. To get help for any specific subcommand, run the subcommand 23 with the `-h` argument. 24 25 Each command has been conveniently documented on this website. Links to each 26 command can be found on the left. 27 28 ### Autocomplete 29 30 Nomad's CLI supports command autocomplete. Autocomplete can be installed or 31 uninstalled by running the following on bash or zsh shells: 32 33 ``` 34 $ nomad -autocomplete-install 35 $ nomad -autocomplete-uninstall 36 ``` 37 38 ### Command Contexts 39 40 Nomad's CLI commands have implied contexts in their naming convention. Because 41 the CLI is most commonly used to manipulate or query jobs, you can assume that 42 any given command is working in that context unless the command name implies 43 otherwise. 44 45 For example, the `nomad job run` command is used to run a new job, the `nomad 46 status` command queries information about existing jobs, etc. Conversely, 47 commands with a prefix in their name likely operate in a different context. 48 Examples include the `nomad agent-info` or `nomad node drain` commands, 49 which operate in the agent or node contexts respectively. 50 51 ### Remote Usage 52 53 The Nomad CLI may be used to interact with a remote Nomad cluster, even when the 54 local machine does not have a running Nomad agent. To do so, set the 55 `NOMAD_ADDR` environment variable or use the `-address=<addr>` flag when running 56 commands. 57 58 ``` 59 $ NOMAD_ADDR=https://remote-address:4646 nomad status 60 $ nomad status -address=https://remote-address:4646 61 ``` 62 63 The provided address must be reachable from your local machine. There are a 64 variety of ways to accomplish this (VPN, SSH Tunnel, etc). If the port is 65 exposed to the public internet it is highly recommended to configure TLS.