Skip to content

Commit e997f30

Browse files
authored
feat: add '--schema' and '--data' options for various commands (#1691)
* feat: add '--schema' and '--data' options for various commands to enhance JSON payload handling and schema discovery * feat: add '--json' and '--json-compact' options for output formatting and enhance '--schema' command behavior
1 parent 61e49ac commit e997f30

22 files changed

Lines changed: 908 additions & 23 deletions

‎docs/auth0_acul_config_list.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ has_toc: false
77

88
List Universal Login rendering configurations with optional filters and pagination.
99

10+
Use '--schema' to see available query parameters.
11+
1012
## Usage
1113
```
1214
auth0 acul config list [flags]
@@ -17,6 +19,7 @@ auth0 acul config list [flags]
1719
```
1820
auth0 acul config list --prompt reset-password
1921
auth0 acul config list --rendering-mode advanced --include-fields true --fields head_tags,context_configuration
22+
auth0 acul config list --schema
2023
```
2124

2225

@@ -33,6 +36,7 @@ auth0 acul config list [flags]
3336
--prompt string Filter by the Universal Login prompt.
3437
-q, --query string Advanced query.
3538
--rendering-mode string Filter by the rendering mode (advanced or standard).
39+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
3640
--screen string Filter by the Universal Login screen.
3741
```
3842

‎docs/auth0_acul_config_set.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ has_toc: false
77

88
Set the rendering settings for a specific screen.
99

10+
Provide the config with `--file` (or its alias `--data`), which accepts inline JSON, an `@file.json` reference, or a file path.
11+
12+
Use '--schema' to print the request payload schema and exit.
13+
1014
## Usage
1115
```
1216
auth0 acul config set [flags]
@@ -19,13 +23,20 @@ auth0 acul config set [flags]
1923
auth0 acul config set <screen-name> --file settings.json
2024
auth0 acul config set signup-id --file settings.json
2125
auth0 acul config set login-id
26+
auth0 acul config set signup-id --data '{"rendering_mode":"advanced"}'
27+
auth0 acul config set signup-id --data @settings.json
28+
auth0 acul config set --schema
2229
```
2330

2431

2532
## Flags
2633

2734
```
28-
-f, --file string File to save the rendering configs to.
35+
--data string Alias for --file. Rendering config as inline JSON, an @file.json reference, or a file path.
36+
-f, --file string File to save the rendering configs to.
37+
--json Output in json format.
38+
--json-compact Output in compact json format.
39+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
2940
```
3041

3142

‎docs/auth0_domains_create.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ To create interactively, use `auth0 domains create` with no arguments.
1111

1212
To create non-interactively, supply the domain name, type, policy and other information through the flags.
1313

14+
Use '--schema' to print the request payload schema and exit.
15+
Use '--data' to supply the full JSON payload (validated against the schema before sending).
16+
1417
## Usage
1518
```
1619
auth0 domains create [flags]
@@ -22,23 +25,34 @@ auth0 domains create [flags]
2225
auth0 domains create
2326
auth0 domains create --domain <domain-name>
2427
auth0 domains create --domain <domain-name> --policy recommended
25-
auth0 domains create --domain <domain-name> --policy recommended --metadata '{"key1":"value1","key2":"value2"}'
28+
auth0 domains create --domain <domain-name> --policy recommended --metadata '{"key1":"value1","key2":"value2"}'
2629
auth0 domains create --domain <domain-name> --policy recommended --type auth0
2730
auth0 domains create --domain <domain-name> --policy recommended --type auth0 --ip-header "cf-connecting-ip"
2831
auth0 domains create -d <domain-name> -p recommended -t auth0 -i "cf-connecting-ip" --json
2932
auth0 domains create -d <domain-name> -p recommended -t auth0 -i "cf-connecting-ip" --json-compact
33+
34+
# Discover the payload schema
35+
auth0 domains create --schema
36+
auth0 domains create --schema --json
37+
38+
# JSON input mode (for agents and automation)
39+
auth0 domains create --data '{"domain":"login.example.com","type":"auth0_managed_certs"}'
40+
auth0 domains create --data @domain.json
41+
cat domain.json | auth0 domains create
3042
```
3143

3244

3345
## Flags
3446

3547
```
48+
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
3649
-d, --domain string Domain name.
3750
-i, --ip-header string The HTTP header to fetch the client's IP address.
3851
--json Output in json format.
3952
--json-compact Output in compact json format.
4053
-m, --metadata string The Custom Domain Metadata, formatted as JSON.
4154
-p, --policy string The TLS version policy. Can be either 'compatible' or 'recommended'.
55+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
4256
-t, --type string Custom domain provisioning type. Must be 'auth0' for Auth0-managed certs or 'self' for self-managed certs.
4357
-v, --verification string *DEPRECATED* Custom domain verification method. Must be 'txt'.
4458
```

‎docs/auth0_domains_list.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ has_toc: false
77

88
List your existing custom domains. To create one, run: `auth0 domains create`.
99

10+
Use '--schema' to see available query parameters.
11+
Use '--query' to filter results via a JSON object (any API-supported parameter works immediately).
12+
1013
## Usage
1114
```
1215
auth0 domains list [flags]
@@ -21,6 +24,10 @@ auth0 domains list [flags]
2124
auth0 domains ls --json-compact
2225
auth0 domains ls --csv
2326
auth0 domains ls --filter "domain:demo* AND status:pending_verification"
27+
auth0 domains list --schema
28+
auth0 domains list --schema --json
29+
auth0 domains list --query '{"take":10}'
30+
auth0 domains list --query '{"take":10}' --json
2431
```
2532

2633

@@ -31,6 +38,8 @@ auth0 domains list [flags]
3138
--filter string Filter custom domains (EA-only).
3239
--json Output in json format.
3340
--json-compact Output in compact json format.
41+
-q, --query string Filter results with a JSON object of query parameters. Any API-supported parameter works immediately. Run '--schema' to see documented parameters. On offset-paginated endpoints, add "include_totals":true to receive total counts and a pagination hint (without it the API returns a bare array and no hint can be given).
42+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
3443
--sort string Sort by a field (EA-only). Only 'domain' is supported.
3544
```
3645

‎docs/auth0_domains_update.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ To update interactively, use `auth0 domains update` with no arguments.
1111

1212
To update non-interactively, supply the domain name, type, policy and other information through the flags.
1313

14+
Use '--schema' to print the request payload schema and exit.
15+
Use '--data' to supply the full JSON payload (validated against the schema before sending).
16+
1417
## Usage
1518
```
1619
auth0 domains update [flags]
@@ -25,17 +28,28 @@ auth0 domains update [flags]
2528
auth0 domains update <domain-id> --metadata '{"key1":"value1","key2":null}'
2629
auth0 domains update <domain-id> -p compatible -i "cf-connecting-ip" --json
2730
auth0 domains update <domain-id> -p compatible -i "cf-connecting-ip" --json-compact
31+
32+
# Discover the payload schema
33+
auth0 domains update --schema
34+
auth0 domains update --schema --json
35+
36+
# JSON input mode (for agents and automation)
37+
auth0 domains update <domain-id> --data '{"tls_policy":"recommended"}'
38+
auth0 domains update <domain-id> --data @domain.json
39+
cat domain.json | auth0 domains update <domain-id>
2840
```
2941

3042

3143
## Flags
3244

3345
```
46+
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
3447
-i, --ip-header string The HTTP header to fetch the client's IP address.
3548
--json Output in json format.
3649
--json-compact Output in compact json format.
3750
-m, --metadata string The Custom Domain Metadata, formatted as JSON.
3851
-p, --policy string The TLS version policy. Can be either 'compatible' or 'recommended'.
52+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
3953
```
4054

4155

‎docs/auth0_email_templates_update.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,30 @@ auth0 email templates update [flags]
3131
auth0 email templates update welcome --enabled=true --body "$(cat path/to/body.html)" --from "welcome@example.com" --lifetime 6100 --subject "Welcome" --url "https://example.com"
3232
auth0 email templates update welcome -e=true -b "$(cat path/to/body.html)" -f "welcome@example.com" -l 6100 -s "Welcome" -u "https://example.com" --json
3333
auth0 email templates update welcome -e=true -b "$(cat path/to/body.html)" -f "welcome@example.com" -l 6100 -s "Welcome" -u "https://example.com" --json-compact
34+
35+
# Discover the payload schema
36+
auth0 email templates update --schema
37+
auth0 email templates update --schema --json
38+
39+
# JSON input mode (for agents and automation)
40+
auth0 email templates update welcome --data '{"body":"<html>Welcome!</html>","enabled":true}'
41+
auth0 email templates update welcome --data @template.json
42+
cat template.json | auth0 email templates update welcome
3443
```
3544

3645

3746
## Flags
3847

3948
```
4049
-b, --body string Body of the email template.
50+
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
4151
-e, --enabled Whether the template is enabled (true) or disabled (false). (default true)
4252
--force Skip confirmation.
4353
-f, --from string Sender's 'from' email address.
4454
--json Output in json format.
4555
--json-compact Output in compact json format.
4656
-l, --lifetime int Lifetime in seconds that the link within the email will be valid for.
57+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
4758
-s, --subject string Subject line of the email.
4859
-u, --url string URL to redirect the user to after a successful action.
4960
```

‎docs/auth0_logs_list.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ has_toc: false
77

88
Display the tenant logs allowing to filter using Lucene query syntax.
99

10+
Use '--schema' to see available query parameters.
11+
Use '--query' to filter results via a JSON object (any API-supported parameter works immediately).
12+
1013
## Usage
1114
```
1215
auth0 logs list [flags]
@@ -27,6 +30,10 @@ auth0 logs list [flags]
2730
auth0 logs ls --json
2831
auth0 logs ls --json-compact
2932
auth0 logs ls --csv
33+
auth0 logs list --schema
34+
auth0 logs list --schema --json
35+
auth0 logs list --query '{"per_page":5,"include_totals":true}'
36+
auth0 logs list --query '{"per_page":5}' --json
3037
```
3138

3239

@@ -39,6 +46,8 @@ auth0 logs list [flags]
3946
--json-compact Output in compact json format.
4047
-n, --number int Number of log entries to show. Minimum 1, maximum 1000. (default 100)
4148
-p, --picker Allows to toggle from list of logs and view a selected log in detail
49+
-q, --query string Filter results with a JSON object of query parameters. Any API-supported parameter works immediately. Run '--schema' to see documented parameters. On offset-paginated endpoints, add "include_totals":true to receive total counts and a pagination hint (without it the API returns a bare array and no hint can be given).
50+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
4251
```
4352

4453

‎docs/auth0_universal-login_prompts_update.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ auth0 universal-login prompts update [flags]
1818
auth0 universal-login prompts update <prompt>
1919
auth0 universal-login prompts update <prompt> --language <language>
2020
auth0 ul prompts update signup -l es
21+
22+
# JSON input mode (for agents and automation)
23+
auth0 ul prompts update signup -l es --data '{"signup":{"title":"Sign Up"}}'
24+
auth0 ul prompts update signup -l es --data @signup.json
2125
```
2226

2327

2428
## Flags
2529

2630
```
31+
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
2732
-l, --language string Language of the custom text. (default "en")
2833
```
2934

‎docs/auth0_universal-login_update.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ auth0 universal-login update [flags]
2424
auth0 ul update -a "#FF4F40" -b "#2A2E35" -l "https://example.com/logo.png"
2525
auth0 ul update -a "#FF4F40" -b "#2A2E35" -l "https://example.com/logo.png" --json
2626
auth0 ul update -a "#FF4F40" -b "#2A2E35" -l "https://example.com/logo.png" --json-compact
27+
28+
# Discover the payload schema
29+
auth0 universal-login update --schema
30+
auth0 universal-login update --schema --json
31+
32+
# JSON input mode (for agents and automation)
33+
auth0 ul update --data '{"colors":{"primary":"#FF4F40","page_background":"#2A2E35"}}'
34+
auth0 ul update --data @branding.json
35+
cat branding.json | auth0 ul update
2736
```
2837

2938

@@ -32,11 +41,13 @@ auth0 universal-login update [flags]
3241
```
3342
-a, --accent string Accent color.
3443
-b, --background string Page background color
44+
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
3545
-f, --favicon string URL for the favicon. Must use HTTPS.
3646
-c, --font string URL for the custom font. The URL must point to a font file and not a stylesheet. Must use HTTPS.
3747
--json Output in json format.
3848
--json-compact Output in compact json format.
3949
-l, --logo string URL for the logo. Must use HTTPS.
50+
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
4051
```
4152

4253

0 commit comments

Comments
 (0)