1---
2layout: "docs"
3page_title: "Authentication - Terraform CLI"
4description: "Documentation about the login and logout commands that help automate getting an API token for your Terraform Cloud account."
5---
6
7# CLI Authentication
8
9> **Hands-on:** Try the [Authenticate the CLI with Terraform Cloud](https://learn.hashicorp.com/tutorials/terraform/cloud-login?in=terraform/cloud&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn.
10
11[Terraform Cloud](/docs/cloud/index.html) and
12[Terraform Enterprise](/docs/enterprise/index.html) are platforms that perform
13Terraform runs to provision infrastructure, offering a collaboration-focused
14environment that makes it easier for teams to use Terraform together. (For
15expediency, the content below refers to both products as "Terraform Cloud.")
16
17Terraform CLI integrates with Terraform Cloud in several ways — it can be a
18front-end for [CLI-driven runs](/docs/cloud/run/cli.html) in Terraform Cloud,
19and can also use Terraform Cloud as a state backend and a private module
20registry. All of these integrations require you to authenticate Terraform CLI
21with your Terraform Cloud account.
22
23The best way to handle CLI authentication is with the `login` and `logout`
24commands, which help automate the process of getting an API token for your
25Terraform Cloud user account.
26
27For details, see:
28
29- [The `terraform login` command](/docs/cli/commands/login.html)
30- [The `terraform logout` command](/docs/cli/commands/logout.html)
31