ara-cli 0.0.0.666__tar.gz

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 (165) hide show
  1. ara_cli-0.0.0.666/MANIFEST.in +4 -0
  2. ara_cli-0.0.0.666/PKG-INFO +16 -0
  3. ara_cli-0.0.0.666/README.md +93 -0
  4. ara_cli-0.0.0.666/ara_cli/__init__.py +3 -0
  5. ara_cli-0.0.0.666/ara_cli/__main__.py +72 -0
  6. ara_cli-0.0.0.666/ara_cli/ara_command_action.py +612 -0
  7. ara_cli-0.0.0.666/ara_cli/ara_command_parser.py +328 -0
  8. ara_cli-0.0.0.666/ara_cli/ara_config.py +146 -0
  9. ara_cli-0.0.0.666/ara_cli/artefact_autofix.py +477 -0
  10. ara_cli-0.0.0.666/ara_cli/artefact_creator.py +146 -0
  11. ara_cli-0.0.0.666/ara_cli/artefact_deleter.py +51 -0
  12. ara_cli-0.0.0.666/ara_cli/artefact_fuzzy_search.py +64 -0
  13. ara_cli-0.0.0.666/ara_cli/artefact_link_updater.py +76 -0
  14. ara_cli-0.0.0.666/ara_cli/artefact_lister.py +136 -0
  15. ara_cli-0.0.0.666/ara_cli/artefact_models/__init__.py +0 -0
  16. ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_load.py +10 -0
  17. ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_mapping.py +39 -0
  18. ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_model.py +414 -0
  19. ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_templates.py +224 -0
  20. ara_cli-0.0.0.666/ara_cli/artefact_models/businessgoal_artefact_model.py +134 -0
  21. ara_cli-0.0.0.666/ara_cli/artefact_models/capability_artefact_model.py +94 -0
  22. ara_cli-0.0.0.666/ara_cli/artefact_models/epic_artefact_model.py +170 -0
  23. ara_cli-0.0.0.666/ara_cli/artefact_models/example_artefact_model.py +49 -0
  24. ara_cli-0.0.0.666/ara_cli/artefact_models/feature_artefact_model.py +467 -0
  25. ara_cli-0.0.0.666/ara_cli/artefact_models/issue_artefact_model.py +78 -0
  26. ara_cli-0.0.0.666/ara_cli/artefact_models/keyfeature_artefact_model.py +127 -0
  27. ara_cli-0.0.0.666/ara_cli/artefact_models/serialize_helper.py +18 -0
  28. ara_cli-0.0.0.666/ara_cli/artefact_models/task_artefact_model.py +109 -0
  29. ara_cli-0.0.0.666/ara_cli/artefact_models/userstory_artefact_model.py +193 -0
  30. ara_cli-0.0.0.666/ara_cli/artefact_models/vision_artefact_model.py +171 -0
  31. ara_cli-0.0.0.666/ara_cli/artefact_reader.py +175 -0
  32. ara_cli-0.0.0.666/ara_cli/artefact_renamer.py +93 -0
  33. ara_cli-0.0.0.666/ara_cli/artefact_scan.py +86 -0
  34. ara_cli-0.0.0.666/ara_cli/chat.py +739 -0
  35. ara_cli-0.0.0.666/ara_cli/classifier.py +74 -0
  36. ara_cli-0.0.0.666/ara_cli/codefusionretriever.py +53 -0
  37. ara_cli-0.0.0.666/ara_cli/codehierachieretriever.py +37 -0
  38. ara_cli-0.0.0.666/ara_cli/commandline_completer.py +42 -0
  39. ara_cli-0.0.0.666/ara_cli/directory_navigator.py +74 -0
  40. ara_cli-0.0.0.666/ara_cli/file_classifier.py +100 -0
  41. ara_cli-0.0.0.666/ara_cli/file_lister.py +54 -0
  42. ara_cli-0.0.0.666/ara_cli/filename_validator.py +4 -0
  43. ara_cli-0.0.0.666/ara_cli/list_filter.py +148 -0
  44. ara_cli-0.0.0.666/ara_cli/output_suppressor.py +17 -0
  45. ara_cli-0.0.0.666/ara_cli/prompt_chat.py +30 -0
  46. ara_cli-0.0.0.666/ara_cli/prompt_extractor.py +211 -0
  47. ara_cli-0.0.0.666/ara_cli/prompt_handler.py +464 -0
  48. ara_cli-0.0.0.666/ara_cli/prompt_rag.py +187 -0
  49. ara_cli-0.0.0.666/ara_cli/run_file_lister.py +69 -0
  50. ara_cli-0.0.0.666/ara_cli/tag_extractor.py +67 -0
  51. ara_cli-0.0.0.666/ara_cli/template_manager.py +151 -0
  52. ara_cli-0.0.0.666/ara_cli/templates/agile.artefacts +171 -0
  53. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +27 -0
  54. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md +0 -0
  55. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md +32 -0
  56. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +30 -0
  57. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md +37 -0
  58. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md +37 -0
  59. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md +32 -0
  60. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md +82 -0
  61. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +9 -0
  62. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +17 -0
  63. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +14 -0
  64. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +102 -0
  65. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +20 -0
  66. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +13 -0
  67. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/empty.commands.md +14 -0
  68. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +20 -0
  69. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +18 -0
  70. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +43 -0
  71. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +13 -0
  72. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/refactoring.commands.md +15 -0
  73. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +9 -0
  74. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +15 -0
  75. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +19 -0
  76. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/classify_task.intention.md +6 -0
  77. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/empty.intention.md +2 -0
  78. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md +9 -0
  79. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_fix_steps_for_scenario.intention.md +2 -0
  80. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md +2 -0
  81. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_reverse_formulation_from_code.intention.md +2 -0
  82. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation.intention.md +6 -0
  83. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation_update.intention.md +8 -0
  84. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_scenario_outline_extension.intention.md +2 -0
  85. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_update_formulation.intention.md +5 -0
  86. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/fibonacci_example_implementation.intention.md +2 -0
  87. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/js_implementation_from_task_description.intention.md +2 -0
  88. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/js_steps_implementation.intention.md +4 -0
  89. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/python_cli_implementation_with_test.intention.md +6 -0
  90. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/python_code_understanding.intention.md +18 -0
  91. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md +2 -0
  92. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_prompt_control_by_status.intention.md +6 -0
  93. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_number.intention.md +4 -0
  94. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_status.intention.md +4 -0
  95. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md +55 -0
  96. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/code_analyst.rules.md +7 -0
  97. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/empty.rules.md +2 -0
  98. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/error_analyst.rules.md +13 -0
  99. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md +15 -0
  100. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/js_expert_developer.rules.md +9 -0
  101. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/product_owner.rules.md +22 -0
  102. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/python_behave.rules.md +13 -0
  103. ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/python_developer.rules.md +8 -0
  104. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.concept.exploration.md +76 -0
  105. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.concept.md +25 -0
  106. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.customer.exploration.md +62 -0
  107. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.customer.md +30 -0
  108. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.persona.exploration.md +106 -0
  109. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.persona.md +71 -0
  110. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.step.exploration.md +0 -0
  111. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.step.md +43 -0
  112. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.technology.exploration.md +77 -0
  113. ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.technology.md +23 -0
  114. ara_cli-0.0.0.666/ara_cli/templates/template.businessgoal +10 -0
  115. ara_cli-0.0.0.666/ara_cli/templates/template.businessgoal.prompt_log.md +7 -0
  116. ara_cli-0.0.0.666/ara_cli/templates/template.capability +10 -0
  117. ara_cli-0.0.0.666/ara_cli/templates/template.capability.prompt_log.md +7 -0
  118. ara_cli-0.0.0.666/ara_cli/templates/template.epic +15 -0
  119. ara_cli-0.0.0.666/ara_cli/templates/template.epic.prompt_log.md +7 -0
  120. ara_cli-0.0.0.666/ara_cli/templates/template.example +6 -0
  121. ara_cli-0.0.0.666/ara_cli/templates/template.example.prompt_log.md +7 -0
  122. ara_cli-0.0.0.666/ara_cli/templates/template.feature +26 -0
  123. ara_cli-0.0.0.666/ara_cli/templates/template.feature.prompt_log.md +7 -0
  124. ara_cli-0.0.0.666/ara_cli/templates/template.issue +14 -0
  125. ara_cli-0.0.0.666/ara_cli/templates/template.issue.prompt_log.md +7 -0
  126. ara_cli-0.0.0.666/ara_cli/templates/template.keyfeature +15 -0
  127. ara_cli-0.0.0.666/ara_cli/templates/template.keyfeature.prompt_log.md +7 -0
  128. ara_cli-0.0.0.666/ara_cli/templates/template.steps.prompt_log.md +7 -0
  129. ara_cli-0.0.0.666/ara_cli/templates/template.task +6 -0
  130. ara_cli-0.0.0.666/ara_cli/templates/template.task.prompt_log.md +7 -0
  131. ara_cli-0.0.0.666/ara_cli/templates/template.userstory +17 -0
  132. ara_cli-0.0.0.666/ara_cli/templates/template.userstory.prompt_log.md +7 -0
  133. ara_cli-0.0.0.666/ara_cli/templates/template.vision +14 -0
  134. ara_cli-0.0.0.666/ara_cli/templates/template.vision.prompt_log.md +7 -0
  135. ara_cli-0.0.0.666/ara_cli/update_config_prompt.py +123 -0
  136. ara_cli-0.0.0.666/ara_cli/version.py +2 -0
  137. ara_cli-0.0.0.666/ara_cli.egg-info/PKG-INFO +16 -0
  138. ara_cli-0.0.0.666/ara_cli.egg-info/SOURCES.txt +163 -0
  139. ara_cli-0.0.0.666/ara_cli.egg-info/dependency_links.txt +1 -0
  140. ara_cli-0.0.0.666/ara_cli.egg-info/entry_points.txt +2 -0
  141. ara_cli-0.0.0.666/ara_cli.egg-info/requires.txt +12 -0
  142. ara_cli-0.0.0.666/ara_cli.egg-info/top_level.txt +2 -0
  143. ara_cli-0.0.0.666/docker/base/requirements.txt +12 -0
  144. ara_cli-0.0.0.666/setup.cfg +4 -0
  145. ara_cli-0.0.0.666/setup.py +22 -0
  146. ara_cli-0.0.0.666/tests/__init__.py +0 -0
  147. ara_cli-0.0.0.666/tests/test_ara_command_action.py +692 -0
  148. ara_cli-0.0.0.666/tests/test_ara_config.py +59 -0
  149. ara_cli-0.0.0.666/tests/test_artefact_autofix.py +617 -0
  150. ara_cli-0.0.0.666/tests/test_artefact_fuzzy_search.py +32 -0
  151. ara_cli-0.0.0.666/tests/test_artefact_link_updater.py +48 -0
  152. ara_cli-0.0.0.666/tests/test_artefact_lister.py +631 -0
  153. ara_cli-0.0.0.666/tests/test_artefact_reader.py +16 -0
  154. ara_cli-0.0.0.666/tests/test_artefact_renamer.py +81 -0
  155. ara_cli-0.0.0.666/tests/test_artefact_scan.py +189 -0
  156. ara_cli-0.0.0.666/tests/test_chat.py +1070 -0
  157. ara_cli-0.0.0.666/tests/test_classifier.py +69 -0
  158. ara_cli-0.0.0.666/tests/test_directory_navigator.py +7 -0
  159. ara_cli-0.0.0.666/tests/test_file_classifier.py +271 -0
  160. ara_cli-0.0.0.666/tests/test_file_creator.py +60 -0
  161. ara_cli-0.0.0.666/tests/test_file_lister.py +122 -0
  162. ara_cli-0.0.0.666/tests/test_list_filter.py +205 -0
  163. ara_cli-0.0.0.666/tests/test_tag_extractor.py +83 -0
  164. ara_cli-0.0.0.666/tests/test_template_manager.py +106 -0
  165. ara_cli-0.0.0.666/tests/test_update_config_prompt.py +159 -0
