1--- 2layout: "docs" 3page_title: "Commands: Services" 4sidebar_current: "docs-commands-services" 5--- 6 7# Consul Agent Services 8 9Command: `consul services` 10 11The `services` command has subcommands for interacting with Consul services 12registered with the [local agent](/docs/agent/basics.html). These provide 13useful commands such as `register` and `deregister` for easily registering 14services in scripts, dev mode, etc. 15To view all services in the catalog, instead of only agent-local services, 16see the [`catalog services`](/docs/commands/catalog/services.html) command. 17 18## Usage 19 20Usage: `consul services <subcommand>` 21 22For the exact documentation for your Consul version, run `consul services -h` to 23view the complete list of subcommands. 24 25```text 26Usage: consul services <subcommand> [options] [args] 27 28 ... 29 30Subcommands: 31 deregister Deregister services with the local agent 32 register Register services with the local agent 33``` 34 35For more information, examples, and usage about a subcommand, click on the name 36of the subcommand in the sidebar. 37 38## Basic Examples 39 40To create a simple service: 41 42```text 43$ consul services register -name=web 44``` 45 46To create a service from a configuration file: 47 48```text 49$ cat web.json 50{ 51 "Service": { 52 "Name": "web" 53 } 54} 55 56$ consul services register web.json 57``` 58 59To deregister a service: 60 61```sh 62# Either style works: 63$ consul services deregister web.json 64 65$ consul services deregister -id web 66``` 67