fivetran-connector-sdk Commands
The following CLI commands are available in the fivetran-connector-sdk PyPI package.
CLI (Command-Line Interface) is a text-based interface that lets you run commands directly in a terminal or console to perform tasks. In the context of Connector SDK, you use the CLI to configure, test, or deploy your custom connectors.
fivetran init
Initializes a new Connector SDK project by setting up the project structure, configuration files, and a connector you can run immediately with fivetran debug. By default, you get a functional example connector to build from. Use the --template option to initialize from a community connector for a more complete starting point aligned to your use case.
After creating the project files, fivetran init automatically detects any installed AI coding agents and offers to install the Fivetran Connector SDK plugin for your chosen agent.
Signature
fivetran init [OPTIONS]
Parameters
| Flag | Required | Description |
|---|---|---|
"<project path>" | Optional | Specifies the project path, absolute or relative. If not provided, the command runs in the current directory. If the directory does not exist, it will be created. |
--template <repository path> | Optional | Specifies the template to initialize from. See Template routing for how paths resolve to source repositories. If you don't provide it, the default template connector is used - a fully functional example that runs immediately with fivetran debug without any modifications. |
--non-interactive | Optional | Automatically answers each y/n prompt with its default value (indicated by capital letter, e.g., y/N defaults to No). |
--yes | Optional | Automatically answers Yes to each y/n prompt. |
Template routing
The --template path prefix determines which GitHub repository the files are downloaded from:
| Path prefix | Source repository | Notes |
|---|---|---|
<slug> | fivetran/community_connectors | Community connectors. Recommended when a connector matching your use case exists. |
examples/<path> | fivetran/connector_sdk | Quickstart and pattern examples from the SDK repository. |
no --template flag (default) | fivetran/community_connectors | Uses the _template_connector directory as the starting point. |
AI coding agent setup
After project files are created, fivetran init checks your PATH for installed AI coding agents. If any of the following are detected, you are prompted to choose which one to install the Fivetran Connector SDK plugin for:
- Claude Code (
claude) - Codex CLI (
codex) - Gemini CLI (
gemini) - GitHub Copilot CLI (
copilot)
The plugin provides skills for building, testing, deploying, and evaluating connectors directly from your AI coding agent. If you prefer to install or update the plugin manually, or skip this step, choose Skip at the prompt or visit https://github.com/fivetran/connector_sdk_tools.
For fivetran init, both --non-interactive and --yes skip the optional AI agent setup step.
Note: If you face issues while installing the plugin for Codex, please upgrade to the latest version of Codex CLI.
Example
# Initialize a Connector SDK project in the current directory
fivetran init
# Initialize in a specific directory (which is created if it does not exist)
fivetran init ./my-new-connector-project
# Initialize from a community connector
fivetran init --template docusign
# Initialize from a quickstart example
fivetran init --template examples/quickstart/hello
# Initialize in a specific directory from an example, overwriting any existing files
fivetran init ./my-new-connector-project --template examples/quickstart/hello --yes
fivetran debug
Runs and debugs connector code locally. It tests and troubleshoots the connection's behavior with the source's actual data and generates a local warehouse.db file, a DuckDB representation of the data delivered by the connection to the destination. This process internally emulates Fivetran's core, and runs in the same process as the command.
To write data to an Apache Iceberg catalog instead of the warehouse.db file, run the fivetran run command.
Signature
fivetran debug [OPTIONS]
Parameters
| Flag | Required | Description |
|---|---|---|
--configuration | Optional | Path to the JSON file containing your connector's configuration values. If omitted, the CLI checks the FIVETRAN_CONFIGURATION environment variable, then looks for configuration.json in the project folder. Configuration must be available through one of these methods. Pass an empty configuration.json if your connector does not use configuration. For more information, see Working with configuration.json. |
--state | Optional | Specifies the path to a state.json file, relative to the project path or absolute. Its contents serve as the starting state for the local run, and each checkpoint writes to this file instead of files/state.json. The file must exist and hold a JSON object; otherwise, the command fails with an error. If not provided, the CLI checks the FIVETRAN_STATE environment variable for a file path, then looks for files/state.json, and falls back to an empty {} state if no file is found. |
--naming | Optional | Naming strategy for the local tester. FIVETRAN applies standardized transformations (lowercase, replaces special characters with underscores, transliterates non-ASCII). SOURCE preserves original schema, table, and column names with UTF-8 values without modification. See naming conventions for full transformation rules. If a warehouse.db already exists with a different strategy, the stored strategy is preserved and this flag is ignored with a warning. Defaults to FIVETRAN. Can also be set via the FIVETRAN_NAMING environment variable. |
"<project path>" | Optional | Specifies a non-default project path, absolute or relative. When omitted, the command runs in the current directory. |
Example
fivetran debug "/Users/fivetran/connector_sdk/sample_connector"
Notes
- The
warehouse.dbfile persists between runs. Usefivetran resetto clear it and start a fresh sync from scratch. - The
--namingstrategy is locked to the value used whenwarehouse.dbwas first created. Passing a different--namingon a subsequent run is ignored with a warning, and the stored strategy is used for the session. - Defaults can be set via environment variables.
- If the run fails, the error is shown once, with its traceback, and a crash report is saved in the
crash-reportsfolder of your project.
fivetran run
Runs your connector locally and writes the data to an Apache Iceberg REST catalog that you describe in a destination.json file, instead of the local warehouse.db file. The data goes to your catalog, not to Fivetran. For the format of destination.json, what is written, and what is not supported, see Write to an Iceberg catalog.
Signature
fivetran run [OPTIONS]
Parameters
| Flag | Required | Description |
|---|---|---|
--destination-file | Optional | Path to the JSON file that describes the catalog, relative to the current directory or absolute. If omitted, the command reads destination.json from the project folder. If neither exists, the command stops with an error. |
--configuration | Optional | Path to the JSON file containing your connector's configuration values. If omitted, the CLI checks the FIVETRAN_CONFIGURATION environment variable, then looks for configuration.json in the project folder. Configuration must be available through one of these methods. Pass an empty configuration.json if your connector does not use configuration. For more information, see Working with configuration.json. |
--state | Optional | Specifies the path to a state.json file, relative to the project path or absolute. Its contents serve as the starting state for the local run, and each checkpoint writes to this file instead of files/state.json. The file must exist and hold a JSON object; otherwise, the command fails with an error. If not provided, the CLI checks the FIVETRAN_STATE environment variable for a file path, then looks for files/state.json, and falls back to an empty {} state if no file is found. |
--naming | Optional | Naming strategy for the namespace and tables. Same values as for fivetran debug. The strategy of the first run is kept with the namespace, and a later --naming that differs is ignored with a warning. Defaults to FIVETRAN. |
"<project path>" | Optional | Specifies a non-default project path, absolute or relative. When omitted, the command runs in the current directory. |
Example
fivetran run
fivetran run --destination-file ~/catalogs/my_catalog.json "/Users/fivetran/connector_sdk/sample_connector"
Notes
- Use a namespace that is used only for your connector.
fivetran rundoes not ask for confirmation and changes any table with the same name that is already in the namespace. - On the first run, DuckDB downloads its Iceberg extension, so the machine needs internet access.
fivetran configuration
Interactively collects configuration values from setup form fields and writes them to configuration.json. Use --test to run setup tests registered with ConfigurationForm.add_test().
Signature
fivetran configuration [OPTIONS]
Parameters
| Flag | Required | Description |
|---|---|---|
--test | Optional | Runs setup tests instead of collecting configuration values. |
--non-interactive | Optional | Automatically answers each y/n prompt with its default value (indicated by capital letter, e.g., y/N defaults to No). |
--yes | Optional | Automatically answers Yes to each y/n prompt. |
"<project path>" | Optional | Specifies a non-default project path, absolute or relative. When omitted, the command runs in the current directory. |
Example
fivetran configuration
fivetran configuration --test
fivetran configuration --non-interactive
fivetran configuration --yes
Notes
- Requires a connector that defines a setup form using the
configuration_formmethod. If the connector does not define one, this command exits without generatingconfiguration.json. fivetran configurationwritesconfiguration.jsonto the project directory (current directory by default). If aconfiguration.jsonalready exists there, it overwrites the file only after confirmation. Use--yesto overwrite without confirmation.fivetran configuration --testrequires an existingconfiguration.json.
fivetran reset
Deletes the current local state.json and warehouse.db file. It allows to re-run fivetran debug from scratch. This simulates the initial sync as the connector behaves as if it is running for the first time.
Signature
fivetran reset [OPTIONS]
Parameters
| Flag | Required | Description |
|---|---|---|
"<project path>" | Optional | Specify non-default project path, absolute or relative. When omitted, command runs in current directory |
Example
fivetran reset
fivetran deploy
Deploys your Connector SDK code to Fivetran, creating or updating a connection. If a connection with the specified name already exists in the destination, the CLI prompts you to confirm whether to overwrite it.
fivetran deploy takes deployment options, which configure where and how your connector is deployed. You can pass these options explicitly through the supported CLI flags. Alternatively, you can set them through environment variables. Starting with fivetran-connector-sdk v3.0.0, you can also store select deployment options in a local deployment options file. The following table outlines all supported deployment options and the various ways of configuring them.
Signature
fivetran deploy [OPTIONS]
Deployment options
| Option | Description | CLI flag | Equivalent environment variable | Storable in options file |
|---|---|---|---|---|
| API key | Required. Fivetran API key for deployment. | --api-key <BASE_64_ENCODED_API_KEY> | FIVETRAN_API_KEY | No |
| Destination | Required. Destination name in your Fivetran account. | --destination <DESTINATION_NAME> | FIVETRAN_DESTINATION_NAME | Yes |
| Connection | Required. Connection name in the destination. | --connection <CONNECTION_NAME> | FIVETRAN_CONNECTION_NAME | Yes |
| Configuration | Path to the JSON file containing your connector's configuration values. If omitted, the CLI looks for configuration.json in the project folder. Configuration must be available through one of these methods. Pass an empty configuration.json if your connector does not use configuration. For more information, see Working with configuration.json. | --configuration | FIVETRAN_CONFIGURATION | No |
| Python version | Python runtime version. | --python <Python version number>, --python-version <Python version number> | FIVETRAN_PYTHON_VERSION | Yes |
| Hybrid deployment agent ID | ID of a custom Hybrid Deployment agent to use instead of the destination's default agent. When not set for a new connection, the CLI uses the destination's default agent. | --hybrid-deployment-agent-id <ID> | FIVETRAN_HD_AGENT_ID | Yes |
| Proxy ID | Proxy Agent ID from your Fivetran dashboard. Routes your connector's traffic to the data source through Proxy Agent. You can't use this option with --hybrid-deployment-agent-id. When not set, the connection uses direct networking. | --proxy-id <ID> | - | Yes |
| Proxy host config key | The key in configuration.json whose value contains the host:port endpoint. Required only when your configuration.json uses a custom key instead of the standard host or hosts keys. Only valid when --proxy-id is also provided. | --proxy-host-config-key <KEY> | - | Yes |
| Naming | Naming strategy for the connection schema. FIVETRAN applies standardized transformations (lowercase, replaces special characters with underscores, transliterates non-ASCII). SOURCE preserves original schema, table, and column names with UTF-8 values without modification. See naming conventions for full transformation rules. Only applied when creating a new connection; ignored with a warning if the connection already exists. Defaults to FIVETRAN. | --naming | FIVETRAN_NAMING | Yes |
| Package ID | ID of an existing package to use for the connection. When set, the CLI reuses the package and skips uploading new code. | --package-id <ID> | - | Yes |
| Deployment options file | Path to a local deployment options file. Requires Python 3.11 or later. If omitted, the CLI searches the current directory, then ~/.fivetran/connector_sdk/. See File discovery. | --options-file <PATH> | FIVETRAN_OPTIONS_FILE | - |
| Profile | Selects a named profile from the local deployment options file. Profiles group deployment options under a named label, for example development or production, making it easy to switch between environments without repeating flags. If omitted, the CLI looks for and uses a [default] profile. If you specify a profile and no deployment options file exists, the deploy fails. | --profile <NAME> | - | - |
| Non-interactive | Automatically answers each y/n prompt with its default value (indicated by capital letter, e.g., y/N defaults to No). Does not supply missing required values. | --non-interactive | - | - |
| Yes | Automatically answers Yes to each y/n prompt. | --yes | - | - |
| Project path | Absolute or relative path to the connector project. Defaults to the current directory. | "<PROJECT_PATH>" | - | - |
Field resolution order
For each deployment option, the CLI takes the first value it finds, in this order:
- CLI flag
- Environment variable
- Deployment options file, using the selected profile
- SDK built-in default; if none exists and the option is required, the deploy fails with a clear error
For python_version and hybrid_deployment_agent_id, step 4 behaves differently depending on whether the connection already exists. For new connections, an unresolved python_version falls back to the SDK built-in default, and an unresolved hybrid_deployment_agent_id falls back to the destination's default agent, where applicable. For existing connections, the deploy fails and asks you to provide python_version explicitly, and hybrid_deployment_agent_id if the connection is in a Hybrid Deployment destination.
Versions before v3.0.0 don't read a deployment options file. Required fields resolve from CLI flags, then fall back to environment variables, then fail if unresolved. Optional fields you omit are left out of the deploy request; the server reuses its previously saved value for an existing connection or applies its own default for a new one.
Examples
Deploy using CLI flags
fivetran deploy --api-key <API_KEY> --destination Snowflake --connection my_connection
# Deploy with a Proxy Agent and a custom host key
fivetran deploy --api-key <API_KEY> --destination Snowflake --connection my_connection \
--proxy-id <PROXY_AGENT_ID> --proxy-host-config-key db_endpoint
Deploy using environment variables
export FIVETRAN_API_KEY=<API_KEY>
export FIVETRAN_DESTINATION_NAME=Snowflake
export FIVETRAN_CONNECTION_NAME=my_connection
fivetran deploy
Deploy using a deployment options file profile
The following examples show the different ways to select the deployment options file and profile.
Never store the API key in a deployment options file; always provide it with --api-key or the FIVETRAN_API_KEY environment variable.
Specify both the options file and the profile
fivetran deploy --api-key <API_KEY> --options-file ./config/options.toml --profile development
Use the default deployment options file location and specify a profile
The CLI looks for options.toml in the current directory, then in ~/.fivetran/connector_sdk/. See File discovery.
fivetran deploy --api-key <API_KEY> --profile development
Specify neither the options file nor the profile
The CLI uses the deployment options file from the default location and the [default] profile, if it exists.
fivetran deploy --api-key <API_KEY>
Redeploy without confirmation
Use --yes to skip the overwrite confirmation prompt. This example assumes you set FIVETRAN_API_KEY and provide the Python version through FIVETRAN_PYTHON_VERSION or the selected options-file profile. For an existing connection in a Hybrid Deployment destination, also provide the agent ID through FIVETRAN_HD_AGENT_ID or that profile:
fivetran deploy --destination Snowflake --connection my_connection --python-version 3.14 --yes
Command output
Every deploy logs the resolved value and source for each managed field:
reading options from /home/user/.fivetran/connector_sdk/options.toml
resolved options:
destination = Testing (provided via --destination)
connection = my_connection (provided via --connection)
python_version = 3.11 (provided via options file, profile [group_id_a-connection_a])
naming = FIVETRAN_NAMING (using SDK built-in default)
proxy_id = proxy-1 (provided via options file, profile [group_id_a-connection_a])
If a required field cannot be resolved, deployment fails before anything is created or updated and all missing fields are reported together:
--destination is required; provide it via the --destination flag, the FIVETRAN_DESTINATION_NAME environment variable, or the options file (profile [default]) --connection is required; provide it via the --connection flag, the FIVETRAN_CONNECTION_NAME environment variable, or the options file (profile [default])
Notes
- When using
fivetran deploy, ensure that your code is structured accordingly and all dependencies are listed inrequirements.txtorpyproject.toml. We don't consider theconfiguration.jsonanddestination.jsonfile as part of the code upload. --non-interactiveuses the default answer for eachy/nprompt (indicated by capital letter, e.g.,y/Ndefaults to No). It does not supply missing required values.--yesalways answersYestoy/nprompts.
fivetran package
Creates a local ZIP package of your connector code without deploying it to Fivetran. Once you have created the package, you can upload it to Fivetran using the Connector SDK Package Management API. This is useful for REST API deployment workflows, version control, archiving your code, or manual inspection of package contents before deployment.
Signature
fivetran package [OPTIONS]
Parameters
| Flag | Required | Description |
|---|---|---|
"<project path>" | Optional | Specifies non-default project path, absolute or relative. When omitted, command runs in current directory. |
--non-interactive | Optional | Automatically answers each y/n prompt with its default value (indicated by capital letter, e.g., y/N defaults to No). |
--yes | Optional | Automatically answers Yes to each y/n prompt. |
Example
fivetran package
fivetran package "/Users/fivetran/connector_sdk/my_connector"
fivetran package --non-interactive
fivetran package --yes
Output
Creates a ZIP file at <project_path>/files/<project_name>.zip containing:
- All files except
configuration.jsonanddestination.json.
Notes
The fivetran package command does the following when creating a package:
- Validates
requirements.txtorpyproject.tomlby default (use--non-interactiveor--yesto skip). - Respects
.gitignorepatterns. - Saves the created package in the
files/subdirectory within your project.
fivetran version
Displays installed SDK version. Version is required for getting support from Fivetran and troubleshooting issues.
fivetran version # This format works.
fivetran --version # This format works as well.
fivetran --help
Lists all available commands and parameters.
fivetran --help