> ## 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 CLI

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

Auth0 CLI は、Auth0 Management API に直接アクセスできるコマンドラインツールです。ターミナルから Auth0 テナントを管理でき、開発時のインタラクティブな利用を想定して設計されています。また、自動化のためにスクリプトに組み込むこともできます。

<Callout>
  CLI コマンドの完全なリファレンスと詳細な使用方法については、[Auth0 CLI Reference Documentation](https://auth0.github.io/auth0-cli/)を参照してください。
</Callout>

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

* **対話型管理**: コマンドラインから Auth0 リソースを作成、更新、管理
* **認証サポート**: ユーザーログインや M2M クレデンシャルを含む複数の認証方式に対応
* **リソース管理**: アプリケーション、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 vs Deploy CLI
</div>

* **Auth0 CLI**: インタラクティブな、コマンド単位のリソース管理。開発やアドホックな作業に最適です。
* **[Deploy CLI](/ja/docs/deploy-monitor/deploy-cli-tool)**: 宣言型で、構成ファイルベースのテナント管理。環境をまたいだテナント全体の構成管理に最適です。

<div id="auth0-cli-vs-terraform-provider">
  ### Auth0 CLI と Terraform プロバイダーの比較
</div>

* **Auth0 CLI**: 変更を即座に適用するための命令型コマンド。state は管理されません。
* **Terraform プロバイダー**: state を追跡する宣言型の Infrastructure as Code。本番環境のインフラ管理に最適です。

<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
```

マシンツーマシンアプリケーションを使って認証するには、次のコマンドを実行します。

```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 update
```

<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 Documentation](https://auth0.github.io/auth0-cli/)

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

<Columns cols={3}>
  <Card title="Deploy CLI" href="/ja/docs/deploy-monitor/deploy-cli-tool" icon="rocket">
    Deploy CLI を使用したテナント構成の管理について詳しく見る
  </Card>

  <Card title="Terraform プロバイダー" href="/ja/docs/deploy-monitor/auth0-terraform-provider" icon="code">
    Terraform を使用した Infrastructure as Code を詳しく見る
  </Card>

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