Metadata-Version: 2.4
Name: fivetran-cli
Version: 0.1.3
Summary: Command line wrapper for the Fivetran REST API
Author: Fivetran
License-Expression: MIT
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# fivetran-cli

Thin command line wrapper around the Fivetran REST API.

```text
fivetran [global-options] <resource> <operation> [arguments] [options]
```

Credentials default to `FIVETRAN_API_KEY`. Set it to the single Base64-encoded API key shown by Fivetran.

```bash
fivetran --api-key "$FIVETRAN_API_KEY" connection list
fivetran connection create --data-file connection.json
```

## Usage

Global options may be placed before or after the resource command.

```bash
fivetran connection list --api-key "$FIVETRAN_API_KEY"
fivetran connection-schema get connection_id
fivetran connector-metadata get google_ads
fivetran public-connector list
```

Output defaults to compact raw JSON for scripting. Use `--pretty` for readable output. Pretty output renders list responses as compact item blocks and detail responses as key/value sections.

```bash
fivetran connection list --pretty
fivetran connection get connection_id --pretty
```

Request body commands accept either raw JSON or a JSON file:

```bash
fivetran private-link create --data-file private-link.json
fivetran connection-schema column update connection_id schema table column --data '{"enabled":false}'
```

Destructive commands require `--yes` in non-interactive mode.

## Included Commands

Core resources:

- `account get`
- `connection list|get|create|update|delete|sync|resync|test`
- `destination list|get|create|update|delete|test`
- `group list|get|create|update|delete`
- `group connection list`
- `group user list|add|remove`
- `group public-key get`
- `group service-account get`

Access management:

- `user list|get|invite|update|delete`
- `user account-role remove`
- `user connection list|get|add|update|remove`
- `user group list|get|add|update|remove`
- `team list|get|create|update|delete`
- `team account-role remove`
- `team connection list|get|add|update|remove`
- `team group list|get|add|update|remove`
- `team user list|get|add|update|remove`
- `role list`
- `system-key list|get|create|update|delete|rotate`

Schemas and metadata:

- `connection-schema get|setup|update|reload|resync-table`
- `connection-schema schema update`
- `connection-schema table update`
- `connection-schema column list|update|drop|drop-blocked`
- `connector-metadata list|get`
- `public-connector list`

Networking:

- `hybrid-deployment-agent list|get|create|delete|regenerate-auth|reset-credentials`
- `proxy-agent list|get|create|delete|regenerate-secrets`
- `proxy-agent connection list`
- `private-link list|get|create|update|delete`

Transformations:

- `transformation list`

## Not Included Yet

These API areas are still intentionally not implemented:

- Certificates and fingerprints
- Connector SDK packages
- Log services
- Webhooks
- Transformation create/get/update/delete/run/cancel/upgrade
- Transformation package metadata
- Transformation projects
- Hub registration
- Group destination listing, pending confirmation of a supported REST endpoint
- Interactive connector setup workflows
- File upload/download handling for Connector SDK packages
- High-quality resource-specific pretty views beyond the generic renderer

## Build And Publish

Package artifacts are controlled by `pyproject.toml` and `MANIFEST.in`. The source distribution intentionally excludes local agent/project-planning files:

- `AGENTS.md`
- `plans/`

Install local packaging tools with `pipx`:

```bash
pipx install build
pipx install twine
```

This exposes `pyproject-build` and `twine` on your PATH. If you install these tools into a virtual environment instead, use `python3 -m build` and `python3 -m twine` in place of the commands below.

Build source and wheel distributions:

```bash
pyproject-build
```

Validate the generated artifacts:

```bash
twine check dist/*
```

Upload to TestPyPI first:

```bash
twine upload --repository testpypi dist/*
```

Install from TestPyPI in a clean environment:

```bash
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ fivetran-cli
fivetran --help
```

Upload to PyPI after the TestPyPI package is verified:

```bash
twine upload dist/*
```

These upload commands assume `~/.pypirc` is configured with the `pypi` and `testpypi` repositories. If `~/.pypirc` is not configured, set `TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<api-token>` before running `twine upload`.

PyPI files are immutable for a published version. If an upload is wrong, bump the version in `pyproject.toml`, rebuild, re-check, and upload the new version.