@@ -0,0 +1,4 @@
1
+ recursive-include ara_cli/templates *
2
+ recursive-include ara_cli/artefact_models *
3
+
4
+ include docker/base/requirements.txt
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.4
2
+ Name: ara_cli
3
+ Version: 0.0.0.666
4
+ Requires-Dist: litellm
5
+ Requires-Dist: llama-index
6
+ Requires-Dist: llama-index-llms-openai
7
+ Requires-Dist: llama-index-retrievers-bm25
8
+ Requires-Dist: openai
9
+ Requires-Dist: markdown-it-py
10
+ Requires-Dist: json-repair
11
+ Requires-Dist: argparse
12
+ Requires-Dist: argcomplete
13
+ Requires-Dist: cmd2>=2.5
14
+ Requires-Dist: pydantic
15
+ Requires-Dist: pydantic_ai
16
+ Dynamic: requires-dist
@@ -0,0 +1,93 @@
1
+ - [ara usage](#ara-usage)
2
+ - [ara profiling](#ara-profiling)
3
+ - [Build \& Publish Base Docker Image for ARA CLI](#build--publish-base-docker-image-for-ara-cli)
4
+ - [ara-cli publish](#ara-cli-publish)
5
+ - [best practices commit and merge and recreate workspace](#best-practices-commit-and-merge-and-recreate-workspace)
6
+ - [update dependencies](#update-dependencies)
7
+ - [test and run during development](#test-and-run-during-development)
8
+ - [set version and build and install locally for testing outside of container](#set-version-and-build-and-install-locally-for-testing-outside-of-container)
9
+ - [upload to live pypi with talsen team production API key (from main branch)](#upload-to-live-pypi-with-talsen-team-production-api-key-from-main-branch)
10
+
11
+ # ara usage
12
+ See [user readme](docs/README.md)
13
+
14
+ # ara profiling
15
+ go to workspace root and run:
16
+ > python -m cProfile -o output.prof ara_cli/__main__.py <valid ara command>
17
+
18
+ then output will be generated in 'output.prof'
19
+ then analyze output with
20
+ > python pstat_prof.py
21
+
22
+ # Build & Publish Base Docker Image for ARA CLI
23
+
24
+ ```bash
25
+ bash ./docker/base/build.sh
26
+ ```
27
+
28
+ # ara-cli publish
29
+ ## best practices commit and merge and recreate workspace
30
+ 1. commit and publish everything in the branch
31
+ 2. go to git and merge
32
+ 3. destroy old workspace from merged branch from within the working directory
33
+ > workspace destroy
34
+ 4. go back in to top level working directory and check which repos are available for branching
35
+ > workspace repos
36
+ 5. create new workspacce with workspace command: workspace new <repo> <new-workspace-name>
37
+ > workspace new ara-cmd hans-ara-cmd
38
+ 6. switch to new workspace
39
+
40
+ ## update dependencies
41
+ To update dependencies, add package names in `setup.py`. The packages will ONLY be installed automatically when the RELEASE version of ara-cli is installed (and NOT a test pypi version).
42
+
43
+ ## test and run during development
44
+ 1. run `bash deploy.sh`
45
+ 2. run `bash login.sh`
46
+ 3. --> in container --> for behave BDD tests `bash test-feature.sh`
47
+ 3. a) --> in container --> for only 1 test: behave ara/features/<name>.feature
48
+ 3. b) --> in container --> for unit tests and (if successful) feature tests: `bash test-all.sh`
49
+ 4. --> in container --> for unit tests in folder ara_cli `pytest --cov=. --cov-report term-missing tests/ `
50
+ 5. --> in container --> example for running a single unit test in ara_cli folder `pytest tests/test_template_manager.py::test_files_created_from_template`
51
+ 6. if change is successfull always commit before proceeding with next change
52
+ 7. if change was successfully reviewd merge in gitlab: https://git.talsen.team/talsen-products/ara-cli/-/merge_requests/new
53
+
54
+ ## set version and build and install locally for testing outside of container
55
+ 1. set the new verion in the ara_cli/version.py file
56
+ 2. adapt the version number in the 'local_install.sh' file
57
+ 3. use `bash local_install.sh` to control local setup procedure
58
+ 4. Test the functionality
59
+
60
+
61
+ <!--
62
+ #### DEPRECATED
63
+ ## upload to test pypi with test pypi API key
64
+ 1. run `bash deploy.sh`
65
+ 2. run `login.sh`
66
+ 3. in `setup.py` and `local_install.sh` increment `version` otherwise upload will fail!
67
+ 3. a) merge to staging and continue from a new workspace
68
+ 4. from inside container run `python setup.py sdist bdist_wheel`
69
+ 5. run the following command:
70
+
71
+ ```bash
72
+ twine upload --repository testpypi dist/* --verbose -u __token__ -p pypi-AgENdGVzdC5weXBpLm9yZwIkZGI5YzUyZTUtNDhjMy00NmI3LTgxNmMtY2QwMTRjYjZmZjlmAAIqWzMsImM3ZTM0MDRmLWU1MzUtNDliMi05ZDhiLWQ0NGUyNzlmYTU0MiJdAAAGID-dX7aQZZimTyUQeKPzbP0TlqMEpLQlzRW7VJr1JKab
73
+ ```
74
+
75
+ this will upload to a test pypi account.
76
+
77
+ 1. run `python3 -m pip install --index-url https://test.pypi.org/simple/ ara_cli==<VERSION>`
78
+ 2. run `ara -h`
79
+ 3. if everything has worked (upload, installation and usage) you can now continue to upload the package to pypi (live)
80
+ -->
81
+
82
+
83
+ ## upload to live pypi with talsen team production API key (from main branch)
84
+ 1. run `bash deploy.sh`
85
+ 2. run `login.sh`
86
+ 3. from inside container run `python setup.py sdist bdist_wheel`
87
+ 4. `dist` folder should now contain the built wheel ready to upload
88
+ 5. Get the API-Key from [nextcloud](https://cloud.talsen.team/apps/keeweb/?open=%2Finfrastructure%2Fpublic-services%2Fapi-keys.kdbx)
89
+ 6. Get the Password from Hans or DevOps
90
+ 7. run the following command:
91
+ ```bash
92
+ twine upload dist/* --verbose -u __token__ -p <API-Key>
93
+ ```
@@ -0,0 +1,3 @@
1
+ from .version import __version__
2
+
3
+ whitelisted_commands = ["RERUN", "SEND", "EXTRACT", "LOAD_IMAGE", "CHOOSE_MODEL", "CURRENT_MODEL", "LIST_MODELS"]
@@ -0,0 +1,72 @@
1
+ # PYTHON_ARGCOMPLETE_OK
2
+ from ara_cli.ara_command_parser import action_parser
3
+ from ara_cli.version import __version__
4
+ from ara_cli.ara_command_action import (
5
+ create_action,
6
+ delete_action,
7
+ rename_action,
8
+ list_action,
9
+ list_tags_action,
10
+ prompt_action,
11
+ chat_action,
12
+ template_action,
13
+ fetch_templates_action,
14
+ read_action,
15
+ reconnect_action,
16
+ read_status_action,
17
+ read_user_action,
18
+ set_status_action,
19
+ set_user_action,
20
+ classifier_directory_action,
21
+ scan_action,
22
+ autofix_action
23
+ )
24
+ import argcomplete
25
+ import sys
26
+
27
+
28
+ def define_action_mapping():
29
+ return {
30
+ "create": create_action,
31
+ "delete": delete_action,
32
+ "rename": rename_action,
33
+ "list": list_action,
34
+ "list-tags": list_tags_action,
35
+ "prompt": prompt_action,
36
+ "chat": chat_action,
37
+ "template": template_action,
38
+ "fetch-templates": fetch_templates_action,
39
+ "read": read_action,
40
+ "reconnect": reconnect_action,
41
+ "read-status": read_status_action,
42
+ "read-user": read_user_action,
43
+ "set-status": set_status_action,
44
+ "set-user": set_user_action,
45
+ "classifier-directory": classifier_directory_action,
46
+ "scan": scan_action,
47
+ "autofix": autofix_action
48
+ }
49
+
50
+
51
+ def handle_invalid_action(args):
52
+ sys.exit("Invalid action provided. Type ara -h for help")
53
+
54
+
55
+ def cli():
56
+ parser = action_parser()
57
+ parser.add_argument('-v', '--version', action='version', version=f'%(prog)s {__version__}')
58
+
59
+ action_mapping = define_action_mapping()
60
+
61
+ argcomplete.autocomplete(parser)
62
+
63
+ args = parser.parse_args()
64
+ if not hasattr(args, 'action') or not args.action:
65
+ parser.print_help()
66
+ return
67
+ action = action_mapping.get(args.action, handle_invalid_action)
68
+ action(args)
69
+
70
+
71
+ if __name__ == "__main__":
72
+ cli()