ara-cli 0.1.10.0__py3-none-any.whl → 0.1.13.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ara_cli/__init__.py +51 -6
- ara_cli/__main__.py +270 -103
- ara_cli/ara_command_action.py +106 -63
- ara_cli/ara_config.py +187 -128
- ara_cli/ara_subcommands/__init__.py +0 -0
- ara_cli/ara_subcommands/autofix.py +26 -0
- ara_cli/ara_subcommands/chat.py +27 -0
- ara_cli/ara_subcommands/classifier_directory.py +16 -0
- ara_cli/ara_subcommands/common.py +100 -0
- ara_cli/ara_subcommands/config.py +221 -0
- ara_cli/ara_subcommands/convert.py +43 -0
- ara_cli/ara_subcommands/create.py +75 -0
- ara_cli/ara_subcommands/delete.py +22 -0
- ara_cli/ara_subcommands/extract.py +22 -0
- ara_cli/ara_subcommands/fetch.py +41 -0
- ara_cli/ara_subcommands/fetch_agents.py +22 -0
- ara_cli/ara_subcommands/fetch_scripts.py +19 -0
- ara_cli/ara_subcommands/fetch_templates.py +19 -0
- ara_cli/ara_subcommands/list.py +139 -0
- ara_cli/ara_subcommands/list_tags.py +25 -0
- ara_cli/ara_subcommands/load.py +48 -0
- ara_cli/ara_subcommands/prompt.py +136 -0
- ara_cli/ara_subcommands/read.py +47 -0
- ara_cli/ara_subcommands/read_status.py +20 -0
- ara_cli/ara_subcommands/read_user.py +20 -0
- ara_cli/ara_subcommands/reconnect.py +27 -0
- ara_cli/ara_subcommands/rename.py +22 -0
- ara_cli/ara_subcommands/scan.py +14 -0
- ara_cli/ara_subcommands/set_status.py +22 -0
- ara_cli/ara_subcommands/set_user.py +22 -0
- ara_cli/ara_subcommands/template.py +16 -0
- ara_cli/artefact_autofix.py +154 -63
- ara_cli/artefact_converter.py +256 -0
- ara_cli/artefact_models/artefact_model.py +106 -25
- ara_cli/artefact_models/artefact_templates.py +20 -10
- ara_cli/artefact_models/epic_artefact_model.py +11 -2
- ara_cli/artefact_models/feature_artefact_model.py +31 -1
- ara_cli/artefact_models/userstory_artefact_model.py +15 -3
- ara_cli/artefact_scan.py +2 -2
- ara_cli/chat.py +283 -80
- ara_cli/chat_agent/__init__.py +0 -0
- ara_cli/chat_agent/agent_process_manager.py +155 -0
- ara_cli/chat_script_runner/__init__.py +0 -0
- ara_cli/chat_script_runner/script_completer.py +23 -0
- ara_cli/chat_script_runner/script_finder.py +41 -0
- ara_cli/chat_script_runner/script_lister.py +36 -0
- ara_cli/chat_script_runner/script_runner.py +36 -0
- ara_cli/chat_web_search/__init__.py +0 -0
- ara_cli/chat_web_search/web_search.py +263 -0
- ara_cli/commands/agent_run_command.py +98 -0
- ara_cli/commands/fetch_agents_command.py +106 -0
- ara_cli/commands/fetch_scripts_command.py +43 -0
- ara_cli/commands/fetch_templates_command.py +39 -0
- ara_cli/commands/fetch_templates_commands.py +39 -0
- ara_cli/commands/list_agents_command.py +39 -0
- ara_cli/commands/read_command.py +17 -4
- ara_cli/completers.py +180 -0
- ara_cli/constants.py +2 -0
- ara_cli/directory_navigator.py +37 -4
- ara_cli/file_loaders/text_file_loader.py +2 -2
- ara_cli/global_file_lister.py +5 -15
- ara_cli/llm_utils.py +58 -0
- ara_cli/prompt_chat.py +20 -4
- ara_cli/prompt_extractor.py +199 -76
- ara_cli/prompt_handler.py +160 -59
- ara_cli/tag_extractor.py +38 -18
- ara_cli/template_loader.py +3 -2
- ara_cli/template_manager.py +52 -21
- ara_cli/templates/global-scripts/hello_global.py +1 -0
- ara_cli/templates/prompt-modules/commands/add_scenarios_for_new_behaviour.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/align_feature_with_implementation_changes.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/analyze_codebase_and_plan_tasks.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/choose_best_parent_artefact.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/create_tasks_from_artefact_content.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/create_tests_for_uncovered_modules.test_generation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/derive_features_from_video_description.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/describe_agent_capabilities.agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
- ara_cli/templates/prompt-modules/commands/execute_scoped_todos_in_task.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/explain_single_file_purpose.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/extract_file_information_bullets.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
- ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
- ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
- ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
- ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
- ara_cli/templates/prompt-modules/commands/fix_failing_behave_step_definitions.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/fix_failing_pytest_tests.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/general_instruction_policy.commands.md +47 -0
- ara_cli/templates/prompt-modules/commands/generate_and_fix_pytest_tests.test_generation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
- ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
- ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
- ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
- ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
- ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
- ara_cli/templates/prompt-modules/commands/suggest_next_story_child_tasks.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/summarize_or_transcribe_media.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/update_feature_to_match_implementation.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/update_user_story_with_requirements.interview_agent.commands.md +1 -0
- ara_cli/version.py +1 -1
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/METADATA +34 -1
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/RECORD +123 -54
- tests/test_ara_command_action.py +31 -19
- tests/test_ara_config.py +177 -90
- tests/test_artefact_autofix.py +170 -97
- tests/test_artefact_autofix_integration.py +495 -0
- tests/test_artefact_converter.py +357 -0
- tests/test_artefact_extraction.py +564 -0
- tests/test_artefact_scan.py +1 -1
- tests/test_chat.py +162 -126
- tests/test_chat_givens_images.py +603 -0
- tests/test_chat_script_runner.py +454 -0
- tests/test_global_file_lister.py +1 -1
- tests/test_llm_utils.py +164 -0
- tests/test_prompt_chat.py +343 -0
- tests/test_prompt_extractor.py +683 -0
- tests/test_prompt_handler.py +12 -4
- tests/test_tag_extractor.py +19 -13
- tests/test_web_search.py +467 -0
- ara_cli/ara_command_parser.py +0 -605
- ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
- ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
- ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
- ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
- ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
- ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
- ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
- ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
- ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
- ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
- ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
- ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
- ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
- ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
- ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
- ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/WHEEL +0 -0
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/entry_points.txt +0 -0
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import TemplateTypeEnum, MockArgs, TemplateTypeArgument, ChatNameArgument
|
|
3
|
+
from ara_cli.ara_command_action import load_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def create_template_name_completer():
|
|
7
|
+
"""Create a template name completer that can access the template_type context."""
|
|
8
|
+
def completer(incomplete: str) -> list[str]:
|
|
9
|
+
# This is a simplified version - in practice, you'd need to access
|
|
10
|
+
# the template_type from the current command context
|
|
11
|
+
from ara_cli.template_loader import TemplateLoader
|
|
12
|
+
import os
|
|
13
|
+
|
|
14
|
+
# For all template types since we can't easily get context in typer
|
|
15
|
+
all_templates = []
|
|
16
|
+
for template_type in ['rules', 'intention', 'commands', 'blueprint']:
|
|
17
|
+
try:
|
|
18
|
+
loader = TemplateLoader()
|
|
19
|
+
templates = loader.get_available_templates(template_type, os.getcwd())
|
|
20
|
+
all_templates.extend(templates)
|
|
21
|
+
except Exception:
|
|
22
|
+
continue
|
|
23
|
+
|
|
24
|
+
return [t for t in all_templates if t.startswith(incomplete)]
|
|
25
|
+
return completer
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def load_main(
|
|
29
|
+
chat_name: str = ChatNameArgument("Name of the chat file to load template into (without extension)"),
|
|
30
|
+
template_type: TemplateTypeEnum = TemplateTypeArgument("Type of template to load"),
|
|
31
|
+
template_name: str = typer.Argument(
|
|
32
|
+
"",
|
|
33
|
+
help="Name of the template to load. Supports wildcards and 'global/' prefix",
|
|
34
|
+
autocompletion=create_template_name_completer()
|
|
35
|
+
)
|
|
36
|
+
):
|
|
37
|
+
"""Load a template into a chat file."""
|
|
38
|
+
args = MockArgs(
|
|
39
|
+
chat_name=chat_name,
|
|
40
|
+
template_type=template_type.value,
|
|
41
|
+
template_name=template_name
|
|
42
|
+
)
|
|
43
|
+
load_action(args)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def register(parent: typer.Typer):
|
|
47
|
+
help_text = "Load a template into a chat file"
|
|
48
|
+
parent.command(name="load", help=help_text)(load_main)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument, ChatNameArgument
|
|
4
|
+
from ara_cli.ara_command_action import prompt_action
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def prompt_init(
|
|
8
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
9
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory")
|
|
10
|
+
):
|
|
11
|
+
"""Initialize a macro prompt."""
|
|
12
|
+
args = MockArgs(
|
|
13
|
+
classifier=classifier.value,
|
|
14
|
+
parameter=parameter,
|
|
15
|
+
steps="init"
|
|
16
|
+
)
|
|
17
|
+
prompt_action(args)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def prompt_load(
|
|
21
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
22
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory")
|
|
23
|
+
):
|
|
24
|
+
"""Load selected templates."""
|
|
25
|
+
args = MockArgs(
|
|
26
|
+
classifier=classifier.value,
|
|
27
|
+
parameter=parameter,
|
|
28
|
+
steps="load"
|
|
29
|
+
)
|
|
30
|
+
prompt_action(args)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def prompt_send(
|
|
34
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
35
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory")
|
|
36
|
+
):
|
|
37
|
+
"""Send configured prompt to LLM."""
|
|
38
|
+
args = MockArgs(
|
|
39
|
+
classifier=classifier.value,
|
|
40
|
+
parameter=parameter,
|
|
41
|
+
steps="send"
|
|
42
|
+
)
|
|
43
|
+
prompt_action(args)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def prompt_load_and_send(
|
|
47
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
48
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory")
|
|
49
|
+
):
|
|
50
|
+
"""Load templates and send prompt to LLM."""
|
|
51
|
+
args = MockArgs(
|
|
52
|
+
classifier=classifier.value,
|
|
53
|
+
parameter=parameter,
|
|
54
|
+
steps="load-and-send"
|
|
55
|
+
)
|
|
56
|
+
prompt_action(args)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def prompt_extract(
|
|
60
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
61
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory"),
|
|
62
|
+
write: bool = typer.Option(False, "-w", "--write", help="Overwrite existing files without using LLM for merging")
|
|
63
|
+
):
|
|
64
|
+
"""Extract LLM response and save to disk."""
|
|
65
|
+
args = MockArgs(
|
|
66
|
+
classifier=classifier.value,
|
|
67
|
+
parameter=parameter,
|
|
68
|
+
steps="extract",
|
|
69
|
+
write=write
|
|
70
|
+
)
|
|
71
|
+
prompt_action(args)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def prompt_update(
|
|
75
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
76
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory")
|
|
77
|
+
):
|
|
78
|
+
"""Update artefact config prompt files."""
|
|
79
|
+
args = MockArgs(
|
|
80
|
+
classifier=classifier.value,
|
|
81
|
+
parameter=parameter,
|
|
82
|
+
steps="update"
|
|
83
|
+
)
|
|
84
|
+
prompt_action(args)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def prompt_chat(
|
|
88
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
89
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory"),
|
|
90
|
+
chat_name: Optional[str] = ChatNameArgument("Optional name for a specific chat", None),
|
|
91
|
+
reset: Optional[bool] = typer.Option(None, "-r", "--reset/--no-reset", help="Reset the chat file if it exists"),
|
|
92
|
+
output_mode: bool = typer.Option(False, "--out", help="Output the contents of the chat file instead of entering interactive chat mode"),
|
|
93
|
+
append: Optional[List[str]] = typer.Option(None, "--append", help="Append strings to the chat file"),
|
|
94
|
+
restricted: Optional[bool] = typer.Option(None, "--restricted/--no-restricted", help="Start with a limited set of commands")
|
|
95
|
+
):
|
|
96
|
+
"""Start chat mode for the artefact."""
|
|
97
|
+
args = MockArgs(
|
|
98
|
+
classifier=classifier.value,
|
|
99
|
+
parameter=parameter,
|
|
100
|
+
steps="chat",
|
|
101
|
+
chat_name=chat_name,
|
|
102
|
+
reset=reset,
|
|
103
|
+
output_mode=output_mode,
|
|
104
|
+
append=append,
|
|
105
|
+
restricted=restricted
|
|
106
|
+
)
|
|
107
|
+
prompt_action(args)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def prompt_init_rag(
|
|
111
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
112
|
+
parameter: str = ArtefactNameArgument("Name of artefact data directory")
|
|
113
|
+
):
|
|
114
|
+
"""Initialize RAG prompt."""
|
|
115
|
+
args = MockArgs(
|
|
116
|
+
classifier=classifier.value,
|
|
117
|
+
parameter=parameter,
|
|
118
|
+
steps="init-rag"
|
|
119
|
+
)
|
|
120
|
+
prompt_action(args)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def register(parent: typer.Typer):
|
|
124
|
+
prompt_app = typer.Typer(
|
|
125
|
+
help="Base command for prompt interaction mode",
|
|
126
|
+
add_completion=False # Disable completion on subcommand
|
|
127
|
+
)
|
|
128
|
+
prompt_app.command("init")(prompt_init)
|
|
129
|
+
prompt_app.command("load")(prompt_load)
|
|
130
|
+
prompt_app.command("send")(prompt_send)
|
|
131
|
+
prompt_app.command("load-and-send")(prompt_load_and_send)
|
|
132
|
+
prompt_app.command("extract")(prompt_extract)
|
|
133
|
+
prompt_app.command("update")(prompt_update)
|
|
134
|
+
prompt_app.command("chat")(prompt_chat)
|
|
135
|
+
prompt_app.command("init-rag")(prompt_init_rag)
|
|
136
|
+
parent.add_typer(prompt_app, name="prompt")
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument
|
|
4
|
+
from ara_cli.ara_command_action import read_action
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def read_main(
|
|
8
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type", default=None),
|
|
9
|
+
parameter: str = ArtefactNameArgument("Filename of artefact", default=None),
|
|
10
|
+
include_content: Optional[List[str]] = typer.Option(None, "-I", "--include-content", help="filter for files which include given content"),
|
|
11
|
+
exclude_content: Optional[List[str]] = typer.Option(None, "-E", "--exclude-content", help="filter for files which do not include given content"),
|
|
12
|
+
include_tags: Optional[List[str]] = typer.Option(None, "--include-tags", help="filter for files which include given tags"),
|
|
13
|
+
exclude_tags: Optional[List[str]] = typer.Option(None, "--exclude-tags", help="filter for files which do not include given tags"),
|
|
14
|
+
include_extension: Optional[List[str]] = typer.Option(None, "-i", "--include-extension", "--include-classifier", help="list of extensions to include in listing"),
|
|
15
|
+
exclude_extension: Optional[List[str]] = typer.Option(None, "-e", "--exclude-extension", "--exclude-classifier", help="list of extensions to exclude from listing"),
|
|
16
|
+
branch: bool = typer.Option(False, "-b", "--branch", help="Output the contents of artefacts in the parent chain"),
|
|
17
|
+
children: bool = typer.Option(False, "-c", "--children", help="Output the contents of child artefacts")
|
|
18
|
+
):
|
|
19
|
+
"""Reads contents of artefacts."""
|
|
20
|
+
# Handle mutually exclusive options
|
|
21
|
+
if branch and children:
|
|
22
|
+
typer.echo("Error: --branch and --children are mutually exclusive", err=True)
|
|
23
|
+
raise typer.Exit(1)
|
|
24
|
+
|
|
25
|
+
read_mode = None
|
|
26
|
+
if branch:
|
|
27
|
+
read_mode = "branch"
|
|
28
|
+
elif children:
|
|
29
|
+
read_mode = "children"
|
|
30
|
+
|
|
31
|
+
args = MockArgs(
|
|
32
|
+
classifier=classifier.value if classifier else None,
|
|
33
|
+
parameter=parameter,
|
|
34
|
+
include_content=include_content,
|
|
35
|
+
exclude_content=exclude_content,
|
|
36
|
+
include_tags=include_tags,
|
|
37
|
+
exclude_tags=exclude_tags,
|
|
38
|
+
include_extension=include_extension,
|
|
39
|
+
exclude_extension=exclude_extension,
|
|
40
|
+
read_mode=read_mode
|
|
41
|
+
)
|
|
42
|
+
read_action(args)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def register(parent: typer.Typer):
|
|
46
|
+
help_text = "Reads contents of artefacts"
|
|
47
|
+
parent.command(name="read", help=help_text)(read_main)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument
|
|
3
|
+
from ara_cli.ara_command_action import read_status_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def read_status_main(
|
|
7
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type"),
|
|
8
|
+
parameter: str = ArtefactNameArgument("Filename of artefact")
|
|
9
|
+
):
|
|
10
|
+
"""Read status of an artefact by checking its tags."""
|
|
11
|
+
args = MockArgs(
|
|
12
|
+
classifier=classifier.value,
|
|
13
|
+
parameter=parameter
|
|
14
|
+
)
|
|
15
|
+
read_status_action(args)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def register(parent: typer.Typer):
|
|
19
|
+
help_text = "Read status of an artefact by checking its tags"
|
|
20
|
+
parent.command(name="read-status", help=help_text)(read_status_main)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument
|
|
3
|
+
from ara_cli.ara_command_action import read_user_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def read_user_main(
|
|
7
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type"),
|
|
8
|
+
parameter: str = ArtefactNameArgument("Filename of artefact")
|
|
9
|
+
):
|
|
10
|
+
"""Read user of an artefact by checking its tags."""
|
|
11
|
+
args = MockArgs(
|
|
12
|
+
classifier=classifier.value,
|
|
13
|
+
parameter=parameter
|
|
14
|
+
)
|
|
15
|
+
read_user_action(args)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def register(parent: typer.Typer):
|
|
19
|
+
help_text = "Read user of an artefact by checking its tags"
|
|
20
|
+
parent.command(name="read-user", help=help_text)(read_user_main)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument, ParentNameArgument
|
|
4
|
+
from ara_cli.ara_command_action import reconnect_action
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def reconnect_main(
|
|
8
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type"),
|
|
9
|
+
parameter: str = ArtefactNameArgument("Filename of artefact"),
|
|
10
|
+
parent_classifier: ClassifierEnum = ClassifierArgument("Classifier of the parent artefact type"),
|
|
11
|
+
parent_name: str = ParentNameArgument("Filename of parent artefact"),
|
|
12
|
+
rule: Optional[str] = typer.Option(None, "-r", "--rule", help="Rule for connection")
|
|
13
|
+
):
|
|
14
|
+
"""Connect an artefact to a parent artefact."""
|
|
15
|
+
args = MockArgs(
|
|
16
|
+
classifier=classifier.value,
|
|
17
|
+
parameter=parameter,
|
|
18
|
+
parent_classifier=parent_classifier.value,
|
|
19
|
+
parent_name=parent_name,
|
|
20
|
+
rule=rule
|
|
21
|
+
)
|
|
22
|
+
reconnect_action(args)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def register(parent: typer.Typer):
|
|
26
|
+
help_text = "Connect an artefact to a parent artefact"
|
|
27
|
+
parent.command(name="reconnect", help=help_text)(reconnect_main)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument
|
|
3
|
+
from ara_cli.ara_command_action import rename_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def rename_main(
|
|
7
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact"),
|
|
8
|
+
parameter: str = ArtefactNameArgument("Filename of artefact"),
|
|
9
|
+
aspect: str = typer.Argument(help="New artefact name and new data directory name")
|
|
10
|
+
):
|
|
11
|
+
"""Rename a classified artefact and its data directory."""
|
|
12
|
+
args = MockArgs(
|
|
13
|
+
classifier=classifier.value,
|
|
14
|
+
parameter=parameter,
|
|
15
|
+
aspect=aspect
|
|
16
|
+
)
|
|
17
|
+
rename_action(args)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def register(parent: typer.Typer):
|
|
21
|
+
help_text = "Rename a classified artefact and its data directory"
|
|
22
|
+
parent.command(name="rename", help=help_text)(rename_main)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import MockArgs
|
|
3
|
+
from ara_cli.ara_command_action import scan_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def scan_main():
|
|
7
|
+
"""Scan ARA tree for incompatible artefacts."""
|
|
8
|
+
args = MockArgs()
|
|
9
|
+
scan_action(args)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def register(parent: typer.Typer):
|
|
13
|
+
help_text = "Scan ARA tree for incompatible artefacts"
|
|
14
|
+
parent.command(name="scan", help=help_text)(scan_main)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument, StatusArgument
|
|
3
|
+
from ara_cli.ara_command_action import set_status_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def set_status_main(
|
|
7
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type, typically 'task'"),
|
|
8
|
+
parameter: str = ArtefactNameArgument("Name of the task artefact"),
|
|
9
|
+
new_status: str = StatusArgument("New status to set for the task")
|
|
10
|
+
):
|
|
11
|
+
"""Set the status of a task."""
|
|
12
|
+
args = MockArgs(
|
|
13
|
+
classifier=classifier.value,
|
|
14
|
+
parameter=parameter,
|
|
15
|
+
new_status=new_status
|
|
16
|
+
)
|
|
17
|
+
set_status_action(args)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def register(parent: typer.Typer):
|
|
21
|
+
help_text = "Set the status of a task"
|
|
22
|
+
parent.command(name="set-status", help=help_text)(set_status_main)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument, ArtefactNameArgument
|
|
3
|
+
from ara_cli.ara_command_action import set_user_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def set_user_main(
|
|
7
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type, typically 'task'"),
|
|
8
|
+
parameter: str = ArtefactNameArgument("Name of the task artefact"),
|
|
9
|
+
new_user: str = typer.Argument(help="New user to assign to the task")
|
|
10
|
+
):
|
|
11
|
+
"""Set the user of a task."""
|
|
12
|
+
args = MockArgs(
|
|
13
|
+
classifier=classifier.value,
|
|
14
|
+
parameter=parameter,
|
|
15
|
+
new_user=new_user
|
|
16
|
+
)
|
|
17
|
+
set_user_action(args)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def register(parent: typer.Typer):
|
|
21
|
+
help_text = "Set the user of a task"
|
|
22
|
+
parent.command(name="set-user", help=help_text)(set_user_main)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from .common import ClassifierEnum, MockArgs, ClassifierArgument
|
|
3
|
+
from ara_cli.ara_command_action import template_action
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def template_main(
|
|
7
|
+
classifier: ClassifierEnum = ClassifierArgument("Classifier of the artefact type")
|
|
8
|
+
):
|
|
9
|
+
"""Outputs a classified ara template in the terminal."""
|
|
10
|
+
args = MockArgs(classifier=classifier.value)
|
|
11
|
+
template_action(args)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def register(parent: typer.Typer):
|
|
15
|
+
help_text = "Outputs a classified ara template in the terminal"
|
|
16
|
+
parent.command(name="template", help=help_text)(template_main)
|