Skip to content

Commit 908488c

Browse files
authored
Merge branch 'main' into fix/security-dependency-updates
2 parents 51330fb + 4629a12 commit 908488c

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

airbyte_cdk/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
- `airbyte_cdk.models.airbyte_protocol`
3333
- `airbyte_cdk.models.airbyte_protocol_serializers`
3434
35+
## Using the CLI (`airbyte_cdk.cli`)
36+
37+
The Airbyte CDK provides two command-line interfaces (CLIs) for interacting with the framework.
38+
39+
- `airbyte-cdk`: This is the main CLI for the Airbyte CDK. It provides commands for building
40+
and testing connectors, as well as other utilities. See the `airbyte_cdk.cli.airbyte_cdk` module
41+
for more details.
42+
- `source-declarative-manifest`: This command allows you to run declarative manifests directly.
43+
See the `airbyte_cdk.cli.source_declarative_manifest` module for more details.
44+
3545
---
3646
3747
API Reference
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Source Declarative Manifest CLI
2+
3+
The source-declarative-manifest CLI is included in the airbyte-cdk package.
4+
This CLI enables connector interfaces to be run locally on manifest-only connectors,
5+
much like we already do with Python connectors.
6+
7+
## Installation
8+
9+
The airbyte-cdk library can be installed globally using pipx:
10+
11+
```bash
12+
pipx install airbyte-cdk
13+
```
14+
15+
If you are using a cloned airbyte-python-cdk repo locally,
16+
you can also create a virtual environment to enable the CLI.
17+
From the root directory of airbyte-python-cdk:
18+
19+
```bash
20+
python -m venv .venv
21+
source .venv/bin/activate
22+
pip install -e .
23+
```
24+
25+
## Usage
26+
27+
### Options
28+
29+
--help: displays the list of available commands
30+
31+
### Commands
32+
33+
- spec: Outputs the JSON configuration specification. NOTE: This currently just outputs the base source-declarative-manifest spec
34+
- check: Runs a connection_check to verify a connection can be made with the passed config
35+
- discover: Outputs a catalog describing the source's schema
36+
- read: Reads the source using the passed config and catalog, and outputs messages to STDOUT
37+
38+
### Command options
39+
40+
- --config: The relative path to the config to inject into SDM.
41+
- --catalog: The relative path to the configured catalog.
42+
- --state: The relative path to the state object to pass. Only used when running an incremental read.
43+
- --manifest-path: The relative path to the local YAML manifest to inject into SDM.
44+
- --components-path: The relative path to the custom components to mount, if they exist.
45+
46+
| Option | spec | check | discover | read |
47+
| ------------------- | ---- | -------- | -------- | -------- |
48+
| `--config` || required | required | required |
49+
| `--catalog` ||| required | required |
50+
| `--state` |||| optional |
51+
| `--manifest-path` || required | required | required |
52+
| `--components-path` || optional | optional | optional |
53+
54+
### Examples
55+
56+
Here are some basic examples of how to run source-declarative-manifest commands locally.
57+
Note that the paths are relative. These examples assume the user is currently at the root level of a connector dir:
58+
59+
```bash
60+
source-declarative-manifest check --config secrets/config.json --manifest-path manifest.yaml
61+
```
62+
63+
```bash
64+
source-declarative-manifest read --config secrets/config.json --catalog integration_tests/configured_catalog.json --manifest-path manifest.yaml --components-path components.py
65+
```

airbyte_cdk/cli/source_declarative_manifest/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
.. include:: ./README.md
3+
:start-line: 2
4+
"""
5+
16
from airbyte_cdk.cli.source_declarative_manifest._run import run
27

38
__all__ = [

airbyte_cdk/cli/source_declarative_manifest/_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,9 @@ def _register_components_from_file(filepath: str) -> None:
299299

300300

301301
def run() -> None:
302+
"""Run the `source-declarative-manifest` CLI.
303+
304+
Args are detected from the command line, and the appropriate command is executed.
305+
"""
302306
args: list[str] = sys.argv[1:]
303307
handle_command(args)

0 commit comments

Comments
 (0)