Skip to content

Commit 563e9f5

Browse files
committed
feat: Added the components CLI scaffold
1 parent 9dc48fe commit 563e9f5

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

tangle_cli/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import typer
22

33
from . import api_cli
4+
from . import components_cli
45

56
app = typer.Typer(
67
no_args_is_help=True,
@@ -10,6 +11,7 @@
1011
)
1112

1213
app.add_typer(api_cli.app, name="api")
14+
app.add_typer(components_cli.app, name="components")
1315

1416

1517
if __name__ == "__main__":

tangle_cli/components_cli.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import pathlib
2+
3+
import typer
4+
5+
app = typer.Typer(no_args_is_help=True)
6+
7+
generate_app = typer.Typer(no_args_is_help=True)
8+
app.add_typer(generate_app, name="generate", no_args_is_help=True)
9+
10+
component_references_app = typer.Typer(no_args_is_help=True)
11+
app.add_typer(
12+
component_references_app, name="component-references", no_args_is_help=True
13+
)
14+
15+
annotations_app = typer.Typer(no_args_is_help=True)
16+
app.add_typer(annotations_app, name="annotations", no_args_is_help=True)
17+
18+
# region components
19+
20+
21+
@app.command(name="validate")
22+
def components_validate(component_path: str):
23+
raise NotImplementedError()
24+
25+
26+
@app.command(name="set-container-image")
27+
def components_set_container_image(component_path: str):
28+
raise NotImplementedError()
29+
30+
31+
# endregion
32+
33+
34+
# region components/annotations
35+
36+
37+
@annotations_app.command(name="set", no_args_is_help=True)
38+
def components_annotations_set(
39+
component_path: str, key: str, value: str, output_component_path: str | None = None
40+
):
41+
"""Sets annotation value in component file."""
42+
raise NotImplementedError()
43+
44+
45+
@annotations_app.command(name="get", no_args_is_help=True)
46+
def components_annotations_get(component_path: str, keys: list[str]):
47+
"""Sets annotation values from component file."""
48+
print(locals())
49+
raise NotImplementedError()
50+
51+
52+
# endregion
53+
54+
55+
# region components/generate
56+
57+
58+
@generate_app.command(name="from-template", hidden=True)
59+
def components_generate_from_template(
60+
template_name: str,
61+
output_component_path: pathlib.Path,
62+
):
63+
raise NotImplementedError()
64+
65+
66+
@generate_app.command(name="from-python-function")
67+
def components_generate_from_python_function(output_component_path: str):
68+
"""
69+
Generates component from a Python function
70+
"""
71+
raise NotImplementedError()
72+
73+
74+
# endregion

0 commit comments

Comments
 (0)