Skip to main content
The Nango CLI lets you initialize projects, develop integration functions locally, run dry runs against live connections, and deploy to your Nango environment.

Installation

npm install -g nango
After installing, verify the version:
nango version

Authentication

The CLI authenticates using secret keys stored in environment variables. Add these to a .env file inside your nango-integrations folder:
NANGO_SECRET_KEY_DEV=xxxx-xxx-xxxx
NANGO_SECRET_KEY_PROD=xxxx-xxx-xxxx
Get your keys from Settings > Environment Settings in the Nango dashboard. Toggle between dev and prod environments in the left nav bar.
For self-hosted instances, set NANGO_HOSTPORT to your instance URL (e.g. http://localhost:3003).

Project structure

After running nango init, your integration folder looks like this:
nango-integrations/
├── .env                        # Secret keys and env config
├── index.ts                    # Imports all function files
├── package.json
├── tsconfig.json
└── github/                     # One folder per integration ID
    ├── syncs/
    │   └── fetchIssues.ts
    ├── actions/
    │   └── createIssue.ts
    └── on-events/
        └── pre-connection-deletion.ts

Commands

nango init

Initializes a new Nango integrations project in the specified directory.
nango init [path]
Arguments
ArgumentDescription
pathDirectory to initialize in. Defaults to the current directory.
Options
OptionDescription
--ai [claude|cursor...]Generate AI agent instruction files for Claude Code or Cursor.
--copyCopy files only — skip npm install and pre-compilation.
Example
# Initialize in a new folder
nango init nango-integrations

# Initialize with Cursor AI instructions
nango init nango-integrations --ai cursor

nango create

Creates a new integration function scaffold (sync, action, or on-event script).
nango create [integration] [name]
Arguments
ArgumentDescription
integrationIntegration ID (e.g. my-github-integration). Prompted if omitted.
nameFunction name (e.g. list-repos). Prompted if omitted.
Options
OptionDescription
--syncCreate a sync scaffold.
--actionCreate an action scaffold.
--on-eventCreate an on-event script scaffold.
Example
# Interactive (prompts for function type, integration, and name)
nango create

# Pass integration and name as positional arguments with type flag
nango create my-github-integration list-repos --sync

nango dev

Starts a local TypeScript watcher that compiles your integration functions as you edit them.
nango dev
Run this while writing functions to get instant type checking and compilation feedback. Example
# In your nango-integrations directory
nango dev

nango compile

Compiles all integration functions once without watching for changes. Useful for CI or one-off builds.
nango compile

nango deploy

Deploys compiled integration functions to a Nango environment.
nango deploy [environment]
Arguments
ArgumentDescription
environmentTarget environment: dev or prod. Prompted if omitted.
Options
OptionDescription
-v, --version <version>Tag this deployment with a version string.
-s, --sync <syncName>Deploy only a specific sync.
-a, --action <actionName>Deploy only a specific action.
-i, --integration <integrationId>Deploy all scripts for a specific integration.
--allow-destructiveAllow destructive changes (e.g. removing a sync or renaming a model) without confirmation.
Example
# Deploy all functions to dev
nango deploy dev

# Deploy to prod with version tag
nango deploy prod --version 1.2.0

# Deploy only one integration
nango deploy dev --integration my-github-integration

# Non-interactive CI deploy
nango deploy prod --auto-confirm
Destructive changes (removing syncs or renaming models) always require explicit confirmation, even with --auto-confirm. Pass --allow-destructive to bypass this.

nango dryrun

Tests a sync or action locally against a real connection without writing data to Nango. Useful for debugging during development.
nango dryrun [name] [connection_id]
Arguments
ArgumentDescription
nameName of the sync or action. Prompted if omitted.
connection_idConnection ID to run against. Prompted if omitted.
Options
OptionDescription
-e, --environment <env>Nango environment to use (dev or prod). Prompted if omitted.
-i, --input <json>Input for actions as a JSON string or @path/to/file.json.
-l, --lastSyncDate <date>Override the last sync date for incremental syncs (any string parseable by new Date()).
-m, --metadata <json>Stub metadata for the run as a JSON string or @path/to/file.json.
-c, --checkpoint <json>Stub sync checkpoint as a JSON string or @path/to/file.json.
--variant <variant>Sync variant to run. Defaults to the base variant.
--integration-id <id>Integration ID. Inferred from the connection if not provided.
--validateEnforce input, output, and record validation.
--saveSave all dry-run responses to <integration>/tests/<name>.test.json for unit tests.
--diagnosticsDisplay performance diagnostics (memory, CPU).
Example
# Interactive
nango dryrun

# Run a specific sync
nango dryrun github-issues user-123 -e dev

# Run an action with input
nango dryrun create-issue user-123 -e dev --input '{"title": "Test"}'

# Pass input from a file
nango dryrun create-issue user-123 -e dev --input @fixtures/issue.json

# Test with a specific last sync date
nango dryrun github-issues user-123 -e dev --lastSyncDate "2024-01-01"

nango generate:docs

Generates documentation for your integration functions from their TypeScript definitions.
nango generate:docs
Options
OptionDescription
-p, --path <path>Path to generate docs for. Defaults to the current directory.
--integration-templatesUse this flag when generating for the nango integration-templates repo.

nango generate:tests

Generates test scaffolds for your integration scripts.
nango generate:tests
Options
OptionDescription
-i, --integration <id>Generate tests for a specific integration only.
-s, --sync <name>Generate tests for a specific sync.
-a, --action <name>Generate tests for a specific action.

nango clone

Clones integration templates from the nango integration-templates repository.
nango clone <template>
Arguments
ArgumentDescription
templateTemplate path to clone (e.g. github, github/actions, github/actions/list-repos).
Options
OptionDescription
-f, --forceOverwrite existing files without prompting.
Example
# Clone all GitHub templates
nango clone github

# Clone only GitHub actions
nango clone github/actions

# Clone a specific action
nango clone github/actions/list-repos

nango migrate-to-zero-yaml

Migrates an existing nango.yaml-based project to the zero-YAML TypeScript format. Run this once if you have a legacy project.
nango migrate-to-zero-yaml

nango version

Prints the installed CLI version.
nango version

Global flags

These flags are available on all commands:
FlagDescription
--auto-confirmAutomatically confirm all prompts. Useful in CI pipelines.
--debugEnable verbose debug logging.
--no-interactiveDisable interactive prompts. Required values must be passed as flags.
--no-dependency-updateSkip automatic package.json updates and dependency installs.

Interactive mode

By default, the CLI prompts you for any missing arguments. For example, running nango create without flags shows a menu to select the function type, integration, and name. Disable interactive mode in CI or scripts:
# Via flag
nango deploy prod --no-interactive

# Automatically disabled when CI=true is set
CI=true nango deploy prod

Environment variables

Place these in a .env file inside your nango-integrations folder.
VariableDefaultDescription
NANGO_SECRET_KEY_DEVSecret key for the dev environment.
NANGO_SECRET_KEY_PRODSecret key for the prod environment.
NANGO_HOSTPORThttps://api.nango.devNango instance URL. Change for self-hosted deployments.
NANGO_CLI_UPGRADE_MODEpromptHow to handle CLI upgrades: prompt, auto, or ignore.
NANGO_DEPLOY_AUTO_CONFIRMfalseSkip deployment confirmation prompts. Destructive changes still require --allow-destructive.
NANGO_CLI_DEPENDENCY_UPDATEtrueSet to false to disable automatic dependency installs (same as --no-dependency-update).

Dependency management

The CLI automatically detects your package manager and installs dependencies when needed. Detection order:
  1. packageManager field in package.json (Corepack standard)
  2. Lock files: pnpm-lock.yaml, yarn.lock, bun.lockb / bun.lock
  3. Falls back to npm
Supported package managers: npm, pnpm, yarn, bun. Use --no-dependency-update to opt out of automatic installs — for example, in monorepos where dependency management is handled at the workspace root.
When --no-dependency-update is set, ensure all dependencies are already installed before running commands.

Getting help

Run any command with --help to see its options:
nango --help
nango deploy --help
nango dryrun --help

Build docs developers (and LLMs) love