opsmith-cli 0.2.0b0__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 (119) hide show
  1. opsmith_cli-0.2.0b0/.flake8 +3 -0
  2. opsmith_cli-0.2.0b0/.github/workflows/python-publish.yml +70 -0
  3. opsmith_cli-0.2.0b0/.gitignore +197 -0
  4. opsmith_cli-0.2.0b0/.pre-commit-config.yaml +22 -0
  5. opsmith_cli-0.2.0b0/CONVENTIONS.md +16 -0
  6. opsmith_cli-0.2.0b0/LICENSE.txt +674 -0
  7. opsmith_cli-0.2.0b0/PKG-INFO +37 -0
  8. opsmith_cli-0.2.0b0/README.md +1 -0
  9. opsmith_cli-0.2.0b0/opsmith/__init__.py +0 -0
  10. opsmith_cli-0.2.0b0/opsmith/agent.py +105 -0
  11. opsmith_cli-0.2.0b0/opsmith/cloud_providers/__init__.py +3 -0
  12. opsmith_cli-0.2.0b0/opsmith/cloud_providers/aws.py +158 -0
  13. opsmith_cli-0.2.0b0/opsmith/cloud_providers/base.py +182 -0
  14. opsmith_cli-0.2.0b0/opsmith/cloud_providers/gcp.py +197 -0
  15. opsmith_cli-0.2.0b0/opsmith/constants.py +175 -0
  16. opsmith_cli-0.2.0b0/opsmith/deployment_strategies/__init__.py +3 -0
  17. opsmith_cli-0.2.0b0/opsmith/deployment_strategies/base.py +474 -0
  18. opsmith_cli-0.2.0b0/opsmith/deployment_strategies/monolithic.py +1037 -0
  19. opsmith_cli-0.2.0b0/opsmith/exceptions.py +10 -0
  20. opsmith_cli-0.2.0b0/opsmith/git_repo.py +66 -0
  21. opsmith_cli-0.2.0b0/opsmith/infra_provisioners/__init__.py +0 -0
  22. opsmith_cli-0.2.0b0/opsmith/infra_provisioners/ansible_provisioner.py +50 -0
  23. opsmith_cli-0.2.0b0/opsmith/infra_provisioners/base_provisioner.py +98 -0
  24. opsmith_cli-0.2.0b0/opsmith/infra_provisioners/terraform_provisioner.py +80 -0
  25. opsmith_cli-0.2.0b0/opsmith/main.py +576 -0
  26. opsmith_cli-0.2.0b0/opsmith/models.py +223 -0
  27. opsmith_cli-0.2.0b0/opsmith/prompts.py +223 -0
  28. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/README.md +7 -0
  29. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/arduino-tags.scm +5 -0
  30. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/c-tags.scm +9 -0
  31. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
  32. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/chatito-tags.scm +16 -0
  33. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/commonlisp-tags.scm +122 -0
  34. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/cpp-tags.scm +15 -0
  35. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/csharp-tags.scm +26 -0
  36. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/d-tags.scm +26 -0
  37. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/dart-tags.scm +92 -0
  38. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/elisp-tags.scm +5 -0
  39. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/elixir-tags.scm +54 -0
  40. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/elm-tags.scm +19 -0
  41. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/gleam-tags.scm +41 -0
  42. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/go-tags.scm +42 -0
  43. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/hcl-tags.scm +77 -0
  44. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/java-tags.scm +20 -0
  45. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/javascript-tags.scm +88 -0
  46. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
  47. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/lua-tags.scm +34 -0
  48. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
  49. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
  50. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/php-tags.scm +26 -0
  51. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/pony-tags.scm +39 -0
  52. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/properties-tags.scm +5 -0
  53. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/python-tags.scm +14 -0
  54. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/ql-tags.scm +26 -0
  55. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/r-tags.scm +21 -0
  56. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/racket-tags.scm +12 -0
  57. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/ruby-tags.scm +64 -0
  58. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/rust-tags.scm +60 -0
  59. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/scala-tags.scm +65 -0
  60. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/solidity-tags.scm +43 -0
  61. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/swift-tags.scm +51 -0
  62. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/typescript-tags.scm +41 -0
  63. opsmith_cli-0.2.0b0/opsmith/queries/tree-sitter-languages/udev-tags.scm +20 -0
  64. opsmith_cli-0.2.0b0/opsmith/repo_map.py +571 -0
  65. opsmith_cli-0.2.0b0/opsmith/service_detector.py +342 -0
  66. opsmith_cli-0.2.0b0/opsmith/settings.py +29 -0
  67. opsmith_cli-0.2.0b0/opsmith/templates/cloud_storage_cleanup/aws/main.yml +24 -0
  68. opsmith_cli-0.2.0b0/opsmith/templates/cloud_storage_cleanup/gcp/main.yml +24 -0
  69. opsmith_cli-0.2.0b0/opsmith/templates/container_registry/aws/main.tf +12 -0
  70. opsmith_cli-0.2.0b0/opsmith/templates/container_registry/aws/outputs.tf +4 -0
  71. opsmith_cli-0.2.0b0/opsmith/templates/container_registry/aws/variables.tf +14 -0
  72. opsmith_cli-0.2.0b0/opsmith/templates/container_registry/gcp/main.tf +11 -0
  73. opsmith_cli-0.2.0b0/opsmith/templates/container_registry/gcp/outputs.tf +4 -0
  74. opsmith_cli-0.2.0b0/opsmith/templates/container_registry/gcp/variables.tf +19 -0
  75. opsmith_cli-0.2.0b0/opsmith/templates/docker_build_push/aws/main.yml +51 -0
  76. opsmith_cli-0.2.0b0/opsmith/templates/docker_build_push/gcp/main.yml +45 -0
  77. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_deploy/aws/main.yml +91 -0
  78. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_deploy/gcp/main.yml +81 -0
  79. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_run/common/main.yml +19 -0
  80. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/base.yml +14 -0
  81. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/elasticsearch.yml +16 -0
  82. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/kafka.yml +20 -0
  83. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/mongodb.yml +13 -0
  84. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/mysql.yml +14 -0
  85. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/postgresql.yml +13 -0
  86. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/rabbitmq.yml +13 -0
  87. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/redis.yml +9 -0
  88. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/services/backend_api.yml +15 -0
  89. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/services/backend_worker.yml +3 -0
  90. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/services/full_stack.yml +14 -0
  91. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/traefik.yml +49 -0
  92. opsmith_cli-0.2.0b0/opsmith/templates/docker_compose_snippets/weaviate.yml +15 -0
  93. opsmith_cli-0.2.0b0/opsmith/templates/docker_setup/aws/main.yml +36 -0
  94. opsmith_cli-0.2.0b0/opsmith/templates/docker_setup/gcp/main.yml +38 -0
  95. opsmith_cli-0.2.0b0/opsmith/templates/fetch_remote_files/common/main.yml +22 -0
  96. opsmith_cli-0.2.0b0/opsmith/templates/frontend_bucket_cert/aws/main.tf +33 -0
  97. opsmith_cli-0.2.0b0/opsmith/templates/frontend_bucket_cert/aws/outputs.tf +21 -0
  98. opsmith_cli-0.2.0b0/opsmith/templates/frontend_bucket_cert/aws/variables.tf +15 -0
  99. opsmith_cli-0.2.0b0/opsmith/templates/frontend_bucket_cert/gcp/main.tf +27 -0
  100. opsmith_cli-0.2.0b0/opsmith/templates/frontend_bucket_cert/gcp/outputs.tf +10 -0
  101. opsmith_cli-0.2.0b0/opsmith/templates/frontend_bucket_cert/gcp/variables.tf +19 -0
  102. opsmith_cli-0.2.0b0/opsmith/templates/frontend_cdn/aws/main.tf +96 -0
  103. opsmith_cli-0.2.0b0/opsmith/templates/frontend_cdn/aws/outputs.tf +21 -0
  104. opsmith_cli-0.2.0b0/opsmith/templates/frontend_cdn/aws/variables.tf +25 -0
  105. opsmith_cli-0.2.0b0/opsmith/templates/frontend_cdn/gcp/main.tf +47 -0
  106. opsmith_cli-0.2.0b0/opsmith/templates/frontend_cdn/gcp/outputs.tf +21 -0
  107. opsmith_cli-0.2.0b0/opsmith/templates/frontend_cdn/gcp/variables.tf +29 -0
  108. opsmith_cli-0.2.0b0/opsmith/templates/frontend_deploy/aws/main.yml +28 -0
  109. opsmith_cli-0.2.0b0/opsmith/templates/frontend_deploy/gcp/main.yml +74 -0
  110. opsmith_cli-0.2.0b0/opsmith/templates/virtual_machine/aws/main.tf +136 -0
  111. opsmith_cli-0.2.0b0/opsmith/templates/virtual_machine/aws/outputs.tf +14 -0
  112. opsmith_cli-0.2.0b0/opsmith/templates/virtual_machine/aws/variables.tf +19 -0
  113. opsmith_cli-0.2.0b0/opsmith/templates/virtual_machine/gcp/main.tf +74 -0
  114. opsmith_cli-0.2.0b0/opsmith/templates/virtual_machine/gcp/outputs.tf +14 -0
  115. opsmith_cli-0.2.0b0/opsmith/templates/virtual_machine/gcp/variables.tf +24 -0
  116. opsmith_cli-0.2.0b0/opsmith/types.py +312 -0
  117. opsmith_cli-0.2.0b0/opsmith/utils.py +114 -0
  118. opsmith_cli-0.2.0b0/pyproject.toml +56 -0
  119. opsmith_cli-0.2.0b0/uv.lock +2708 -0
