ara-cli 0.1.10.5__py3-none-any.whl → 0.1.14.0__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.
Files changed (151) hide show
  1. ara_cli/__init__.py +51 -6
  2. ara_cli/__main__.py +87 -75
  3. ara_cli/ara_command_action.py +189 -101
  4. ara_cli/ara_config.py +187 -128
  5. ara_cli/ara_subcommands/common.py +2 -2
  6. ara_cli/ara_subcommands/config.py +221 -0
  7. ara_cli/ara_subcommands/convert.py +107 -0
  8. ara_cli/ara_subcommands/fetch.py +41 -0
  9. ara_cli/ara_subcommands/fetch_agents.py +22 -0
  10. ara_cli/ara_subcommands/fetch_scripts.py +19 -0
  11. ara_cli/ara_subcommands/fetch_templates.py +15 -10
  12. ara_cli/ara_subcommands/list.py +97 -23
  13. ara_cli/ara_subcommands/prompt.py +266 -106
  14. ara_cli/artefact_autofix.py +117 -64
  15. ara_cli/artefact_converter.py +355 -0
  16. ara_cli/artefact_creator.py +41 -17
  17. ara_cli/artefact_lister.py +3 -3
  18. ara_cli/artefact_models/artefact_model.py +1 -1
  19. ara_cli/artefact_models/artefact_templates.py +0 -9
  20. ara_cli/artefact_models/feature_artefact_model.py +8 -8
  21. ara_cli/artefact_reader.py +62 -43
  22. ara_cli/artefact_scan.py +39 -17
  23. ara_cli/chat.py +300 -71
  24. ara_cli/chat_agent/__init__.py +0 -0
  25. ara_cli/chat_agent/agent_process_manager.py +155 -0
  26. ara_cli/chat_script_runner/__init__.py +0 -0
  27. ara_cli/chat_script_runner/script_completer.py +23 -0
  28. ara_cli/chat_script_runner/script_finder.py +41 -0
  29. ara_cli/chat_script_runner/script_lister.py +36 -0
  30. ara_cli/chat_script_runner/script_runner.py +36 -0
  31. ara_cli/chat_web_search/__init__.py +0 -0
  32. ara_cli/chat_web_search/web_search.py +263 -0
  33. ara_cli/children_contribution_updater.py +737 -0
  34. ara_cli/classifier.py +34 -0
  35. ara_cli/commands/agent_run_command.py +98 -0
  36. ara_cli/commands/fetch_agents_command.py +106 -0
  37. ara_cli/commands/fetch_scripts_command.py +43 -0
  38. ara_cli/commands/fetch_templates_command.py +39 -0
  39. ara_cli/commands/fetch_templates_commands.py +39 -0
  40. ara_cli/commands/list_agents_command.py +39 -0
  41. ara_cli/commands/load_command.py +4 -3
  42. ara_cli/commands/load_image_command.py +1 -1
  43. ara_cli/commands/read_command.py +23 -27
  44. ara_cli/completers.py +95 -35
  45. ara_cli/constants.py +2 -0
  46. ara_cli/directory_navigator.py +37 -4
  47. ara_cli/error_handler.py +26 -11
  48. ara_cli/file_loaders/document_reader.py +0 -178
  49. ara_cli/file_loaders/factories/__init__.py +0 -0
  50. ara_cli/file_loaders/factories/document_reader_factory.py +32 -0
  51. ara_cli/file_loaders/factories/file_loader_factory.py +27 -0
  52. ara_cli/file_loaders/file_loader.py +1 -30
  53. ara_cli/file_loaders/loaders/__init__.py +0 -0
  54. ara_cli/file_loaders/{document_file_loader.py → loaders/document_file_loader.py} +1 -1
  55. ara_cli/file_loaders/loaders/text_file_loader.py +47 -0
  56. ara_cli/file_loaders/readers/__init__.py +0 -0
  57. ara_cli/file_loaders/readers/docx_reader.py +49 -0
  58. ara_cli/file_loaders/readers/excel_reader.py +27 -0
  59. ara_cli/file_loaders/{markdown_reader.py → readers/markdown_reader.py} +1 -1
  60. ara_cli/file_loaders/readers/odt_reader.py +59 -0
  61. ara_cli/file_loaders/readers/pdf_reader.py +54 -0
  62. ara_cli/file_loaders/readers/pptx_reader.py +104 -0
  63. ara_cli/file_loaders/tools/__init__.py +0 -0
  64. ara_cli/llm_utils.py +58 -0
  65. ara_cli/output_suppressor.py +53 -0
  66. ara_cli/prompt_chat.py +20 -4
  67. ara_cli/prompt_extractor.py +47 -32
  68. ara_cli/prompt_handler.py +123 -17
  69. ara_cli/tag_extractor.py +8 -7
  70. ara_cli/template_loader.py +2 -1
  71. ara_cli/template_manager.py +52 -21
  72. ara_cli/templates/global-scripts/hello_global.py +1 -0
  73. ara_cli/templates/prompt-modules/commands/add_scenarios_for_new_behaviour.feature_creation_agent.commands.md +1 -0
  74. ara_cli/templates/prompt-modules/commands/align_feature_with_implementation_changes.interview_agent.commands.md +1 -0
  75. ara_cli/templates/prompt-modules/commands/analyze_codebase_and_plan_tasks.interview_agent.commands.md +1 -0
  76. ara_cli/templates/prompt-modules/commands/choose_best_parent_artefact.interview_agent.commands.md +1 -0
  77. ara_cli/templates/prompt-modules/commands/create_tasks_from_artefact_content.interview_agent.commands.md +1 -0
  78. ara_cli/templates/prompt-modules/commands/create_tests_for_uncovered_modules.test_generation_agent.commands.md +1 -0
  79. ara_cli/templates/prompt-modules/commands/derive_features_from_video_description.feature_creation_agent.commands.md +1 -0
  80. ara_cli/templates/prompt-modules/commands/describe_agent_capabilities.agent.commands.md +1 -0
  81. ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
  82. ara_cli/templates/prompt-modules/commands/execute_scoped_todos_in_task.interview_agent.commands.md +1 -0
  83. ara_cli/templates/prompt-modules/commands/explain_single_file_purpose.interview_agent.commands.md +1 -0
  84. ara_cli/templates/prompt-modules/commands/extract_file_information_bullets.interview_agent.commands.md +1 -0
  85. ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
  86. ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
  87. ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
  88. ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
  89. ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
  90. ara_cli/templates/prompt-modules/commands/fix_failing_behave_step_definitions.interview_agent.commands.md +1 -0
  91. ara_cli/templates/prompt-modules/commands/fix_failing_pytest_tests.interview_agent.commands.md +1 -0
  92. ara_cli/templates/prompt-modules/commands/general_instruction_policy.commands.md +47 -0
  93. ara_cli/templates/prompt-modules/commands/generate_and_fix_pytest_tests.test_generation_agent.commands.md +1 -0
  94. ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
  95. ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
  96. ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
  97. ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
  98. ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
  99. ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
  100. ara_cli/templates/prompt-modules/commands/suggest_next_story_child_tasks.interview_agent.commands.md +1 -0
  101. ara_cli/templates/prompt-modules/commands/summarize_or_transcribe_media.interview_agent.commands.md +1 -0
  102. ara_cli/templates/prompt-modules/commands/update_feature_to_match_implementation.feature_creation_agent.commands.md +1 -0
  103. ara_cli/templates/prompt-modules/commands/update_user_story_with_requirements.interview_agent.commands.md +1 -0
  104. ara_cli/version.py +1 -1
  105. {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.14.0.dist-info}/METADATA +49 -11
  106. ara_cli-0.1.14.0.dist-info/RECORD +253 -0
  107. {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.14.0.dist-info}/WHEEL +1 -1
  108. tests/test_ara_command_action.py +31 -19
  109. tests/test_ara_config.py +177 -90
  110. tests/test_artefact_autofix.py +170 -97
  111. tests/test_artefact_autofix_integration.py +495 -0
  112. tests/test_artefact_converter.py +312 -0
  113. tests/test_artefact_extraction.py +564 -0
  114. tests/test_artefact_lister.py +11 -8
  115. tests/test_chat.py +166 -130
  116. tests/test_chat_givens_images.py +603 -0
  117. tests/test_chat_script_runner.py +454 -0
  118. tests/test_children_contribution_updater.py +98 -0
  119. tests/test_document_loader_office.py +267 -0
  120. tests/test_llm_utils.py +164 -0
  121. tests/test_prompt_chat.py +343 -0
  122. tests/test_prompt_extractor.py +683 -0
  123. tests/test_prompt_handler.py +416 -214
  124. tests/test_setup_default_chat_prompt_mode.py +198 -0
  125. tests/test_tag_extractor.py +95 -49
  126. tests/test_web_search.py +467 -0
  127. ara_cli/file_loaders/document_readers.py +0 -233
  128. ara_cli/file_loaders/file_loaders.py +0 -123
  129. ara_cli/file_loaders/text_file_loader.py +0 -187
  130. ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
  131. ara_cli/templates/prompt-modules/blueprints/pytest_unittest_prompt.blueprint.md +0 -32
  132. ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
  133. ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
  134. ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
  135. ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
  136. ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
  137. ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
  138. ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
  139. ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
  140. ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
  141. ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
  142. ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
  143. ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
  144. ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
  145. ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
  146. ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
  147. ara_cli-0.1.10.5.dist-info/RECORD +0 -194
  148. /ara_cli/file_loaders/{binary_file_loader.py → loaders/binary_file_loader.py} +0 -0
  149. /ara_cli/file_loaders/{image_processor.py → tools/image_processor.py} +0 -0
  150. {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.14.0.dist-info}/entry_points.txt +0 -0
  151. {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.14.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,107 @@
1
+ import typer
2
+ from typing import Optional
3
+
4
+ from ara_cli import error_handler
5
+ from ara_cli.completers import DynamicCompleters
6
+
7
+
8
+ def register(app: typer.Typer):
9
+ @app.command()
10
+ def convert(
11
+ old_classifier: str = typer.Argument(
12
+ ...,
13
+ help=" The classifier of the source artefact",
14
+ autocompletion=DynamicCompleters.create_classifier_completer(),
15
+ ),
16
+ artefact_name: str = typer.Argument(
17
+ ...,
18
+ help="The name of the artefact to convert",
19
+ autocompletion=DynamicCompleters.create_convert_source_artefact_name_completer(),
20
+ ),
21
+ new_classifier: str = typer.Argument(
22
+ ...,
23
+ help="The target classifier",
24
+ autocompletion=DynamicCompleters.create_classifier_completer(),
25
+ ),
26
+ merge: bool = typer.Option(
27
+ False, "--merge", help="Merge with existing artefact if it exists"
28
+ ),
29
+ override: bool = typer.Option(
30
+ False, "--override", help="Override existing artefact if it exists"
31
+ ),
32
+ force: bool = typer.Option(
33
+ False,
34
+ "-f",
35
+ "--force",
36
+ help="When converting to task/issue, automatically clear children's contribution fields",
37
+ ),
38
+ json_output: bool = typer.Option(
39
+ False,
40
+ "-j",
41
+ "--json",
42
+ help="Output results as JSON (for API/non-interactive mode)",
43
+ ),
44
+ children_action: Optional[str] = typer.Option(
45
+ None,
46
+ "--children-action",
47
+ help="Non-interactive mode: Action for children (cancel/clear/reassign)",
48
+ ),
49
+ new_parent_classifier: Optional[str] = typer.Option(
50
+ None,
51
+ "--new-parent-classifier",
52
+ help="For reassign action: classifier of the new parent artefact",
53
+ autocompletion=DynamicCompleters.create_classifier_completer(),
54
+ ),
55
+ new_parent_name: Optional[str] = typer.Option(
56
+ None,
57
+ "--new-parent-name",
58
+ help="For reassign action: name of the new parent artefact",
59
+ ),
60
+ preview: bool = typer.Option(
61
+ False,
62
+ "--preview",
63
+ help="Preview children info without converting (returns JSON)",
64
+ ),
65
+ ):
66
+ """
67
+ Convert an existing artefact from one classifier to another.
68
+
69
+ For API/non-interactive mode, use --json and --children-action options.
70
+ Use --preview to get children information without performing conversion.
71
+ """
72
+ try:
73
+ from ara_cli.artefact_converter import AraArtefactConverter
74
+ from ara_cli.children_contribution_updater import (
75
+ ChildrenContributionUpdater,
76
+ )
77
+ import json
78
+
79
+ # Preview mode: return children info as JSON
80
+ if preview:
81
+ updater = ChildrenContributionUpdater()
82
+ info = updater.get_children_info(
83
+ artefact_name, old_classifier, new_classifier
84
+ )
85
+ print(json.dumps(info, indent=2))
86
+ return
87
+
88
+ converter = AraArtefactConverter()
89
+ converter.convert(
90
+ old_classifier,
91
+ artefact_name,
92
+ new_classifier,
93
+ merge,
94
+ override,
95
+ force,
96
+ children_action=children_action,
97
+ new_parent_classifier=new_parent_classifier,
98
+ new_parent_name=new_parent_name,
99
+ json_output=json_output,
100
+ )
101
+ except Exception as e:
102
+ if json_output:
103
+ import json
104
+
105
+ print(json.dumps({"status": "error", "message": str(e)}))
106
+ else:
107
+ error_handler.handle_error(e)
@@ -0,0 +1,41 @@
1
+ import typer
2
+
3
+
4
+ def register(app: typer.Typer):
5
+ @app.command(
6
+ name="fetch",
7
+ help="Fetch templates, scripts, or agents. If no flags provided, fetches all.",
8
+ )
9
+ def fetch(
10
+ templates: bool = typer.Option(
11
+ False, "--templates", "-t", help="Fetch prompt templates only."
12
+ ),
13
+ scripts: bool = typer.Option(
14
+ False, "--scripts", "-s", help="Fetch scripts only."
15
+ ),
16
+ agents: bool = typer.Option(False, "--agents", "-a", help="Fetch agents only."),
17
+ ):
18
+ from ara_cli.commands.fetch_templates_command import FetchTemplatesCommand
19
+ from ara_cli.commands.fetch_scripts_command import FetchScriptsCommand
20
+ from ara_cli.commands.fetch_agents_command import FetchAgentsCommand
21
+
22
+ if not any([templates, scripts, agents]):
23
+ templates = True
24
+ scripts = True
25
+ agents = True
26
+ typer.echo("Fetching all resources (templates, scripts, agents)...")
27
+
28
+ if templates:
29
+ typer.echo("Fetching templates...")
30
+ command = FetchTemplatesCommand()
31
+ command.execute()
32
+
33
+ if scripts:
34
+ typer.echo("Fetching scripts...")
35
+ command = FetchScriptsCommand()
36
+ command.execute()
37
+
38
+ if agents:
39
+ typer.echo("Fetching agents...")
40
+ command = FetchAgentsCommand()
41
+ command.execute()
@@ -0,0 +1,22 @@
1
+ import typer
2
+
3
+
4
+ def register(app: typer.Typer):
5
+ """Register the fetch-agents command with the typer app."""
6
+
7
+ @app.command(
8
+ name="fetch-agents",
9
+ help="Fetch binary agents from templates to project.",
10
+ deprecated=True,
11
+ )
12
+ def fetch_agents():
13
+ """Fetch binary agents from ara_cli/templates/agents to ara/.araconfig/agents."""
14
+ from ara_cli.commands.fetch_agents_command import FetchAgentsCommand
15
+
16
+ typer.secho(
17
+ "WARNING: 'fetch-agents' is deprecated. Please use 'ara fetch --agents' or just 'ara fetch' instead.",
18
+ fg=typer.colors.YELLOW,
19
+ err=True,
20
+ )
21
+ command = FetchAgentsCommand()
22
+ command.execute()
@@ -0,0 +1,19 @@
1
+ import typer
2
+
3
+
4
+ def register(app: typer.Typer):
5
+ @app.command(
6
+ name="fetch-scripts",
7
+ help="Fetch global scripts into your config directory.",
8
+ deprecated=True,
9
+ )
10
+ def fetch_scripts():
11
+ from ara_cli.commands.fetch_scripts_command import FetchScriptsCommand
12
+
13
+ typer.secho(
14
+ "WARNING: 'fetch-scripts' is deprecated. Please use 'ara fetch --scripts' or just 'ara fetch' instead.",
15
+ fg=typer.colors.YELLOW,
16
+ err=True,
17
+ )
18
+ command = FetchScriptsCommand()
19
+ command.execute()
@@ -1,14 +1,19 @@
1
1
  import typer
2
- from .common import MockArgs
3
- from ara_cli.ara_command_action import fetch_templates_action
4
2
 
5
3
 
6
- def fetch_templates_main():
7
- """Fetches templates and stores them in .araconfig."""
8
- args = MockArgs()
9
- fetch_templates_action(args)
4
+ def register(app: typer.Typer):
5
+ @app.command(
6
+ name="fetch-templates",
7
+ help="Fetch global prompt templates into your config directory.",
8
+ deprecated=True,
9
+ )
10
+ def fetch_templates():
11
+ from ara_cli.commands.fetch_templates_command import FetchTemplatesCommand
10
12
 
11
-
12
- def register(parent: typer.Typer):
13
- help_text = "Fetches templates and stores them in .araconfig"
14
- parent.command(name="fetch-templates", help=help_text)(fetch_templates_main)
13
+ typer.secho(
14
+ "WARNING: 'fetch-templates' is deprecated. Please use 'ara fetch --templates' or just 'ara fetch' instead.",
15
+ fg=typer.colors.YELLOW,
16
+ err=True,
17
+ )
18
+ command = FetchTemplatesCommand()
19
+ command.execute()
@@ -2,59 +2,133 @@ import typer
2
2
  from ara_cli.error_handler import AraError
3
3
  from typing import Optional, List, Tuple
4
4
  from .common import MockArgs
5
+ from ara_cli.completers import DynamicCompleters
5
6
  from ara_cli.ara_command_action import list_action
6
7
 
7
8
 
8
- def _validate_extension_options(include_extension: Optional[List[str]], exclude_extension: Optional[List[str]]) -> None:
9
+ def _validate_extension_options(
10
+ include_extension: Optional[List[str]], exclude_extension: Optional[List[str]]
11
+ ) -> None:
9
12
  """Validate that include and exclude extension options are mutually exclusive."""
10
13
  if include_extension and exclude_extension:
11
- raise AraError("--include-extension/-i and --exclude-extension/-e are mutually exclusive")
14
+ raise AraError(
15
+ "--include-extension/-i and --exclude-extension/-e are mutually exclusive"
16
+ )
12
17
 
13
18
 
14
- def _validate_exclusive_options(branch: Optional[Tuple[str, str]],
15
- children: Optional[Tuple[str, str]],
16
- data: Optional[Tuple[str, str]]) -> None:
19
+ def _validate_exclusive_options(
20
+ branch: bool,
21
+ children: bool,
22
+ data: bool,
23
+ ) -> None:
17
24
  """Validate that branch, children, and data options are mutually exclusive."""
18
25
  exclusive_options = [branch, children, data]
19
- non_none_options = [opt for opt in exclusive_options if opt is not None]
20
- if len(non_none_options) > 1:
26
+ true_options = [opt for opt in exclusive_options if opt]
27
+ if len(true_options) > 1:
21
28
  raise AraError("--branch, --children, and --data are mutually exclusive")
22
29
 
23
30
 
24
31
  def list_main(
25
- ctx: typer.Context,
26
- include_content: Optional[List[str]] = typer.Option(None, "-I", "--include-content", help="filter for files which include given content"),
27
- exclude_content: Optional[List[str]] = typer.Option(None, "-E", "--exclude-content", help="filter for files which do not include given content"),
28
- include_tags: Optional[List[str]] = typer.Option(None, "--include-tags", help="filter for files which include given tags"),
29
- exclude_tags: Optional[List[str]] = typer.Option(None, "--exclude-tags", help="filter for files which do not include given tags"),
30
- include_extension: Optional[List[str]] = typer.Option(None, "-i", "--include-extension", "--include-classifier", help="list of extensions to include in listing"),
31
- exclude_extension: Optional[List[str]] = typer.Option(None, "-e", "--exclude-extension", "--exclude-classifier", help="list of extensions to exclude from listing"),
32
- branch: Optional[Tuple[str, str]] = typer.Option(None, "-b", "--branch", help="List artefacts in the parent chain (classifier artefact_name)"),
33
- children: Optional[Tuple[str, str]] = typer.Option(None, "-c", "--children", help="List child artefacts (classifier artefact_name)"),
34
- data: Optional[Tuple[str, str]] = typer.Option(None, "-d", "--data", help="List file in the data directory (classifier artefact_name)")
32
+ classifier: Optional[str] = typer.Argument(
33
+ None,
34
+ help="The classifier of the artefact",
35
+ autocompletion=DynamicCompleters.create_classifier_completer(),
36
+ ),
37
+ artefact_name: Optional[str] = typer.Argument(
38
+ None,
39
+ help="The name of the artefact",
40
+ autocompletion=DynamicCompleters.create_artefact_name_completer(),
41
+ ),
42
+ include_content: Optional[List[str]] = typer.Option(
43
+ None,
44
+ "-I",
45
+ "--include-content",
46
+ help="filter for files which include given content",
47
+ ),
48
+ exclude_content: Optional[List[str]] = typer.Option(
49
+ None,
50
+ "-E",
51
+ "--exclude-content",
52
+ help="filter for files which do not include given content",
53
+ ),
54
+ include_tags: Optional[List[str]] = typer.Option(
55
+ None, "--include-tags", help="filter for files which include given tags"
56
+ ),
57
+ exclude_tags: Optional[List[str]] = typer.Option(
58
+ None, "--exclude-tags", help="filter for files which do not include given tags"
59
+ ),
60
+ include_extension: Optional[List[str]] = typer.Option(
61
+ None,
62
+ "-i",
63
+ "--include-extension",
64
+ "--include-classifier",
65
+ help="list of extensions to include in listing",
66
+ ),
67
+ exclude_extension: Optional[List[str]] = typer.Option(
68
+ None,
69
+ "-e",
70
+ "--exclude-extension",
71
+ "--exclude-classifier",
72
+ help="list of extensions to exclude from listing",
73
+ ),
74
+ branch: bool = typer.Option(
75
+ False,
76
+ "-b",
77
+ "--branch",
78
+ help="List artefacts in the parent chain (requires classifier and artefact_name)",
79
+ ),
80
+ children: bool = typer.Option(
81
+ False,
82
+ "-c",
83
+ "--children",
84
+ help="List child artefacts (requires classifier and artefact_name)",
85
+ ),
86
+ data: bool = typer.Option(
87
+ False,
88
+ "-d",
89
+ "--data",
90
+ help="List file in the data directory (requires classifier and artefact_name)",
91
+ ),
35
92
  ):
36
93
  """List files with optional tags.
37
94
 
38
95
  Examples:
39
- ara list --data feature my_feature --include-extension .md
96
+ ara list feature my_feature --data --include-extension .md
40
97
  ara list --include-extension .feature
41
- ara list --children userstory my_story
42
- ara list --branch userstory my_story --include-extension .businessgoal
98
+ ara list userstory my_story --children
99
+ ara list userstory my_story --branch --include-extension .businessgoal
43
100
  ara list --include-content "example content" --include-extension .task
44
101
  """
45
102
  _validate_extension_options(include_extension, exclude_extension)
46
103
  _validate_exclusive_options(branch, children, data)
47
104
 
105
+ # If classifier is provided but no artefact_name, and no other specific flags are set,
106
+ # treat it as a filter by classifier (extension).
107
+ # This supports "ara list feature" -> lists all features.
108
+ if classifier and not artefact_name and not (branch or children or data):
109
+ # We append the classifier (prefixed with '.') to include_extension
110
+ # This assumes classifier names correspond to extensions (e.g. 'feature' -> '.feature')
111
+ # existing logic usually expects the extension format.
112
+ ext = f".{classifier}"
113
+ if include_extension:
114
+ include_extension.append(ext)
115
+ else:
116
+ include_extension = [ext]
117
+ # Clear classifier from args so it doesn't trigger other logic
118
+ classifier = None
119
+
48
120
  args = MockArgs(
121
+ classifier=classifier,
122
+ artefact_name=artefact_name,
49
123
  include_content=include_content,
50
124
  exclude_content=exclude_content,
51
125
  include_tags=include_tags,
52
126
  exclude_tags=exclude_tags,
53
127
  include_extension=include_extension,
54
128
  exclude_extension=exclude_extension,
55
- branch_args=tuple(branch) if branch else (None, None),
56
- children_args=tuple(children) if children else (None, None),
57
- data_args=tuple(data) if data else (None, None)
129
+ branch=branch,
130
+ children=children,
131
+ data=data,
58
132
  )
59
133
 
60
134
  list_action(args)