|
| 1 | +# Source Declarative Manifest CLI Usage Guide |
| 2 | + |
| 3 | +This guide explains how to install and use the Source Declarative Manifest (SDM) CLI tool for Airbyte connector development. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +### Standard Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +pipx install airbyte-cdk |
| 11 | +``` |
| 12 | + |
| 13 | +### Alternative Installation (If encountering distutils errors) |
| 14 | + |
| 15 | +If you encounter errors related to missing distutils module, try using this alternative approach: |
| 16 | + |
| 17 | +```bash |
| 18 | +python -m pip install --user pipx |
| 19 | +python -m pipx install airbyte-cdk |
| 20 | +``` |
| 21 | + |
| 22 | +## Using the CLI |
| 23 | + |
| 24 | +The SDM CLI follows standard Airbyte connector command patterns: |
| 25 | + |
| 26 | +```bash |
| 27 | +source-declarative-manifest [command] --config /path/to/config.json |
| 28 | +``` |
| 29 | + |
| 30 | +Where [command] can be: |
| 31 | + |
| 32 | +spec - Show connector specification |
| 33 | +check - Verify connection to the source |
| 34 | +discover - List available streams |
| 35 | +read - Read data from streams |
| 36 | + |
| 37 | +:::caution |
| 38 | +When developing locally (outside a Docker container), the CLI operates in "remote manifest mode" and expects your manifest to be included in your configuration file. |
| 39 | +::: |
| 40 | + |
| 41 | +### Steps for Local Testing |
| 42 | + |
| 43 | +1. Convert your manifest from YAML to JSON |
| 44 | + |
| 45 | +Your manifest is defined in YAML, but must be converted to JSON for the config file. You can use an [online tool](https://onlineyamltools.com/convert-yaml-to-json) to do so. |
| 46 | + |
| 47 | +Create a config file that includes both your config parameters AND the manifest. Add your entire manifest as a JSON object under the `__injected_declarative_manifest` key |
| 48 | + |
| 49 | +Example: |
| 50 | + |
| 51 | +```json |
| 52 | +{ |
| 53 | + "api_key": "very_secret_key", |
| 54 | + "start_time": "04:20", |
| 55 | + "__injected_declarative_manifest": { |
| 56 | + // Insert the JSON version of your manifest here |
| 57 | + } |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +2. Run the command with your config file |
| 62 | + |
| 63 | +```bash |
| 64 | +source-declarative-manifest check --config /relative/path/to/your/config.json |
| 65 | +``` |
0 commit comments