2019-05-01 18:21:11 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-06 20:27:35 +00:00
|
|
|
page_title: 'Commands: Config'
|
2019-05-01 18:21:11 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul Config
|
|
|
|
|
|
|
|
Command: `consul config`
|
|
|
|
|
|
|
|
The `config` command is used to interact with Consul's central configuration
|
2019-05-08 20:19:37 +00:00
|
|
|
system. It exposes commands for creating, updating, reading, and deleting
|
2019-05-01 18:21:11 +00:00
|
|
|
different kinds of config entries. See the
|
2022-03-15 23:13:58 +00:00
|
|
|
[agent configuration](/docs/agent/options#enable_central_service_config)
|
2019-05-08 20:19:37 +00:00
|
|
|
for more information on how to enable this functionality for centrally
|
2020-10-14 15:23:05 +00:00
|
|
|
configuring services and [configuration entries docs](/docs/agent/config-entries) for a description
|
2019-05-08 20:19:37 +00:00
|
|
|
of the configuration entries content.
|
2019-05-01 18:21:11 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul config <subcommand>`
|
|
|
|
|
|
|
|
For the exact documentation for your Consul version, run `consul config -h` to view
|
|
|
|
the complete list of subcommands.
|
|
|
|
|
|
|
|
```text
|
|
|
|
Usage: consul config <subcommand> [options] [args]
|
|
|
|
|
|
|
|
This command has subcommands for interacting with Consul's centralized
|
|
|
|
configuration system. Here are some simple examples, and more detailed
|
|
|
|
examples are available in the subcommands or the documentation.
|
|
|
|
|
|
|
|
Write a config:
|
|
|
|
|
|
|
|
$ consul config write web.serviceconf.hcl
|
|
|
|
|
|
|
|
Read a config:
|
|
|
|
|
|
|
|
$ consul config read -kind service-defaults -name web
|
|
|
|
|
|
|
|
List all configs for a type:
|
|
|
|
|
|
|
|
$ consul config list -kind service-defaults
|
|
|
|
|
|
|
|
Delete a config:
|
|
|
|
|
|
|
|
$ consul config delete -kind service-defaults -name web
|
|
|
|
|
|
|
|
For more examples, ask for subcommand help or view the documentation.
|
|
|
|
```
|
|
|
|
|
|
|
|
For more information, examples, and usage about a subcommand, click on the name
|
2020-04-06 20:27:35 +00:00
|
|
|
of the subcommand in the sidebar.
|