structkit 3.0.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 (77) hide show
  1. structkit/__init__.py +6 -0
  2. structkit/commands/__init__.py +17 -0
  3. structkit/commands/completion.py +65 -0
  4. structkit/commands/generate.py +397 -0
  5. structkit/commands/generate_schema.py +67 -0
  6. structkit/commands/import.py +63 -0
  7. structkit/commands/info.py +87 -0
  8. structkit/commands/init.py +52 -0
  9. structkit/commands/list.py +89 -0
  10. structkit/commands/mcp.py +100 -0
  11. structkit/commands/validate.py +129 -0
  12. structkit/completers.py +54 -0
  13. structkit/content_fetcher.py +249 -0
  14. structkit/contribs/README.md +271 -0
  15. structkit/contribs/ansible-playbook.yaml +38 -0
  16. structkit/contribs/chef-cookbook.yaml +51 -0
  17. structkit/contribs/ci-cd-pipelines.yaml +67 -0
  18. structkit/contribs/cloudformation-files.yaml +21 -0
  19. structkit/contribs/configs/chglog.yaml +31 -0
  20. structkit/contribs/configs/codeowners.yaml +3 -0
  21. structkit/contribs/configs/devcontainer.yaml +35 -0
  22. structkit/contribs/configs/editor-config.yaml +11 -0
  23. structkit/contribs/configs/eslint.yaml +30 -0
  24. structkit/contribs/configs/jshint.yaml +11 -0
  25. structkit/contribs/configs/kubectl.yaml +23 -0
  26. structkit/contribs/configs/prettier.yaml +19 -0
  27. structkit/contribs/docker-files.yaml +27 -0
  28. structkit/contribs/documentation-template.yaml +33 -0
  29. structkit/contribs/git-hooks.yaml +19 -0
  30. structkit/contribs/github/chatmodes/plan.yaml +18 -0
  31. structkit/contribs/github/instructions/generic.yaml +5 -0
  32. structkit/contribs/github/prompts/generic.yaml +4 -0
  33. structkit/contribs/github/prompts/react-form.yaml +17 -0
  34. structkit/contribs/github/prompts/security-api.yaml +8 -0
  35. structkit/contribs/github/prompts/struct.yaml +90 -0
  36. structkit/contribs/github/templates.yaml +91 -0
  37. structkit/contribs/github/workflows/codeql.yaml +88 -0
  38. structkit/contribs/github/workflows/execute-tf-workflow.yaml +39 -0
  39. structkit/contribs/github/workflows/labeler.yaml +77 -0
  40. structkit/contribs/github/workflows/pre-commit.yaml +27 -0
  41. structkit/contribs/github/workflows/release-drafter.yaml +77 -0
  42. structkit/contribs/github/workflows/run-struct.yaml +30 -0
  43. structkit/contribs/github/workflows/stale.yaml +16 -0
  44. structkit/contribs/helm-chart.yaml +160 -0
  45. structkit/contribs/kubernetes-manifests.yaml +103 -0
  46. structkit/contribs/project/custom-structures.yaml +24 -0
  47. structkit/contribs/project/generic.yaml +309 -0
  48. structkit/contribs/project/go.yaml +104 -0
  49. structkit/contribs/project/java.yaml +85 -0
  50. structkit/contribs/project/n8n.yaml +100 -0
  51. structkit/contribs/project/nodejs.yaml +101 -0
  52. structkit/contribs/project/python.yaml +136 -0
  53. structkit/contribs/project/ruby.yaml +130 -0
  54. structkit/contribs/project/rust.yaml +106 -0
  55. structkit/contribs/prompts/run-struct-trigger.yaml +18 -0
  56. structkit/contribs/terraform/apps/aws-accounts.yaml +21 -0
  57. structkit/contribs/terraform/apps/environments.yaml +41 -0
  58. structkit/contribs/terraform/apps/generic.yaml +41 -0
  59. structkit/contribs/terraform/apps/github-organization.yaml +40 -0
  60. structkit/contribs/terraform/apps/init.yaml +11 -0
  61. structkit/contribs/terraform/modules/generic.yaml +58 -0
  62. structkit/contribs/vagrant-files.yaml +21 -0
  63. structkit/file_item.py +182 -0
  64. structkit/filters.py +112 -0
  65. structkit/input_store.py +35 -0
  66. structkit/logging_config.py +36 -0
  67. structkit/main.py +85 -0
  68. structkit/mcp_server.py +347 -0
  69. structkit/model_wrapper.py +47 -0
  70. structkit/template_renderer.py +258 -0
  71. structkit/utils.py +36 -0
  72. structkit-3.0.0.dist-info/METADATA +182 -0
  73. structkit-3.0.0.dist-info/RECORD +77 -0
  74. structkit-3.0.0.dist-info/WHEEL +5 -0
  75. structkit-3.0.0.dist-info/entry_points.txt +2 -0
  76. structkit-3.0.0.dist-info/licenses/LICENSE +201 -0
  77. structkit-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,136 @@
