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.
- ara_cli-0.0.0.666/MANIFEST.in +4 -0
- ara_cli-0.0.0.666/PKG-INFO +16 -0
- ara_cli-0.0.0.666/README.md +93 -0
- ara_cli-0.0.0.666/ara_cli/__init__.py +3 -0
- ara_cli-0.0.0.666/ara_cli/__main__.py +72 -0
- ara_cli-0.0.0.666/ara_cli/ara_command_action.py +612 -0
- ara_cli-0.0.0.666/ara_cli/ara_command_parser.py +328 -0
- ara_cli-0.0.0.666/ara_cli/ara_config.py +146 -0
- ara_cli-0.0.0.666/ara_cli/artefact_autofix.py +477 -0
- ara_cli-0.0.0.666/ara_cli/artefact_creator.py +146 -0
- ara_cli-0.0.0.666/ara_cli/artefact_deleter.py +51 -0
- ara_cli-0.0.0.666/ara_cli/artefact_fuzzy_search.py +64 -0
- ara_cli-0.0.0.666/ara_cli/artefact_link_updater.py +76 -0
- ara_cli-0.0.0.666/ara_cli/artefact_lister.py +136 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/__init__.py +0 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_load.py +10 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_mapping.py +39 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_model.py +414 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/artefact_templates.py +224 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/businessgoal_artefact_model.py +134 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/capability_artefact_model.py +94 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/epic_artefact_model.py +170 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/example_artefact_model.py +49 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/feature_artefact_model.py +467 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/issue_artefact_model.py +78 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/keyfeature_artefact_model.py +127 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/serialize_helper.py +18 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/task_artefact_model.py +109 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/userstory_artefact_model.py +193 -0
- ara_cli-0.0.0.666/ara_cli/artefact_models/vision_artefact_model.py +171 -0
- ara_cli-0.0.0.666/ara_cli/artefact_reader.py +175 -0
- ara_cli-0.0.0.666/ara_cli/artefact_renamer.py +93 -0
- ara_cli-0.0.0.666/ara_cli/artefact_scan.py +86 -0
- ara_cli-0.0.0.666/ara_cli/chat.py +739 -0
- ara_cli-0.0.0.666/ara_cli/classifier.py +74 -0
- ara_cli-0.0.0.666/ara_cli/codefusionretriever.py +53 -0
- ara_cli-0.0.0.666/ara_cli/codehierachieretriever.py +37 -0
- ara_cli-0.0.0.666/ara_cli/commandline_completer.py +42 -0
- ara_cli-0.0.0.666/ara_cli/directory_navigator.py +74 -0
- ara_cli-0.0.0.666/ara_cli/file_classifier.py +100 -0
- ara_cli-0.0.0.666/ara_cli/file_lister.py +54 -0
- ara_cli-0.0.0.666/ara_cli/filename_validator.py +4 -0
- ara_cli-0.0.0.666/ara_cli/list_filter.py +148 -0
- ara_cli-0.0.0.666/ara_cli/output_suppressor.py +17 -0
- ara_cli-0.0.0.666/ara_cli/prompt_chat.py +30 -0
- ara_cli-0.0.0.666/ara_cli/prompt_extractor.py +211 -0
- ara_cli-0.0.0.666/ara_cli/prompt_handler.py +464 -0
- ara_cli-0.0.0.666/ara_cli/prompt_rag.py +187 -0
- ara_cli-0.0.0.666/ara_cli/run_file_lister.py +69 -0
- ara_cli-0.0.0.666/ara_cli/tag_extractor.py +67 -0
- ara_cli-0.0.0.666/ara_cli/template_manager.py +151 -0
- ara_cli-0.0.0.666/ara_cli/templates/agile.artefacts +171 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +27 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md +0 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md +32 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +30 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md +37 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md +37 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md +32 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md +82 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +9 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +17 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +14 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +102 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +20 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +13 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/empty.commands.md +14 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +20 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +18 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +43 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +13 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/refactoring.commands.md +15 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +9 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +15 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +19 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/classify_task.intention.md +6 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/empty.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md +9 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_fix_steps_for_scenario.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_reverse_formulation_from_code.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation.intention.md +6 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation_update.intention.md +8 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_scenario_outline_extension.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/feature_update_formulation.intention.md +5 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/fibonacci_example_implementation.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/js_implementation_from_task_description.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/js_steps_implementation.intention.md +4 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/python_cli_implementation_with_test.intention.md +6 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/python_code_understanding.intention.md +18 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_prompt_control_by_status.intention.md +6 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_number.intention.md +4 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_status.intention.md +4 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md +55 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/code_analyst.rules.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/empty.rules.md +2 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/error_analyst.rules.md +13 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md +15 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/js_expert_developer.rules.md +9 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/product_owner.rules.md +22 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/python_behave.rules.md +13 -0
- ara_cli-0.0.0.666/ara_cli/templates/prompt-modules/rules/python_developer.rules.md +8 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.concept.exploration.md +76 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.concept.md +25 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.customer.exploration.md +62 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.customer.md +30 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.persona.exploration.md +106 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.persona.md +71 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.step.exploration.md +0 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.step.md +43 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.technology.exploration.md +77 -0
- ara_cli-0.0.0.666/ara_cli/templates/specification_breakdown_files/template.technology.md +23 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.businessgoal +10 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.businessgoal.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.capability +10 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.capability.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.epic +15 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.epic.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.example +6 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.example.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.feature +26 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.feature.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.issue +14 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.issue.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.keyfeature +15 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.keyfeature.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.steps.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.task +6 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.task.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.userstory +17 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.userstory.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.vision +14 -0
- ara_cli-0.0.0.666/ara_cli/templates/template.vision.prompt_log.md +7 -0
- ara_cli-0.0.0.666/ara_cli/update_config_prompt.py +123 -0
- ara_cli-0.0.0.666/ara_cli/version.py +2 -0
- ara_cli-0.0.0.666/ara_cli.egg-info/PKG-INFO +16 -0
- ara_cli-0.0.0.666/ara_cli.egg-info/SOURCES.txt +163 -0
- ara_cli-0.0.0.666/ara_cli.egg-info/dependency_links.txt +1 -0
- ara_cli-0.0.0.666/ara_cli.egg-info/entry_points.txt +2 -0
- ara_cli-0.0.0.666/ara_cli.egg-info/requires.txt +12 -0
- ara_cli-0.0.0.666/ara_cli.egg-info/top_level.txt +2 -0
- ara_cli-0.0.0.666/docker/base/requirements.txt +12 -0
- ara_cli-0.0.0.666/setup.cfg +4 -0
- ara_cli-0.0.0.666/setup.py +22 -0
- ara_cli-0.0.0.666/tests/__init__.py +0 -0
- ara_cli-0.0.0.666/tests/test_ara_command_action.py +692 -0
- ara_cli-0.0.0.666/tests/test_ara_config.py +59 -0
- ara_cli-0.0.0.666/tests/test_artefact_autofix.py +617 -0
- ara_cli-0.0.0.666/tests/test_artefact_fuzzy_search.py +32 -0
- ara_cli-0.0.0.666/tests/test_artefact_link_updater.py +48 -0
- ara_cli-0.0.0.666/tests/test_artefact_lister.py +631 -0
- ara_cli-0.0.0.666/tests/test_artefact_reader.py +16 -0
- ara_cli-0.0.0.666/tests/test_artefact_renamer.py +81 -0
- ara_cli-0.0.0.666/tests/test_artefact_scan.py +189 -0
- ara_cli-0.0.0.666/tests/test_chat.py +1070 -0
- ara_cli-0.0.0.666/tests/test_classifier.py +69 -0
- ara_cli-0.0.0.666/tests/test_directory_navigator.py +7 -0
- ara_cli-0.0.0.666/tests/test_file_classifier.py +271 -0
- ara_cli-0.0.0.666/tests/test_file_creator.py +60 -0
- ara_cli-0.0.0.666/tests/test_file_lister.py +122 -0
- ara_cli-0.0.0.666/tests/test_list_filter.py +205 -0
- ara_cli-0.0.0.666/tests/test_tag_extractor.py +83 -0
- ara_cli-0.0.0.666/tests/test_template_manager.py +106 -0
- ara_cli-0.0.0.666/tests/test_update_config_prompt.py +159 -0
|
@@ -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,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()
|