1---
2layout: "docs"
3page_title: "Commands: Intention"
4sidebar_current: "docs-commands-intention"
5---
6
7# Consul Intention
8
9Command: `consul intention`
10
11The `intention` command is used to interact with Connect
12[intentions](/docs/connect/intentions.html). It exposes commands for
13creating, updating, reading, deleting, checking, and managing intentions.
14This command is available in Consul 1.2 and later.
15
16Intentions may also be managed via the [HTTP API](/api/connect/intentions.html).
17
18## Usage
19
20Usage: `consul intention <subcommand>`
21
22For the exact documentation for your Consul version, run `consul intention -h` to view
23the complete list of subcommands.
24
25```text
26Usage: consul intention <subcommand> [options] [args]
27
28  ...
29
30Subcommands:
31    check     Check whether a connection between two services is allowed.
32    create    Create intentions for service connections.
33    delete    Delete an intention.
34    get       Show information about an intention.
35    match     Show intentions that match a source or destination.
36```
37
38For more information, examples, and usage about a subcommand, click on the name
39of the subcommand in the sidebar.
40
41## Basic Examples
42
43Create an intention to allow "web" to talk to "db":
44
45    $ consul intention create web db
46
47Test whether a "web" is allowed to connect to "db":
48
49    $ consul intention check web db
50
51Find all intentions for communicating to the "db" service:
52
53    $ consul intention match db
54
55