@@ -0,0 +1,3 @@
1
+ [flake8]
2
+ ignore = E203,W503,E501
3
+ max-line-length = 100
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install uv
33
+ uv build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ url: https://pypi.org/p/opsmith-cli
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/opsmith-cli/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,197 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ .idea/
169
+
170
+ # Abstra
171
+ # Abstra is an AI-powered process automation framework.
172
+ # Ignore directories containing user credentials, local state, and settings.
173
+ # Learn more at https://abstra.io/docs
174
+ .abstra/
175
+
176
+ # Visual Studio Code
177
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
180
+ # you could uncomment the following to ignore the enitre vscode folder
181
+ # .vscode/
182
+
183
+ # Ruff stuff:
184
+ .ruff_cache/
185
+
186
+ # PyPI configuration file
187
+ .pypirc
188
+
189
+ # Cursor
190
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
191
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192
+ # refer to https://docs.cursor.com/context/ignore-files
193
+ .cursorignore
194
+ .cursorindexingignore
195
+
196
+ # Aider
197
+ .aider*
@@ -0,0 +1,22 @@
1
+ repos:
2
+ - repo: https://github.com/PyCQA/isort
3
+ rev: 5.12.0
4
+ hooks:
5
+ - id: isort
6
+ args: ["--profile", "black"]
7
+ - repo: https://github.com/psf/black
8
+ rev: 23.3.0
9
+ hooks:
10
+ - id: black
11
+ args: ["--line-length", "100", "--preview"]
12
+ - repo: https://github.com/pycqa/flake8
13
+ rev: 7.1.0
14
+ hooks:
15
+ - id: flake8
16
+ args: ["--show-source"]
17
+ - repo: https://github.com/codespell-project/codespell
18
+ rev: v2.2.6
19
+ hooks:
20
+ - id: codespell
21
+ additional_dependencies:
22
+ - tomli
@@ -0,0 +1,16 @@
1
+ # Engineering Conventions
2
+
3
+ ## Conventions
4
+ > When writing code follow these conventions
5
+
6
+ - Write simple verbose code over terse, compact, dense code
7
+ - Use types everywhere possible.
8
+ - Add logs where applicable so that debugging becomes easy
9
+ - Add docstring to functions that describe its use
10
+ - Add try/except blocks sparingly, only where it is essential
11
+
12
+ ## Project Structure
13
+
14
+ - `opsmith/` - source code for this CLI tool
15
+ - `opsmith/main.py` - typer app is defined here, include commands exposed by this CLI Tool
16
+