mirror of https://github.com/status-im/consul.git
51 lines
1.6 KiB
Markdown
51 lines
1.6 KiB
Markdown
|
---
|
||
|
layout: "docs"
|
||
|
page_title: "Commands"
|
||
|
sidebar_current: "docs-commands"
|
||
|
---
|
||
|
|
||
|
# Serf Commands (CLI)
|
||
|
|
||
|
Serf is controlled via a very easy to use command-line interface (CLI).
|
||
|
Serf is only a single command-line application: `serf`. This application
|
||
|
then takes a subcommand such as "agent" or "members". The complete list of
|
||
|
subcommands is in the navigation to the left.
|
||
|
|
||
|
The `serf` CLI is a well-behaved command line application. In erroneous
|
||
|
cases, a non-zero exit status will be returned. It also responds to `-h` and `--help`
|
||
|
as you'd most likely expect. And some commands that expect input accept
|
||
|
"-" as a parameter to tell Serf to read the input from stdin.
|
||
|
|
||
|
To view a list of the available commands at any time, just run `serf` with
|
||
|
no arguments:
|
||
|
|
||
|
```
|
||
|
$ serf
|
||
|
usage: serf [--version] [--help] <command> [<args>]
|
||
|
|
||
|
Available commands are:
|
||
|
agent Runs a Serf agent
|
||
|
event Send a custom event through the Serf cluster
|
||
|
force-leave Forces a member of the cluster to enter the "left" state
|
||
|
join Tell Serf agent to join cluster
|
||
|
keygen Generates a new encryption key
|
||
|
leave Gracefully leaves the Serf cluster and shuts down
|
||
|
members Lists the members of a Serf cluster
|
||
|
monitor Stream logs from a Serf agent
|
||
|
version Prints the Serf version
|
||
|
```
|
||
|
|
||
|
To get help for any specific command, pass the `-h` flag to the relevant
|
||
|
subcommand. For example, to see help about the `members` subcommand:
|
||
|
|
||
|
```
|
||
|
$ serf members -h
|
||
|
Usage: serf members [options]
|
||
|
|
||
|
Outputs the members of a running Serf agent.
|
||
|
|
||
|
Options:
|
||
|
|
||
|
-rpc-addr=127.0.0.1:7373 RPC address of the Serf agent.
|
||
|
```
|