title | sidebarTitle | icon |
---|---|---|
CLI |
CLI |
terminal |
Install the Nango CLI globally:
npm install nango -g
In the folder where you want your integration folder (e.g. root of your project), run:
nango init # Creates `./nango-integrations` with initial config
Add the following env vars. We recommend that you have a .env
file in ./nango-integrations
:
NANGO_SECRET_KEY_PROD='<prod-secret-key>'
NANGO_SECRET_KEY_DEV='<dev-secret-key>'
Get your prod
and dev
secret keys from the Environment Settings tab (toggle between the prod
and dev
environment in the left nav bar).
Check out all CLI commands by running:
nango
Get details about a specific command by running:
nango [command] --help
Command | Description | Details |
---|---|---|
nango init |
Creates the nango-integrations directory with a demo Github integration. |
Generates models.ts , but not the compiled .js files. |
nango dev |
Necessary to edit integration configurations and scripts. | Watches the nango.yaml and integration scripts, re-generates models.ts and compiled .js files. |
nango generate |
Generates an integration script .ts file with initial scaffold when new syncs appear in your nango.yaml . |
Re-generates models.ts , not the compiled .js files. |
nango dryrun <params> |
Lets you test integration scripts locally. | |
nango deploy <env> |
Lets you deploy your sync to your dev or prod environment |
Generates the compiled .js files. |
Global command flags:
# Command flag to auto-confirm all prompts (useful for CI).
--auto-confirm
Environment variables:
# Recommendation: in a ".env" file in ./nango-integrations.
# Authenticates the CLI (get the keys in the dashboard's Environment Settings).
NANGO_SECRET_KEY_DEV=xxxx-xxx-xxxx
NANGO_SECRET_KEY_PROD=xxxx-xxx-xxxx
# Nango's instance URL (OSS: change to http://localhost:3003 or your instance URL).
NANGO_HOSTPORT=https://api.nango.dev # Default value
# How to handle CLI upgrades ("prompt", "auto" or "ignore").
NANGO_CLI_UPGRADE_MODE=prompt # Default value
# Whether to prompt before deployments.
NANGO_DEPLOY_AUTO_CONFIRM=false # Default value