> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth0 CLI

> Learn how to use Auth0 CLI to manage your tenant configuration, automate tasks, and integrate Auth0 into your development and deployment workflows.

> [card] Before you start
>
> Set up an [Auth0 Tenant](https://manage.auth0.com/).

[Auth0 CLI](https://github.com/auth0/auth0-cli) is a command-line tool that provides direct access to the Auth0 Management API, enabling you to manage your Auth0 tenant from your terminal. It's designed for interactive use during development and can be integrated into scripts for automation.

For complete CLI command reference and detailed usage information, read [Auth0 CLI Reference Documentation](https://auth0.github.io/auth0-cli/).

## Key Features

* **Interactive Management**: Create, update, and manage Auth0 resources from the command line
* **Authentication Support**: Multiple authentication methods including user login and machine-to-machine credentials
* **Resource Management**: Full CRUD operations for applications, APIs, connections, users, and more
* **Cross-Platform**: Available for macOS, Linux, and Windows
* **JSON Output**: Machine-readable output for scripting and automation

## Use Cases

Auth0 CLI is ideal for:

* **Development Workflows**: Quickly set up and configure Auth0 resources during development
* **Testing**: Create test applications and users for automated testing
* **Debugging**: Inspect and modify Auth0 configuration in real-time
* **Scripting**: Automate repetitive tasks with shell scripts
* **CI/CD Integration**: Integrate Auth0 configuration into your deployment pipelines

## Comparison with Other Tools

### Auth0 CLI vs Deploy CLI

* **Auth0 CLI**: Interactive, command-by-command resource management. Best for development and ad-hoc tasks.
* **[Deploy CLI](/docs/docs/deploy-monitor/deploy-cli-tool)**: Declarative, configuration-file-based tenant management. Best for managing entire tenant configurations across environments.

### Auth0 CLI vs Terraform Provider

* **Auth0 CLI**: Imperative commands for immediate changes. No state management.
* **Terraform Provider**: Declarative infrastructure-as-code with state tracking. Best for production infrastructure management.

## Install Auth0 CLI

### macOS

Configure with Homebrew:

```bash lines theme={null}
brew install auth0
```

### Linux

```bash lines theme={null}
curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b /usr/local/bin
```

### Windows

Configure with Scoop:

```powershell lines theme={null}
scoop bucket add auth0 https://github.com/auth0/scoop-auth0-cli.git
scoop install auth0
```

Or download the latest release from the [GitHub releases page](https://github.com/auth0/auth0-cli/releases).

### Install the beta build

The beta build has features that aren't in the stable build yet. On macOS and Linux, install it with Homebrew from the Auth0 tap:

```bash lines theme={null}
brew tap auth0/auth0-cli && brew install auth0-beta
```

On Windows, install it with Scoop:

```powershell lines theme={null}
scoop bucket add auth0 https://github.com/auth0/scoop-auth0-cli.git
scoop install auth0-beta
```

Both install the beta build as the `auth0` binary. To install without a package manager, download the latest pre-release from the [GitHub releases page](https://github.com/auth0/auth0-cli/releases).

The beta build doesn't fully support logging in as a user with the device authorization flow. Authenticate with a machine-to-machine application instead.

## Authenticate

To use the Auth0 CLI, you need to authenticate. When you run the following command, a browser window opens for you to log in to your Auth0 account:

```bash lines theme={null}
auth0 login
```

To authenticate with a machine-to-machine application, use the following command:

```bash lines theme={null}
auth0 login --domain <your-domain> --client-id <client-id> --client-secret <client-secret>
```

## Common Commands

### Manage Applications

```bash lines theme={null}
# List all applications
auth0 apps list

# Create a new application
auth0 apps create --name "My App" --type spa

# Show application details
auth0 apps show <app-id>

# Update an application
auth0 apps update <app-id> --callbacks "http://localhost:3000/callback"

# Delete an application
auth0 apps delete <app-id>
```

### Manage APIs

```bash lines theme={null}
# List all APIs
auth0 apis list

# Create a new API
auth0 apis create --name "My API" --identifier "https://my-api.example.com"

# Show API details
auth0 apis show <api-id>
```

### Manage Users

```bash lines theme={null}
# List users
auth0 users list

# Create a user
auth0 users create --email "user@example.com" --connection "Username-Password-Authentication"

# Show user details
auth0 users show <user-id>

# Update a user
auth0 users update <user-id> --email "newemail@example.com"
```

### Manage Tenant Settings

```bash lines theme={null}
# Show current tenant
auth0 tenants list

# Update tenant settings
auth0 tenants-settings update set [flags]
```

## Using in Scripts

The Auth0 CLI supports JSON output for easy parsing in scripts:

```bash lines theme={null}
# Get application details as JSON
auth0 apps show <app-id> --json

# Create an app and capture the output
auth0 apps create --name "My App" --type spa --json > app-details.json
```

## Using Agent Mode

Agent Mode makes the CLI predictable for an AI agent to drive unattended. Enable it with the `--agent-mode` flag or the `AUTH0_AGENT_MODE` environment variable:

```bash lines theme={null}
auth0 apps list --agent-mode
```

```bash lines theme={null}
AUTH0_AGENT_MODE=true auth0 apps list
```

Agent Mode turns on structured JSON output, disables interactive prompts and color, and guarantees a non-zero exit code on any failure. You don't have to set it explicitly in most cases — the CLI detects when it isn't talking to an interactive terminal (for example, when run by Claude Code, Cursor, or a CI job) and applies the same behavior automatically.

Agent Mode defaults to indented JSON output. For high-volume or token-sensitive workflows, pass `--json-compact` to get the same data without the extra whitespace:

```bash lines theme={null}
auth0 apps list --agent-mode --json-compact
```

Streaming commands, such as `auth0 logs tail`, always use the compact form in Agent Mode.

### Discover the command surface

An agent can map the entire CLI in a single call instead of working through `--help` one level at a time:

```bash lines theme={null}
auth0 commands --flat
```

Add `--detailed` to include flags, arguments, defaults, and whether authentication is required for each command.

### Check a payload shape before sending it

`--schema` prints the request payload a command expects, sourced from the OpenAPI spec:

```bash lines theme={null}
auth0 apps create --schema
```

`--data` sends the payload as one JSON object and validates it locally before the request reaches the API:

```bash lines theme={null}
# Using inline JSON:
auth0 apps create --data '{"name":"My App","app_type":"spa"}'

# Using JSON from a file:
auth0 apps create --data @app.json

# Using JSON piped through `stdin`
jq .example app.json | auth0 apps create
```

### Structured errors

Every failure in Agent Mode returns a JSON error envelope instead of a plain-text message:

```json theme={null}
{
  "error": {
    "code": "validation",
    "reason": "local_validation",
    "message": "...",
    "details": [
      {
        "field": "name",
        "reason": "property \"name\" is missing"
      }
    ]
  }
}
```

The `error` object contains:

* `code`, the class of failure. The full set of values is `usage`, `auth`, `validation`, `not_found`, `rate_limit`, `conflict`, `network`, `api`, and `unknown` (the fallback when nothing more specific applies).
* `reason`, a more specific class of failure. The set of possible `reason` values is not exhaustive — it grows as the CLI adds finer-grained failure detail — so treat `code` as the stable contract and `reason` as additional context.
* `details`, field-level information when a payload fails validation.

An agent can branch on these values instead of parsing a sentence.

### Search documentation from the terminal

`auth0 docs search` queries Auth0's public documentation without leaving the terminal and without requiring authentication:

```bash lines theme={null}
auth0 docs search "organizations"
```

In Agent Mode, results include raw-markdown URLs an agent can fetch directly.

## Documentation and Support

For complete documentation, command reference, and examples, visit:

* [Auth0 CLI GitHub Repository](https://github.com/auth0/auth0-cli)
* [Auth0 CLI Documentation](https://auth0.github.io/auth0-cli/)

## Next Steps

> [card] [Deploy CLI](/docs/docs/deploy-monitor/deploy-cli-tool)
>
> Learn about managing tenant configuration with the Deploy CLI

> [card] [Terraform Provider](/docs/docs/deploy-monitor/auth0-terraform-provider)
>
> Explore infrastructure-as-code with Terraform

> [card] [Management API](/docs/docs/api/management/v2)
>
> Access the Auth0 Management API directly