1
+ files:
2
+ - .editorconfig:
3
+ content: |
4
+ # Editor configuration
5
+ root = true
6
+
7
+ [*]
8
+ indent_style = space
9
+ indent_size = 2
10
+ end_of_line = lf
11
+ charset = utf-8
12
+ trim_trailing_whitespace = true
13
+ insert_final_newline = true
14
+ - .env:
15
+ content: |
16
+ # Environment variables
17
+ - .env.example:
18
+ content: |
19
+ # Environment variables
20
+ - .gitignore:
21
+ content: |
22
+ # Ignore files generated by the app
23
+ .env
24
+ .venv
25
+ - setup.py:
26
+ content: |
27
+ from setuptools import setup, find_packages
28
+
29
+ setup(
30
+ name='python-app',
31
+ version='0.1.0',
32
+ packages=find_packages(),
33
+ install_requires=[
34
+ # 'flask',
35
+ ],
36
+ )
37
+ - setup.cfg:
38
+ content: |
39
+ [metadata]
40
+ name = python-app
41
+ version = 0.1.0
42
+ description = A python app
43
+ long_description = file: README.md
44
+ long_description_content_type = text/markdown
45
+ author = Your Name
46
+ author_email =
47
+ - pyproject.toml:
48
+ content: |
49
+ [build-system]
50
+ requires = ["setuptools", "wheel"]
51
+ build-backend = "setuptools.build_meta"
52
+ - Makefile:
53
+ content: |
54
+ .PHONY: init test install
55
+ test:
56
+ python -m unittest discover -s tests
57
+
58
+ init:
59
+ # if .venv is present, activate it
60
+ if [ -d .venv ]; then
61
+ . .venv/bin/activate
62
+ fi
63
+
64
+ # if .venv is not present, create it and install dependencies
65
+ if [ ! -d .venv ]; then
66
+ python3 -m venv .venv
67
+ . .venv/bin/activate && pip install -r requirements.txt
68
+ fi
69
+
70
+ install:
71
+ # if .venv is not present, create it and install dependencies
72
+ if [ ! -d .venv ]; then
73
+ python3 -m venv .venv
74
+ . .venv/bin/activate && pip install -r requirements.txt
75
+ fi
76
+ - MANIFEST.in:
77
+ content: |
78
+ include LICENSE
79
+ include README.md
80
+ - requirements.txt:
81
+ content: |
82
+ # Python dependencies
83
+ - LICENSE:
84
+ file: https://raw.githubusercontent.com/httpdss/structkit/main/LICENSE
85
+ - README.md:
86
+ content: |
87
+ # Generic App
88
+
89
+ ## Introduction
90
+
91
+ This is a generic app that can be used as a template for new projects.
92
+
93
+ ## Contribute
94
+
95
+ If you would like to contribute to this project, please follow the guidelines in the [CONTRIBUTING.md](.github/CONTRIBUTING.md) file.
96
+
97
+ ## License
98
+
99
+ This project is licensed under the terms of the [Apache 2.0](LICENSE) license.
100
+ - docs/REMOVE_ME.md:
101
+ content: |
102
+ # docs Folder
103
+
104
+ The documentation folder
105
+ - tests/REMOVE_ME.md:
106
+ content: |
107
+ # test Folder
108
+
109
+ Unit tests, integration tests… go here.
110
+ - tests/__init__.py:
111
+ content: |
112
+ # Test suite
113
+ - tests/test_module1.py:
114
+ content: |
115
+ import unittest
116
+
117
+ class TestModule1(unittest.TestCase):
118
+ def test_something(self):
119
+ self.assertEqual(True, True)
120
+ - tests/test_module2.py:
121
+ content: |
122
+ import unittest
123
+
124
+ class TestModule2(unittest.TestCase):
125
+ def test_something_else(self):
126
+ self.assertEqual(False, False)
127
+ - src/python-app/__init__.py:
128
+ content: ""
129
+ - src/python-app/module1.py:
130
+ content: |
131
+ def function1():
132
+ return True
133
+ - src/python-app/module2.py:
134
+ content: |
135
+ def function2():
136
+ return False
@@ -0,0 +1,130 @@
1
+ files:
2
+ - .editorconfig:
3
+ content: |
4
+ # Editor configuration
5
+ root = true
6
+
7
+ [*]
8
+ indent_style = space
9
+ indent_size = 2
10
+ end_of_line = lf
11
+ charset = utf-8
12
+ trim_trailing_whitespace = true
13
+ insert_final_newline = true
14
+ - .env:
15
+ content: |
16
+ # Environment variables
17
+ - .env.example:
18
+ content: |
19
+ # Environment variables
20
+ - .gitignore:
21
+ content: |
22
+ # Ignore files generated by the app
23
+ .env
24
+ .venv
25
+ - .ruby-version:
26
+ content: |
27
+ # Ruby version
28
+ 3.0.0
29
+ - .rubocop.yml:
30
+ content: |
31
+ # Rubocop configuration
32
+ AllCops:
33
+ TargetRubyVersion: 3.0
34
+ Exclude:
35
+ - 'db/schema.rb'
36
+ - 'db/migrate/*'
37
+ - 'bin/*'
38
+ - 'config/*'
39
+ - 'Gemfile'
40
+ - 'Rakefile'
41
+ - 'Guardfile'
42
+ - 'Capfile'
43
+ - 'Vagrantfile'
44
+ - 'config.ru'
45
+ - 'db/seeds.rb'
46
+ - 'db/schema.rb'
47
+ - 'db/structure.sql'
48
+ - 'db/*.sqlite3'
49
+ - 'log/*'
50
+ - 'tmp/*'
51
+ - 'vendor/*'
52
+ - 'node_modules/*'
53
+ - 'yarn-error.log'
54
+ - 'yarn-debug.log'
55
+ - 'yarn.lock'
56
+ - 'package-lock.json'
57
+ - 'Gemfile.lock'
58
+ - 'coverage/*'
59
+ - 'public/*'
60
+ - 'public/uploads/*'
61
+ - 'public/assets/*'
62
+ - 'public/packs
63
+ - LICENSE:
64
+ file: https://raw.githubusercontent.com/httpdss/structkit/main/LICENSE
65
+ - README.md:
66
+ content: |
67
+ # Generic App
68
+
69
+ ## Introduction
70
+
71
+ This is a generic app that can be used as a template for new projects.
72
+
73
+ ## Contribute
74
+
75
+ If you would like to contribute to this project, please follow the guidelines in the [CONTRIBUTING.md](.github/CONTRIBUTING.md) file.
76
+
77
+ ## License
78
+
79
+ This project is licensed under the terms of the [Apache 2.0](LICENSE) license.
80
+ - spec/REMOVE_ME.md:
81
+ content: |
82
+ # test Folder
83
+
84
+ Unit tests, integration tests… go here.
85
+ - spec/spec_helper.rb:
86
+ content: |
87
+ require 'rspec'
88
+ - spec/my_project_spec.rb:
89
+ content: |
90
+ require_relative 'spec_helper'
91
+
92
+ describe 'MyProject' do
93
+ it 'should do something' do
94
+ expect(true).to eq(true)
95
+ end
96
+ end
97
+ - lib/my_project/version.rb:
98
+ content: |
99
+ module MyProject
100
+ VERSION = '0.1.0'
101
+ end
102
+ - lib/my_project/main.rb:
103
+ content: |
104
+ require 'my_project/version'
105
+
106
+ module MyProject
107
+ class Main
108
+ def self.run
109
+ puts "Hello, world!"
110
+ end
111
+ end
112
+ end
113
+ - bin/console:
114
+ content: |
115
+ #!/usr/bin/env ruby
116
+
117
+ require 'irb'
118
+ require 'irb/completion'
119
+ require 'my_project'
120
+
121
+ ARGV.clear
122
+
123
+ IRB.start
124
+ - bin/setup:
125
+ content: |
126
+ #!/bin/bash
127
+
128
+ set -e
129
+
130
+ bundle install
@@ -0,0 +1,106 @@
1
+ files:
2
+ - .editorconfig:
3
+ content: |
4
+ # Editor configuration
5
+ root = true
6
+
7
+ [*]
8
+ indent_style = space
9
+ indent_size = 2
10
+ end_of_line = lf
11
+ charset = utf-8
12
+ trim_trailing_whitespace = true
13
+ insert_final_newline = true
14
+ - .env:
15
+ content: |
16
+ # Environment variables
17
+ - .env.example:
18
+ content: |
19
+ # Environment variables
20
+ - .gitignore:
21
+ content: |
22
+ # Ignore files generated by the app
23
+ .env
24
+ .venv
25
+ - LICENSE:
26
+ file: https://raw.githubusercontent.com/httpdss/structkit/main/LICENSE
27
+ - README.md:
28
+ content: |
29
+ # Generic App
30
+
31
+ ## Introduction
32
+
33
+ This is a generic app that can be used as a template for new projects.
34
+
35
+ ## Contribute
36
+
37
+ If you would like to contribute to this project, please follow the guidelines in the [CONTRIBUTING.md](.github/CONTRIBUTING.md) file.
38
+
39
+ ## License
40
+
41
+ This project is licensed under the terms of the [Apache 2.0](LICENSE) license.
42
+ - Cargo.toml:
43
+ content: |
44
+ [package]
45
+ name = "project_name"
46
+ version = "0.1.0"
47
+ edition = "2018"
48
+ authors = [""]
49
+ description = "A new Rust project"
50
+ - src/main.rs:
51
+ content: |
52
+ fn main() {
53
+ println!("Hello, world!");
54
+ }
55
+ - src/lib.rs:
56
+ content: |
57
+ pub fn add(a: i32, b: i32) -> i32 {
58
+ a + b
59
+ }
60
+ - module1.rs:
61
+ content: |
62
+ pub fn add(a: i32, b: i32) -> i32 {
63
+ a + b
64
+ }
65
+ - module2.rs:
66
+ content: |
67
+ pub fn sub(a: i32, b: i32) -> i32 {
68
+ a - b
69
+ }
70
+ - tests/integration_tests.rs:
71
+ content: |
72
+ #[cfg(test)]
73
+ mod tests {
74
+ use super::*;
75
+
76
+ #[test]
77
+ fn test_add() {
78
+ assert_eq!(add(1, 2), 3);
79
+ }
80
+
81
+ #[test]
82
+ fn test_sub() {
83
+ assert_eq!(sub(2, 1), 1);
84
+ }
85
+ }
86
+ - benches/benchmark.rs:
87
+ content: |
88
+ #[cfg(test)]
89
+ mod tests {
90
+ use super::*;
91
+ use test::Bencher;
92
+
93
+ #[bench]
94
+ fn bench_add(b: &mut Bencher) {
95
+ b.iter(|| add(1, 2));
96
+ }
97
+
98
+ #[bench]
99
+ fn bench_sub(b: &mut Bencher) {
100
+ b.iter(|| sub(2, 1));
101
+ }
102
+ }
103
+ - .cargo/config:
104
+ content: |
105
+ [build]
106
+ target = "x86_64-unknown-linux-musl"
@@ -0,0 +1,18 @@
1
+ files:
2
+ - run-struct-trigger.md:
3
+ content: |
4
+ You are a helpful assistant that can query Github Using MCP
5
+
6
+ I will need you to get the list of repositories that have the following topic: "{{@ topic @}}"
7
+ The organization should be "{{@ github_organization @}}"
8
+
9
+ To all those repositories, you will need to trigger a workflow called "run-struct"
10
+
11
+ variables:
12
+ - github_organization:
13
+ type: string
14
+ description: The organization to query for repositories
15
+ - topic:
16
+ type: string
17
+ description: The topic to query for repositories
18
+ default: "struct-enabled"
@@ -0,0 +1,21 @@
1
+ folders:
2
+ - .devops/apps/accounts/nonprod:
3
+ struct: terraform/apps/generic
4
+ with:
5
+ backend_organization_name: "my-organization"
6
+ backend_workspace_name: "accounts-nonprod"
7
+ - .devops/apps/accounts/prod:
8
+ struct: terraform/apps/generic
9
+ with:
10
+ backend_organization_name: "my-organization"
11
+ backend_workspace_name: "accounts-prod"
12
+ - ./:
13
+ struct: github/workflows/execute-tf-workflow
14
+ with:
15
+ app_name: accounts-nonprod
16
+ app_path: accounts/nonprod
17
+ - ./:
18
+ struct: github/workflows/execute-tf-workflow
19
+ with:
20
+ app_name: accounts-prod
21
+ app_path: accounts/prod
@@ -0,0 +1,41 @@
1
+ folders:
2
+ - .devops/apps/environments/dev:
3
+ struct: terraform/apps/generic
4
+ with:
5
+ backend_organization_name: "my-organization"
6
+ backend_workspace_name: "my-app-environments-dev"
7
+ - .devops/apps/environments/qa:
8
+ struct: terraform/apps/generic
9
+ with:
10
+ backend_organization_name: "my-organization"
11
+ backend_workspace_name: "my-app-environments-qa"
12
+ - .devops/apps/environments/stage:
13
+ struct: terraform/apps/generic
14
+ with:
15
+ backend_organization_name: "my-organization"
16
+ backend_workspace_name: "my-app-environments-stage"
17
+ - .devops/apps/environments/prod:
18
+ struct: terraform/apps/generic
19
+ with:
20
+ backend_organization_name: "my-organization"
21
+ backend_workspace_name: "my-app-environments-prod"
22
+ - ./:
23
+ struct: github/workflows/execute-tf-workflow
24
+ with:
25
+ app_name: environments-dev
26
+ app_path: environments/dev
27
+ - ./:
28
+ struct: github/workflows/execute-tf-workflow
29
+ with:
30
+ app_name: environments-qa
31
+ app_path: environments/qa
32
+ - ./:
33
+ struct: github/workflows/execute-tf-workflow
34
+ with:
35
+ app_name: environments-stage
36
+ app_path: environments/stage
37
+ - ./:
38
+ struct: github/workflows/execute-tf-workflow
39
+ with:
40
+ app_name: environments-prod
41
+ app_path: environments/prod
@@ -0,0 +1,41 @@
1
+ files:
2
+ - main.tf:
3
+ content: |
4
+ # This is the main Terraform app main file.
5
+ touch_file: 2025-01-01
6
+ - variables.tf:
7
+ content: "# This is the Terraform variables file."
8
+ - outputs.tf:
9
+ content: "# This is the Terraform outputs file."
10
+ - providers.tf:
11
+ content: |
12
+ terraform {
13
+ required_version = "{{@ "hashicorp/terraform" | latest_release @}}"
14
+
15
+ backend "remote" {
16
+ hostname = "app.terraform.io"
17
+ organization = "{{@ backend_organization_name @}}"
18
+
19
+ workspaces {
20
+ name = "{{@ backend_workspace_name @}}"
21
+ }
22
+ }
23
+ }
24
+ - README.md:
25
+ content: |
26
+ <!-- markdownlint-disable no-inline-html -->
27
+ <!-- markdownlint-disable no-bare-urls -->
28
+
29
+ This is a generic Terraform app.
30
+
31
+ <!-- BEGIN_TF_DOCS -->
32
+ <!-- END_TF_DOCS -->
33
+ variables:
34
+ - name: backend_organization_name
35
+ type: string
36
+ description: "Remote backend organization name."
37
+ default: ""
38
+ - name: backend_workspace_name
39
+ type: string
40
+ description: "Remote backend workspace name."
41
+ default: ""
@@ -0,0 +1,40 @@
1
+ files:
2
+ - providers.yaml:
3
+ content: |
4
+ provider "github" {
5
+ owner = "{{@ github_org @}}"
6
+ }
7
+
8
+ terraform {
9
+ required_providers {
10
+ github = {
11
+ source = "integrations/github"
12
+ version = "{{@ "integrations/github" | latest_release @}}"
13
+ }
14
+ }
15
+ backend "remote" {
16
+ organization = "{{@ github_org @}}"
17
+ workspaces {
18
+ name = "github-organization"
19
+ }
20
+ }
21
+ }
22
+ - main.tf:
23
+ content: |
24
+ touch_file: 2025-01-01
25
+ - variables.tf:
26
+ content: ""
27
+ - outputs.tf:
28
+ content: ""
29
+ - README.md:
30
+ content: |
31
+ <!-- markdownlint-disable no-inline-html -->
32
+ <!-- markdownlint-disable no-bare-urls -->
33
+
34
+ <!-- BEGIN_TF_DOCS -->
35
+ <!-- END_TF_DOCS -->
36
+ variables:
37
+ - name: github_org
38
+ type: string
39
+ description: "GitHub organization name."
40
+ default: ""
@@ -0,0 +1,11 @@
1
+ folders:
2
+ - .devops/apps/init:
3
+ struct: terraform/apps/generic
4
+ with:
5
+ backend_organization_name: "my-organization"
6
+ backend_workspace_name: "my-app-init"
7
+ - ./:
8
+ struct: github/workflows/execute-tf-workflow
9
+ with:
10
+ app_name: init
11
+ app_path: init
@@ -0,0 +1,58 @@
1
+ files:
2
+ - main.tf:
3
+ content: |
4
+ resource "aws_instance" "example" {
5
+ ami = "ami-0c55b159cbfafe1f0"
6
+ instance_type = "t2.micro"
7
+ }
8
+ - variables.tf:
9
+ content: |
10
+ variable "instance_type" {
11
+ description = "Type of instance to launch"
12
+ type = string
13
+ default = "t2.micro"
14
+ }
15
+ - outputs.tf:
16
+ content: |
17
+ output "instance_id" {
18
+ value = aws_instance.example.id
19
+ }
20
+ - versions.tf:
21
+ content: |
22
+ terraform {
23
+ required_providers {
24
+ aws = {
25
+ source = "hashicorp/aws"
26
+ version = "{{@ "hashicorp/terraform-provider-aws" | latest_release @}}"
27
+ }
28
+ datadog = {
29
+ source = "DataDog/datadog"
30
+ version = "{{@ "DataDog/terraform-provider-datadog" | latest_release @}}"
31
+ }
32
+ }
33
+ }
34
+ - README.md:
35
+ content: |
36
+ <!-- markdownlint-disable no-inline-html -->
37
+ <!-- markdownlint-disable no-bare-urls -->
38
+
39
+ # {{@ module_name @}}
40
+
41
+ This module provisions an EC2 instance on AWS.
42
+
43
+ ## Usage
44
+
45
+ ```hcl
46
+ module "example" {
47
+ source = "./path/to/module/{{@ module_name | slugify @}}"
48
+ instance_type = "t2.micro"
49
+ }
50
+ ```
51
+
52
+ <!-- BEGIN_TF_DOCS -->
53
+ <!-- END_TF_DOCS -->
54
+ variables:
55
+ - module_name:
56
+ description: "The name of the module."
57
+ type: string
58
+ default: "example-module"
@@ -0,0 +1,21 @@
1
+ files:
2
+ - Vagrantfile:
3
+ content: |
4
+ Vagrant.configure("2") do |config|
5
+ config.vm.box = "ubuntu/bionic64"
6
+ config.vm.provision "shell", path: "bootstrap.sh"
7
+ end
8
+ - bootstrap.sh:
9
+ permissions: 755
10
+ content: |
11
+ #!/bin/bash
12
+ apt-get update
13
+ apt-get install -y nginx
14
+ - README.md:
15
+ content: |
16
+ # Project Name
17
+ Vagrant setup for development environment.
18
+ ## Usage
19
+ ```bash
20
+ vagrant up
21
+ ```