From 05016a5f61599fc6dce0fdaf63ebce8b808ea143 Mon Sep 17 00:00:00 2001 From: Bharath Natarajan Date: Thu, 8 Oct 2026 08:52:58 +0530 Subject: [PATCH 1/3] docs: add Auth0 CLI agent mode to AI Tools section Documents --agent-mode, auto-detection, auth0 commands, --schema/--data, the structured error envelope, and auth0 docs search on the existing CLI reference page, and surfaces the CLI in the AI Tools nav group alongside the MCP server and Agent Skills. --- main/config/navigation/get-started.json | 1 + main/docs/deploy-monitor/auth0-cli.mdx | 60 +++++++++++++++++++ main/docs/get-started/build-with-ai-tools.mdx | 6 ++ 3 files changed, 67 insertions(+) diff --git a/main/config/navigation/get-started.json b/main/config/navigation/get-started.json index 07bba956df..001e9a03d6 100644 --- a/main/config/navigation/get-started.json +++ b/main/config/navigation/get-started.json @@ -270,6 +270,7 @@ }, "docs/get-started/auth0-agent-experience", "docs/get-started/build-with-ai-tools", + "docs/deploy-monitor/auth0-cli", "docs/get-started/auth0-guide" ] }, diff --git a/main/docs/deploy-monitor/auth0-cli.mdx b/main/docs/deploy-monitor/auth0-cli.mdx index 4fdfdfe063..23ed4df558 100644 --- a/main/docs/deploy-monitor/auth0-cli.mdx +++ b/main/docs/deploy-monitor/auth0-cli.mdx @@ -160,6 +160,66 @@ auth0 apps show --json auth0 apps create --name "My App" --type spa --json > app-details.json ``` +## Use with AI agents + +Agent Mode makes the CLI safe for an AI coding agent to drive without a human watching every step. Enable it with the `--agent-mode` flag or the `AUTH0_AGENT_MODE` environment variable: + +```bash lines +auth0 apps list --agent-mode +``` + +```bash lines +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. + +### 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 +auth0 commands --flat +``` + +Add `--detailed` to include flags, arguments, defaults, and whether authentication is required for each command — enough to construct a valid call without opening a `--help` page. + +### Check a payload shape before sending it + +`--schema` prints the exact request payload a command expects, sourced from the OpenAPI spec: + +```bash lines +auth0 apps create --schema +``` + +`--data` sends the whole payload as one JSON object — inline, from a file, or piped through stdin — and validates it locally before the request reaches the API: + +```bash lines +auth0 apps create --data '{"name":"My App","app_type":"spa"}' +auth0 apps create --data @app.json +cat app.json | auth0 apps create +``` + +### Structured errors + +Every failure in Agent Mode returns a JSON error envelope instead of a plain-text message: + +```json +{"error":{"code":"validation","reason":"required_field","message":"...","details":{"field":"name","reason":"required"}}} +``` + +`code` is a stable, machine-readable failure class (`usage`, `auth`, `validation`, `not_found`, `rate_limit`, and others). `reason` adds finer detail, and `details` carries 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 +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: diff --git a/main/docs/get-started/build-with-ai-tools.mdx b/main/docs/get-started/build-with-ai-tools.mdx index d9af0d6f8b..db6886ee7b 100644 --- a/main/docs/get-started/build-with-ai-tools.mdx +++ b/main/docs/get-started/build-with-ai-tools.mdx @@ -142,6 +142,12 @@ To verify, ask `What MCP servers do you have installed?` in Cascade’s chat. Ca +## Auth0 CLI + +The [Auth0 CLI](/docs/deploy-monitor/auth0-cli) supports Agent Mode, which makes it safe for an AI coding agent to drive directly from your terminal: structured JSON output, no interactive prompts, and a reliable exit code on every failure. Agent Mode turns on automatically when the CLI detects it isn't talking to an interactive terminal, so most coding agents get this behavior without any setup. + +To learn how to discover commands, check a payload shape before sending it, and search documentation from the terminal, read [Use with AI agents](/docs/deploy-monitor/auth0-cli#use-with-ai-agents). + ## Sample prompts From 6f982ccde3f9706a898b9c88af9ce50bf13d8bed Mon Sep 17 00:00:00 2001 From: Bharath Natarajan Date: Thu, 8 Oct 2026 10:12:43 +0530 Subject: [PATCH 2/3] docs: note --json-compact for token-sensitive agent workflows --- main/docs/deploy-monitor/auth0-cli.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/docs/deploy-monitor/auth0-cli.mdx b/main/docs/deploy-monitor/auth0-cli.mdx index 23ed4df558..7bc7a4c14c 100644 --- a/main/docs/deploy-monitor/auth0-cli.mdx +++ b/main/docs/deploy-monitor/auth0-cli.mdx @@ -174,6 +174,14 @@ 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 +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: From 59583b8d71a22f97827981768ead078b03c90b56 Mon Sep 17 00:00:00 2001 From: Bharath Natarajan <166125343+brth31@users.noreply.github.com> Date: Wed, 14 Oct 2026 10:06:31 +0530 Subject: [PATCH 3/3] Update main/config/navigation/get-started.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hazel Virdó --- main/config/navigation/get-started.json | 1 - 1 file changed, 1 deletion(-) diff --git a/main/config/navigation/get-started.json b/main/config/navigation/get-started.json index 001e9a03d6..07bba956df 100644 --- a/main/config/navigation/get-started.json +++ b/main/config/navigation/get-started.json @@ -270,7 +270,6 @@ }, "docs/get-started/auth0-agent-experience", "docs/get-started/build-with-ai-tools", - "docs/deploy-monitor/auth0-cli", "docs/get-started/auth0-guide" ] },