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

> Auth0 CLI を使用してテナント設定を管理し、タスクを自動化し、Auth0 を開発およびデプロイのワークフローに統合する方法について説明します。

# Auth0 CLI

<Card title="開始前に">
  [Auth0 テナント](https://manage.auth0.com/)を設定します。
</Card>

[Auth0 CLI](https://github.com/auth0/auth0-cli) は、Auth0 Management API に直接アクセスできるコマンドラインツールで、ターミナルから Auth0 テナントを管理できます。開発時に対話的に使用することを想定して設計されており、自動化のためにスクリプトに組み込むこともできます。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  CLI コマンドの完全なリファレンスと詳細な利用方法については、[Auth0 CLI Reference Documentation](https://auth0.github.io/auth0-cli/) をご覧ください。
</Callout>

<div id="key-features">
  ## 主な機能
</div>

* **対話形式の管理**: コマンドラインから Auth0 リソースを作成、更新、管理
* **認証サポート**: ユーザーログインや machine-to-machine の資格情報を含む、複数の認証方法に対応
* **リソース管理**: アプリケーション、API、接続、ユーザーなどに対する完全な CRUD 操作
* **クロスプラットフォーム**: macOS、Linux、Windows で利用可能
* **JSON 出力**: スクリプト作成や自動化に適した機械可読な出力

<div id="use-cases">
  ## 利用例
</div>

Auth0 CLIは、次のような用途に最適です。

* **開発ワークフロー**: 開発中にAuth0リソースをすばやくセットアップして設定する
* **テスト**: 自動テスト用のテストアプリケーションやユーザーを作成する
* **デバッグ**: Auth0の設定をリアルタイムで確認・変更する
* **スクリプト作成**: シェルスクリプトを使って繰り返し作業を自動化する
* **CI/CD連携**: Auth0の設定をデプロイパイプラインに組み込む

<div id="comparison-with-other-tools">
  ## 他のツールとの比較
</div>

<div id="auth0-cli-vs-deploy-cli">
  ### Auth0 CLI と Deploy CLI
</div>

* **Auth0 CLI**: 対話形式で、コマンドごとにリソースを管理します。開発や一時的な作業に最適です。
* **[Deploy CLI](/docs/ja-jp/deploy-monitor/deploy-cli-tool)**: 宣言型で、設定ファイルベースのテナント管理を行います。環境をまたいでテナント全体の構成を管理するのに最適です。

<div id="auth0-cli-vs-terraform-provider">
  ### Auth0 CLI と Terraform Provider
</div>

* **Auth0 CLI**: 変更をすぐに反映するための命令型コマンド。状態管理は行いません。
* **Terraform Provider**: 状態を追跡する宣言型のインフラストラクチャ as code。Production 環境のインフラストラクチャ管理に最適です。

<div id="install-auth0-cli">
  ## Auth0 CLI のインストール
</div>

<div id="macos">
  ### macOS
</div>

Homebrew を使って設定します。

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

<div id="linux">
  ### Linux
</div>

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

<div id="windows">
  ### Windows
</div>

Scoop を使って設定します:

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

または、[GitHubのリリースページ](https://github.com/auth0/auth0-cli/releases)から最新版をダウンロードしてください。

<div id="authenticate">
  ## 認証
</div>

Auth0 CLI を使用するには、認証が必要です。次のコマンドを実行すると、Auth0 アカウントにログインするためのブラウザーウィンドウが開きます。

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

Machine-to-Machine アプリケーションで認証するには、次のコマンドを使用します：

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

<div id="common-commands">
  ## よく使うコマンド
</div>

<div id="manage-applications">
  ### アプリケーションの管理
</div>

```bash lines theme={null}
# すべてのアプリケーションを一覧表示する
auth0 apps list

# 新しいアプリケーションを作成する
auth0 apps create --name "My App" --type spa

# アプリケーションの詳細を表示する
auth0 apps show <app-id>

# アプリケーションを更新する
auth0 apps update <app-id> --callbacks "http://localhost:3000/callback"

# アプリケーションを削除する
auth0 apps delete <app-id>
```

<div id="manage-apis">
  ### APIの管理
</div>

```bash lines theme={null}
# すべてのAPIを一覧表示する
auth0 apis list

# 新しいAPIを作成する
auth0 apis create --name "My API" --identifier "https://my-api.example.com"

# APIの詳細を表示する
auth0 apis show <api-id>
```

<div id="manage-users">
  ### ユーザー管理
</div>

```bash lines theme={null}
# ユーザーを一覧表示する
auth0 users list

# ユーザーの作成
auth0 users create --email "user@example.com" --connection "Username-Password-Authentication"

# ユーザーの詳細を表示する
auth0 users show <user-id>

# ユーザーを更新
auth0 users update <user-id> --email "newemail@example.com"
```

<div id="manage-tenant-settings">
  ### テナント設定の管理
</div>

```bash lines theme={null}
# 現在のテナントを表示
auth0 tenants list

# テナント設定を更新
auth0 tenants-settings update set [flags]
```

<div id="using-in-scripts">
  ## スクリプトでの使用
</div>

Auth0 CLI は、スクリプトで簡単にパースできる JSON 出力をサポートしています。

```bash lines theme={null}
# アプリケーションの詳細をJSONとして取得する
auth0 apps show <app-id> --json

# アプリを作成して出力をキャプチャする
auth0 apps create --name "My App" --type spa --json > app-details.json
```

<div id="documentation-and-support">
  ## ドキュメントとサポート
</div>

完全なドキュメント、コマンドリファレンス、使用例については、以下をご覧ください。

* [Auth0 CLI GitHub Repository](https://github.com/auth0/auth0-cli)
* [Auth0 CLI ドキュメント](https://auth0.github.io/auth0-cli/)

<div id="next-steps">
  ## 次のステップ
</div>

<Columns cols={3}>
  <Card title="Deploy CLI" href="/docs/ja-jp/deploy-monitor/deploy-cli-tool" icon="rocket">
    Deploy CLI を使用したテナント設定の管理について学ぶ
  </Card>

  <Card title="Terraform Provider" href="/docs/ja-jp/deploy-monitor/auth0-terraform-provider" icon="code">
    Terraform による infrastructure-as-code を確認する
  </Card>

  <Card title="Management API" href="/docs/ja-jp/api/management/v2" icon="code-branch">
    Auth0 Management API に直接アクセスする
  </Card>
</Columns>
