Metadata-Version: 2.4
Name: fivetran_cli
Version: 1.0.0
Summary: Command line wrapper for the Fivetran REST API and Connector SDK
Author-email: Fivetran <developers@fivetran.com>
Project-URL: Homepage, https://fivetran.com
Project-URL: Github, https://github.com/fivetran/engineering
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: rich>=13.0
Requires-Dist: requests==2.34.2
Requires-Dist: fivetran-connector-sdk>2.10.4

# fivetran-cli

The Fivetran CLI lets you manage your Fivetran account from the terminal. Supported operations include creating and updating connections, controlling schema settings, managing users and teams, deploying custom connectors, and more.

To learn more, see our [Fivetran CLI documentation](https://fivetran.com/docs/developer-resources/fivetran-cli)

## **Install**

    pip install fivetran-cli

Verify the installation:

    fivetran --version

## Requirements

- Python 3.10 or later
- A Fivetran account and API key for commands that communicate with Fivetran

## Authentication

Fivetran API commands require a Base64-encoded API key. Set it as an environment variable:

    export FIVETRAN_API_KEY="<base64-encoded-api-key>"

You can also pass the key to an individual command with `--api-key`:

    fivetran beta connection list --api-key "<base64-encoded-api-key>"

See the [Fivetran REST API getting started guide](https://fivetran.com/docs/developer-resources/rest-api/getting-started) for instructions on creating and encoding an API key.

## REST API commands

REST API operations use the following command structure:

    fivetran beta <resource> <operation> [options]

For example:

List up to 10 connections:

    fivetran beta connection list --limit 10

Retrieve one connection:

    fivetran beta connection get --connection-id <connection-id>

Trigger a connection sync:

    fivetran beta connection sync --connection-id <connection-id>

Use `--help` to discover the available resources, operations, and command-specific options:

    fivetran beta --help
    fivetran beta connection --help
    fivetran beta connection list --help

### Request payloads

Commands that accept a request body support inline JSON, a JSON file, or standard input:

    fivetran beta connection create --config '{"group_id":"<group-id>","service":"<service>"}'
    fivetran beta connection create --config-file connection.json

Refer to the [Fivetran REST API reference](https://fivetran.com/docs/developer-resources/rest-api) for the fields required by each operation.

## Output options

REST API commands produce readable terminal output by default. The following options control how successful results are displayed:

| Option | Description |
| --- | --- |
| `--output text` | Use formatted terminal output. This is the default. |
| `--output json` | Write the complete response as JSON. |
| `--fields id,service` | Display only the selected fields or columns. |
| `--all-columns` | Show all columns instead of the default 8. |
| `--output-file <path>` | Write successful output to a file instead of stdout. |

Examples:

Return machine-readable output:

    fivetran beta connection list --output json

Select columns for a compact table:

    fivetran beta connection list --fields id,service,schema

Write the complete response to a file:

    fivetran beta connection list --output json --output-file connections.json

## Connector SDK commands

Installing `fivetran-cli` also installs the Fivetran Connector SDK. Its commands remain available through the same `fivetran` executable:

Run a connector locally:

    fivetran debug

Deploy a connector to Fivetran:

    fivetran deploy

See the [Connector SDK getting started guide](https://fivetran.com/docs/connector-sdk/getting-started) and [Connector SDK CLI command reference](https://fivetran.com/docs/connector-sdk/getting-started/connector-sdk-commands) for details.

## Help

Run the following command to see all installed commands, including commands provided by Connector SDK plugins:

    fivetran --help

## Maintenance

This package is actively maintained by Fivetran developers. Contact the [Fivetran Support team](https://support.fivetran.com/hc/en-us) for assistance.
