Skip to content

Commit abe63c9

Browse files
committed
feat(interactive_prompt): create a basic interactive prompt for create, dry run and deploy
1 parent 93c334c commit abe63c9

File tree

13 files changed

+1183
-49
lines changed

13 files changed

+1183
-49
lines changed

docs/reference/cli.mdx

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,50 @@ Get details about a specific command by running:
5353
nango [command] --help
5454
```
5555

56+
## Interactive Mode
57+
58+
The Nango CLI includes an interactive mode that prompts you for missing arguments. For example, if you run `nango create` without specifying the function type, integration, or name, the CLI will prompt you for them.
59+
60+
This mode is enabled by default when you're in an interactive terminal session.
61+
62+
### Usage Examples
63+
64+
**Interactive Usage:**
65+
66+
If you run a command without all the required arguments, the CLI will prompt you for them.
67+
68+
```bash
69+
# Running "nango create" without arguments
70+
$ nango create
71+
72+
? What type of function do you want to create?
73+
❯ sync
74+
action
75+
on-event
76+
```
77+
78+
**Non-Interactive (Explicit) Usage:**
79+
80+
You can provide all arguments upfront to bypass the interactive prompts. This is ideal for scripting.
81+
82+
```bash
83+
nango create --sync --integration my-api --name get-contacts
84+
```
85+
86+
### Disabling Interactive Mode
87+
88+
You can disable interactive mode in two ways:
89+
90+
1. **Using a flag:** Pass the `--no-interactive` flag to any command.
91+
```bash
92+
nango create --no-interactive
93+
```
94+
2. **In a CI environment:** Interactive mode is automatically disabled when the `CI` environment variable is set. This is the standard way to detect CI/CD environments.
95+
96+
### Backwards Compatibility
97+
98+
Interactive mode is fully backward compatible. If you provide all the required arguments for a command, the CLI will not prompt you for anything and will behave exactly as it did before.
99+
56100
## Flags & environment variables
57101

58102
Global command flags:
@@ -61,6 +105,9 @@ Global command flags:
61105
# Command flag to auto-confirm all prompts (useful for CI).
62106
# Note: Destructive changes (like removing a sync or renaming a model) requires confirmation, even when --auto-confirm is set. To bypass this restriction, the --allow-destructive flag can be passed to nango deploy.
63107
--auto-confirm
108+
109+
# Command flag to disable interactive mode.
110+
--no-interactive
64111
```
65112

66113
Environment variables:
@@ -85,4 +132,3 @@ NANGO_DEPLOY_AUTO_CONFIRM=false # Default value
85132
<Tip>
86133
**Questions, problems, feedback?** Please reach out in the [Slack community](https://nango.dev/slack).
87134
</Tip>
88-

0 commit comments

Comments
 (0)