Skip to content

Commit 27ff264

Browse files
authored
Merge pull request #101 from dlt-hub/feat/84-track-cli-command
add tracking of cli command
2 parents c7fcdc3 + d6a3d9c commit 27ff264

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ And use it with the config argument:
126126
$ dlt-init-openapi init pokemon --url ... --config config.yml
127127
```
128128

129+
## Telemetry
130+
We track your usage of this tool similar to how we track other commands in the dlt core library. Read more about this and how to disable it here: https://dlthub.com/docs/reference/telemetry.
131+
129132
## Implementation notes
130133
* OAuth Authentication currently is not natively supported, you can supply your own
131134
* Per endpoint authentication currently is not supported by the generator, only the first globally set securityScheme will be applied. You can add your own per endpoint if you need to.

dlt_init_openapi/cli/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import questionary
66
import typer
7+
from dlt.cli import utils
78
from loguru import logger
89

910
from dlt_init_openapi.cli.cli_endpoint_selection import questionary_endpoint_selection
@@ -60,6 +61,32 @@ def init(
6061
),
6162
) -> None:
6263
"""Generate a new OpenAPI Client library"""
64+
_init_command_wrapped(
65+
source=source,
66+
url=url,
67+
path=path,
68+
output_path=output_path,
69+
config_path=config_path,
70+
interactive=interactive,
71+
loglevel=loglevel,
72+
global_limit=global_limit,
73+
update_rest_api_source=update_rest_api_source,
74+
)
75+
76+
77+
@utils.track_command("init-openapi", False, "source", "url", "path")
78+
def _init_command_wrapped(
79+
source: str,
80+
url: Optional[str] = None,
81+
path: Optional[pathlib.Path] = None,
82+
output_path: Optional[pathlib.Path] = None,
83+
config_path: Optional[pathlib.Path] = None,
84+
interactive: bool = True,
85+
loglevel: int = 20,
86+
global_limit: int = 0,
87+
update_rest_api_source: bool = False,
88+
) -> None:
89+
6390
from dlt_init_openapi import create_new_client
6491

6592
# set up console logging

0 commit comments

Comments
 (0)