Skip to content

Commit 025d4d8

Browse files
feat: add Forms management commands
1 parent ed5622c commit 025d4d8

32 files changed

Lines changed: 3217 additions & 133 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ test-unit: ## Run unit tests
166166
${call print, "Running unit tests"}
167167
@go test -v -race ${GO_PACKAGES} -coverprofile="coverage-unit-tests.out"
168168

169-
test-integration: install-with-cover $(GO_BIN)/auth0 $(GO_BIN)/commander ## Run integration tests. To run a specific test pass the FILTER var. Usage: `make test-integration FILTER="attack protection"`
169+
test-integration: install-with-cover $(GO_BIN)/auth0 $(GO_BIN)/commander ## Run integration tests. To run a specific test pass the FILTER var. Usage: `make test-integration FILTER="attack protection"`. To run a single suite file pass the FILE var. Usage: `make test-integration FILE="./test/integration/forms-test-cases.yaml"`
170170
${call print, "Running integration tests"}
171171
@mkdir -p "coverage"
172172
@PATH=$(GO_BIN):$$PATH \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ Select **y** to proceed with your default tenant, or **N** to choose a different
273273
- [auth0 completion](https://auth0.github.io/auth0-cli/auth0_completion.html) - Setup autocomplete features for this CLI on your terminal
274274
- [auth0 domains](https://auth0.github.io/auth0-cli/auth0_domains.html) - Manage custom domains
275275
- [auth0 email](https://auth0.github.io/auth0-cli/auth0_email.html) - Manage email settings
276+
- [auth0 forms](https://auth0.github.io/auth0-cli/auth0_forms.html) - Manage Forms
276277
- [auth0 login](https://auth0.github.io/auth0-cli/auth0_login.html) - Authenticate the Auth0 CLI
277278
- [auth0 logout](https://auth0.github.io/auth0-cli/auth0_logout.html) - Log out of a tenant's session
278279
- [auth0 logs](https://auth0.github.io/auth0-cli/auth0_logs.html) - View tenant logs

docs/auth0_forms.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: default
3+
has_toc: false
4+
has_children: true
5+
---
6+
# auth0 forms
7+
8+
Forms are customizable screens you can insert into a flow to collect input from users during authentication and other journeys.
9+
10+
## Commands
11+
12+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
13+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
14+
- [auth0 forms export](auth0_forms_export.md) - Export a form
15+
- [auth0 forms import](auth0_forms_import.md) - Import a form
16+
- [auth0 forms list](auth0_forms_list.md) - List your forms
17+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
18+
- [auth0 forms show](auth0_forms_show.md) - Show a form
19+
- [auth0 forms update](auth0_forms_update.md) - Update a form
20+

docs/auth0_forms_create.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
layout: default
3+
parent: auth0 forms
4+
has_toc: false
5+
---
6+
# auth0 forms create
7+
8+
Create a new form.
9+
10+
Interactive behavior: `auth0 forms create` asks only for the name and creates a minimal scaffold; it does not open an editor. You can then refine the form in the dashboard builder.
11+
12+
Pass `--edit` to open an editor and author the form graph before it is created, or supply the whole body via `--file` (or piped stdin) with optional `--name` and `--language-*` overrides. Run `auth0 forms create --example > form.json` to generate an accepted file payload.
13+
14+
## Usage
15+
```
16+
auth0 forms create [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 forms create
23+
auth0 forms create --name "My Form"
24+
auth0 forms create --name "My Form" --edit
25+
auth0 forms create --example > form.json
26+
auth0 forms create --file ./form.json
27+
auth0 forms create --file ./form.json --name "My Form" --language-primary en
28+
cat form.json | auth0 forms create -f -
29+
```
30+
31+
32+
## Flags
33+
34+
```
35+
--edit Open an editor to author the form graph after entering the name.
36+
--example Print an example form JSON body and exit.
37+
-f, --file string Path to a JSON file with the form body. Use '-' to read from stdin.
38+
--json Output in json format.
39+
--json-compact Output in compact json format.
40+
--language-default string Default language of the Form (e.g. en).
41+
--language-primary string Primary language of the Form (e.g. en).
42+
--name string Name of the Form.
43+
```
44+
45+
46+
## Inherited Flags
47+
48+
```
49+
--agent-mode Output JSON, disable prompts and colors. Auto-enabled for AI agents; set AUTH0_AGENT_MODE=false to disable.
50+
--debug Enable debug mode.
51+
--no-color Disable colors.
52+
--no-input Disable interactivity.
53+
--tenant string Specific tenant to use.
54+
```
55+
56+
57+
## Related Commands
58+
59+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
60+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
61+
- [auth0 forms export](auth0_forms_export.md) - Export a form
62+
- [auth0 forms import](auth0_forms_import.md) - Import a form
63+
- [auth0 forms list](auth0_forms_list.md) - List your forms
64+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
65+
- [auth0 forms show](auth0_forms_show.md) - Show a form
66+
- [auth0 forms update](auth0_forms_update.md) - Update a form
67+
68+

docs/auth0_forms_delete.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
layout: default
3+
parent: auth0 forms
4+
has_toc: false
5+
---
6+
# auth0 forms delete
7+
8+
Delete a form.
9+
10+
To delete interactively, use `auth0 forms delete` with no arguments.
11+
12+
To delete non-interactively, supply the form id and the `--force` flag to skip confirmation.
13+
14+
## Usage
15+
```
16+
auth0 forms delete [flags]
17+
```
18+
19+
## Examples
20+
21+
```
22+
auth0 forms delete
23+
auth0 forms rm
24+
auth0 forms delete <form-id>
25+
auth0 forms delete <form-id> --force
26+
auth0 forms delete <form-id> <form-id2> <form-idn>
27+
```
28+
29+
30+
## Flags
31+
32+
```
33+
--force Skip confirmation.
34+
```
35+
36+
37+
## Inherited Flags
38+
39+
```
40+
--agent-mode Output JSON, disable prompts and colors. Auto-enabled for AI agents; set AUTH0_AGENT_MODE=false to disable.
41+
--debug Enable debug mode.
42+
--no-color Disable colors.
43+
--no-input Disable interactivity.
44+
--tenant string Specific tenant to use.
45+
```
46+
47+
48+
## Related Commands
49+
50+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
51+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
52+
- [auth0 forms export](auth0_forms_export.md) - Export a form
53+
- [auth0 forms import](auth0_forms_import.md) - Import a form
54+
- [auth0 forms list](auth0_forms_list.md) - List your forms
55+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
56+
- [auth0 forms show](auth0_forms_show.md) - Show a form
57+
- [auth0 forms update](auth0_forms_update.md) - Update a form
58+
59+

docs/auth0_forms_export.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: default
3+
parent: auth0 forms
4+
has_toc: false
5+
---
6+
# auth0 forms export
7+
8+
Export a form as JSON. Writes to stdout by default (pipe-friendly) or to a file with `--output`. The output uses the same envelope as the Auth0 Dashboard (`version`, `form`, `flows`, `connections`), bundling the flows and vault connections the form references with portable `#FLOW-N#`/`#CONN-N#` placeholders, so it can be imported by the CLI or opened in the Dashboard.
9+
10+
## Usage
11+
```
12+
auth0 forms export [flags]
13+
```
14+
15+
## Examples
16+
17+
```
18+
auth0 forms export <form-id>
19+
auth0 forms export <form-id> --output ./form.json
20+
auth0 forms export <form-id> --json-compact
21+
auth0 forms export <form-id> | auth0 forms import -f -
22+
```
23+
24+
25+
## Flags
26+
27+
```
28+
--json-compact Output in compact json format.
29+
-o, --output string Path to write the exported form. Writes to stdout when omitted.
30+
```
31+
32+
33+
## Inherited Flags
34+
35+
```
36+
--agent-mode Output JSON, disable prompts and colors. Auto-enabled for AI agents; set AUTH0_AGENT_MODE=false to disable.
37+
--debug Enable debug mode.
38+
--no-color Disable colors.
39+
--no-input Disable interactivity.
40+
--tenant string Specific tenant to use.
41+
```
42+
43+
44+
## Related Commands
45+
46+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
47+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
48+
- [auth0 forms export](auth0_forms_export.md) - Export a form
49+
- [auth0 forms import](auth0_forms_import.md) - Import a form
50+
- [auth0 forms list](auth0_forms_list.md) - List your forms
51+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
52+
- [auth0 forms show](auth0_forms_show.md) - Show a form
53+
- [auth0 forms update](auth0_forms_update.md) - Update a form
54+
55+

docs/auth0_forms_import.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
layout: default
3+
parent: auth0 forms
4+
has_toc: false
5+
---
6+
# auth0 forms import
7+
8+
Import a form from a JSON file (or piped stdin). Without `--id` a new form is created; with `--id` the existing form is replaced.
9+
10+
Both a flat form graph and the Dashboard envelope (`version`, `form`, `flows`, `connections`) are accepted. For an envelope, the bundled flows are created and each `#CONN-N#` connection placeholder is mapped to an existing vault connection, either interactively or with `--connection`.
11+
12+
## Usage
13+
```
14+
auth0 forms import [flags]
15+
```
16+
17+
## Examples
18+
19+
```
20+
auth0 forms import --file ./form.json
21+
auth0 forms import --file ./form.json --id <form-id>
22+
auth0 forms import --file ./form.json --connection '#CONN-1#=ac_123'
23+
cat form.json | auth0 forms import -f -
24+
```
25+
26+
27+
## Flags
28+
29+
```
30+
--connection stringToString Map an exported connection placeholder to an existing vault connection ID, e.g. --connection '#CONN-1#=ac_123'. Repeatable. (default [])
31+
-f, --file string Path to a JSON file with the form body. Use '-' to read from stdin.
32+
--id string Id of an existing Form to replace. When omitted, a new form is created.
33+
--json Output in json format.
34+
--json-compact Output in compact json format.
35+
```
36+
37+
38+
## Inherited Flags
39+
40+
```
41+
--agent-mode Output JSON, disable prompts and colors. Auto-enabled for AI agents; set AUTH0_AGENT_MODE=false to disable.
42+
--debug Enable debug mode.
43+
--no-color Disable colors.
44+
--no-input Disable interactivity.
45+
--tenant string Specific tenant to use.
46+
```
47+
48+
49+
## Related Commands
50+
51+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
52+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
53+
- [auth0 forms export](auth0_forms_export.md) - Export a form
54+
- [auth0 forms import](auth0_forms_import.md) - Import a form
55+
- [auth0 forms list](auth0_forms_list.md) - List your forms
56+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
57+
- [auth0 forms show](auth0_forms_show.md) - Show a form
58+
- [auth0 forms update](auth0_forms_update.md) - Update a form
59+
60+

docs/auth0_forms_list.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
layout: default
3+
parent: auth0 forms
4+
has_toc: false
5+
---
6+
# auth0 forms list
7+
8+
List your existing forms. To create one, run: `auth0 forms create`.
9+
10+
## Usage
11+
```
12+
auth0 forms list [flags]
13+
```
14+
15+
## Examples
16+
17+
```
18+
auth0 forms list
19+
auth0 forms ls
20+
auth0 forms ls --number 100
21+
auth0 forms ls --json
22+
auth0 forms ls --csv
23+
```
24+
25+
26+
## Flags
27+
28+
```
29+
--csv Output in csv format.
30+
--json Output in json format.
31+
--json-compact Output in compact json format.
32+
-n, --number int Number of forms to retrieve. Fetched across pages. (default 100)
33+
```
34+
35+
36+
## Inherited Flags
37+
38+
```
39+
--agent-mode Output JSON, disable prompts and colors. Auto-enabled for AI agents; set AUTH0_AGENT_MODE=false to disable.
40+
--debug Enable debug mode.
41+
--no-color Disable colors.
42+
--no-input Disable interactivity.
43+
--tenant string Specific tenant to use.
44+
```
45+
46+
47+
## Related Commands
48+
49+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
50+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
51+
- [auth0 forms export](auth0_forms_export.md) - Export a form
52+
- [auth0 forms import](auth0_forms_import.md) - Import a form
53+
- [auth0 forms list](auth0_forms_list.md) - List your forms
54+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
55+
- [auth0 forms show](auth0_forms_show.md) - Show a form
56+
- [auth0 forms update](auth0_forms_update.md) - Update a form
57+
58+

docs/auth0_forms_open.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
layout: default
3+
parent: auth0 forms
4+
has_toc: false
5+
---
6+
# auth0 forms open
7+
8+
Open a form's page in the Auth0 Dashboard form builder.
9+
10+
## Usage
11+
```
12+
auth0 forms open [flags]
13+
```
14+
15+
## Examples
16+
17+
```
18+
auth0 forms open
19+
auth0 forms open <form-id>
20+
```
21+
22+
23+
24+
25+
## Inherited Flags
26+
27+
```
28+
--agent-mode Output JSON, disable prompts and colors. Auto-enabled for AI agents; set AUTH0_AGENT_MODE=false to disable.
29+
--debug Enable debug mode.
30+
--no-color Disable colors.
31+
--no-input Disable interactivity.
32+
--tenant string Specific tenant to use.
33+
```
34+
35+
36+
## Related Commands
37+
38+
- [auth0 forms create](auth0_forms_create.md) - Create a new form
39+
- [auth0 forms delete](auth0_forms_delete.md) - Delete a form
40+
- [auth0 forms export](auth0_forms_export.md) - Export a form
41+
- [auth0 forms import](auth0_forms_import.md) - Import a form
42+
- [auth0 forms list](auth0_forms_list.md) - List your forms
43+
- [auth0 forms open](auth0_forms_open.md) - Open a form in the Auth0 Dashboard
44+
- [auth0 forms show](auth0_forms_show.md) - Show a form
45+
- [auth0 forms update](auth0_forms_update.md) - Update a form
46+
47+

0 commit comments

Comments
 (0)