datasecops-cli 0.1.0__tar.gz → 0.2.0__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 (51) hide show
  1. datasecops_cli-0.2.0/CHANGELOG.md +78 -0
  2. datasecops_cli-0.2.0/PKG-INFO +165 -0
  3. datasecops_cli-0.2.0/README.md +145 -0
  4. datasecops_cli-0.2.0/docs/getting-started.md +355 -0
  5. datasecops_cli-0.2.0/docs/mcp-server.md +259 -0
  6. datasecops_cli-0.2.0/mcp-servers.json +28 -0
  7. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/pyproject.toml +4 -1
  8. datasecops_cli-0.2.0/setup.ps1 +239 -0
  9. datasecops_cli-0.2.0/setup.sh +210 -0
  10. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/main.py +77 -4
  11. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/menus/development.py +32 -1
  12. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/menus/downloads.py +18 -2
  13. datasecops_cli-0.2.0/src/datasecops_cli/services/bootstrap_service.py +139 -0
  14. datasecops_cli-0.2.0/src/datasecops_cli/services/download_service.py +216 -0
  15. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/services/linting_service.py +34 -1
  16. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/services/snowflake_service.py +3 -0
  17. datasecops_cli-0.2.0/src/datasecops_mcp/__init__.py +1 -0
  18. datasecops_cli-0.2.0/src/datasecops_mcp/__main__.py +5 -0
  19. datasecops_cli-0.2.0/src/datasecops_mcp/connection.py +123 -0
  20. datasecops_cli-0.2.0/src/datasecops_mcp/server.py +458 -0
  21. datasecops_cli-0.1.0/PKG-INFO +0 -16
  22. datasecops_cli-0.1.0/setup.ps1 +0 -98
  23. datasecops_cli-0.1.0/setup.sh +0 -97
  24. datasecops_cli-0.1.0/src/datasecops_cli/services/download_service.py +0 -103
  25. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/.github/workflows/publish-cli.yml +0 -0
  26. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/.gitignore +0 -0
  27. /datasecops_cli-0.1.0/README.md → /datasecops_cli-0.2.0/DEVELOPMENT.md +0 -0
  28. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/LICENSE +0 -0
  29. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/docs/legacy.md +0 -0
  30. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/docs/legacy_plan_of_action.md +0 -0
  31. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/__init__.py +0 -0
  32. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/config.py +0 -0
  33. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/menus/__init__.py +0 -0
  34. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/menus/git_operations.py +0 -0
  35. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/models/__init__.py +0 -0
  36. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/models/git_helpers.py +0 -0
  37. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/models/project_config.py +0 -0
  38. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/services/__init__.py +0 -0
  39. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/services/dbt_runner.py +0 -0
  40. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/services/git_service.py +0 -0
  41. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/services/skill_service.py +0 -0
  42. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/utilities/__init__.py +0 -0
  43. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/utilities/display.py +0 -0
  44. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/utilities/file_utils.py +0 -0
  45. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/src/datasecops_cli/utilities/yaml_utils.py +0 -0
  46. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/tests/__init__.py +0 -0
  47. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/tests/test_config.py +0 -0
  48. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/tests/test_file_utils.py +0 -0
  49. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/tests/test_models.py +0 -0
  50. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/tests/test_version.py +0 -0
  51. {datasecops_cli-0.1.0 → datasecops_cli-0.2.0}/tests/test_yaml_utils.py +0 -0
@@ -0,0 +1,78 @@
1
+ # Changelog
2
+
3
+ All notable changes to the DataSecOps CLI are documented in this file.
4
+
5
+ ## [0.2.0] - 2026-05-09
6
+
7
+ ### Added
8
+
9
+ - **MCP Server** — new `datasecops-mcp` server exposes framework governance config to AI coding tools (VS Code, Cursor, Cortex Code, Claude Code)
10
+ - `get_branching_rules` — branch types, naming conventions, ticket requirements
11
+ - `get_linting_rules` — SQLFluff rules from the native app
12
+ - `get_dbt_packages` — approved packages with pinned versions
13
+ - `get_pipeline_config` — CI/CD pipeline templates (GitHub/Azure DevOps)
14
+ - `get_dbt_versions` — mandated dbt and SQLFluff versions
15
+ - `get_project_settings` — project paths, execution mode, targets
16
+ - `get_project_profiles` — all registered dbt projects
17
+ - `get_deployment_targets` — environment targets with roles and warehouses
18
+ - `get_available_skills` — Cortex Code skills metadata
19
+ - `get_default_macros` — default macros for a project profile
20
+ - `validate_branch_name` — validates branch names against framework conventions
21
+ - `get_deployment_workflow` — environment promotion flow
22
+ - `lint_sql` — lint a SQL file using project's SQLFluff config
23
+ - `fix_sql` — auto-fix linting issues in a SQL file
24
+ - `lint_project` — lint or fix all models in the project
25
+
26
+ - **Bootstrap command** — `datasecops bootstrap` sets up a new dbt project in one step:
27
+ 1. Runs `dbtf init` and generates `profiles.yml` from framework targets
28
+ 2. Downloads default macros for the project profile
29
+ 3. Downloads `.sqlfluff` linting configuration
30
+ 4. Downloads CI/CD pipeline files (GitHub Actions or Azure DevOps)
31
+ 5. Downloads `packages.yml` with approved versions
32
+ 6. Runs `dbt deps`
33
+ 7. Checks SQLFluff version requirements
34
+ 8. Installs Cortex Code skills
35
+ - Also available from main menu as option [4]
36
+
37
+ - **Macro downloads** — new `api.get_macros_for_profile` integration
38
+ - Downloads default macros (e.g., `generate_schema_name`) to `macros/` directory
39
+ - Available in downloads menu as option [4]
40
+ - Included in bootstrap process
41
+
42
+ - **MCP server configuration in setup scripts** — `setup.sh` and `setup.ps1` now:
43
+ - Check for Node.js (needed for GitHub/Azure DevOps MCP servers)
44
+ - Install with MCP support (`datasecops-cli[mcp]`)
45
+ - Optionally install `dbt-mcp`
46
+ - Interactively configure MCP servers for VS Code, Cursor, or Cortex Code
47
+ - Support GitHub and Azure DevOps PAT configuration
48
+
49
+ - **MCP server integration guide** (`mcp-servers.json`) — example config for running framework, dbt, GitHub, and Azure DevOps MCP servers together
50
+
51
+ ### Changed
52
+
53
+ - `pyproject.toml` — added `mcp` optional dependency group and `datasecops-mcp` script entry point
54
+ - Main menu now shows option [4] for bootstrap
55
+ - Downloads menu reordered: macros is option [4], skills is [5], new project is [6]
56
+ - Setup scripts install `datasecops-cli[mcp]` by default instead of `datasecops-cli`
57
+
58
+ ### Documentation
59
+
60
+ - `docs/getting-started.md` — full setup guide for CLI + MCP servers with VS Code, Cursor, Cortex Code
61
+ - `docs/mcp-server.md` — MCP server reference with tool documentation, architecture, and usage examples
62
+ - `README.md` — updated with MCP server section, recommended server stack, and new documentation links
63
+
64
+ ## [0.1.0] - 2025-03-05
65
+
66
+ ### Added
67
+
68
+ - Initial release of the DataSecOps CLI
69
+ - Interactive menu-driven interface for dbt development, git operations, and configuration downloads
70
+ - dbt commands via dbt Fusion subprocess (run, build, test, lint, compile, snapshot, freshness, docs, seed, deps, clean, debug, list, retry)
71
+ - Git operations via GitPython (branching, commit, push, pull, rebase, squash, deploy, cherry-pick)
72
+ - Configuration downloads from native app (SQLFluff rules, CI/CD pipelines, dbt packages, Cortex Code skills)
73
+ - Framework-enforced branch naming conventions
74
+ - Environment branch deployment (dev/test/prod)
75
+ - SQLFluff linting with framework-managed rules
76
+ - Snowflake Native App integration via stored procedures
77
+ - Cross-platform support (Windows, Linux, macOS)
78
+ - PyPI distribution with GitHub Actions OIDC publishing
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: datasecops-cli
3
+ Version: 0.2.0
4
+ Summary: DataSecOps Framework CLI for Snowflake Native App
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: colorama>=0.4
9
+ Requires-Dist: gitpython>=3.1
10
+ Requires-Dist: pydantic>=2.0
11
+ Requires-Dist: pyyaml>=6.0
12
+ Requires-Dist: snowflake-connector-python>=3.0
13
+ Requires-Dist: sqlfluff>=3.0
14
+ Provides-Extra: mcp
15
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
16
+ Provides-Extra: test
17
+ Requires-Dist: pytest-cov>=4.0; extra == 'test'
18
+ Requires-Dist: pytest>=7.0; extra == 'test'
19
+ Description-Content-Type: text/markdown
20
+
21
+ # DataSecOps CLI
22
+
23
+ A command-line interface for the [Data Engineers DataSecOps Native App](https://app.snowflake.com/marketplace) on Snowflake. Streamlines dbt development, source control workflows, and framework configuration management for teams using the DataSecOps Framework.
24
+
25
+ ## What is this?
26
+
27
+ The DataSecOps CLI is the local developer companion to the **Data Engineers DataSecOps Native App** — a Snowflake Native App that provides governance, configuration management, and standardised development workflows for data teams.
28
+
29
+ This CLI connects to the native app and gives developers:
30
+
31
+ - **dbt development commands** — run, build, test, lint, and manage dbt projects via dbt Fusion
32
+ - **Source control operations** — branching, committing, rebasing, and deploying via GitPython with naming conventions enforced by the framework
33
+ - **Configuration downloads** — pull SQLFluff rules, CI/CD pipelines, dbt packages, and Cortex Code skills from the native app to your local project
34
+ - **MCP server** — expose framework governance rules to AI coding assistants (VS Code, Cursor, Cortex Code, Claude Code)
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install datasecops-cli
40
+ ```
41
+
42
+ With MCP server support:
43
+
44
+ ```bash
45
+ pip install "datasecops-cli[mcp]"
46
+ ```
47
+
48
+ Requires Python 3.10 or later.
49
+
50
+ ## Prerequisites
51
+
52
+ - A Snowflake connection configured in `~/.snowflake/connections.toml`
53
+ - The **Data Engineers DataSecOps Native App** installed in your Snowflake account
54
+ - A project profile created in the native app
55
+
56
+ Optional:
57
+
58
+ - **dbt Fusion** (or dbt-core with dbt-snowflake) for dbt commands
59
+ - **Cortex Code** for skill downloads
60
+ - **Node.js 18+** for GitHub/Azure DevOps MCP servers
61
+
62
+ ## Quick Start
63
+
64
+ ### 1. Run the setup script
65
+
66
+ The setup script creates a virtual environment, installs the CLI, and writes your local configuration.
67
+
68
+ **Linux / macOS:**
69
+
70
+ ```bash
71
+ chmod +x setup.sh && ./setup.sh
72
+ ```
73
+
74
+ **Windows (PowerShell):**
75
+
76
+ ```powershell
77
+ .\setup.ps1
78
+ ```
79
+
80
+ You'll be prompted for your Snowflake connection name and the native app database name.
81
+
82
+ ### 2. Activate the virtual environment and run
83
+
84
+ ```bash
85
+ source .venv/bin/activate # Linux/macOS
86
+ .\.venv\Scripts\Activate.ps1 # Windows
87
+
88
+ datasecops
89
+ ```
90
+
91
+ ## Features
92
+
93
+ | Menu | Capabilities |
94
+ |------|-------------|
95
+ | **Development** | dbt run, build, test, lint (SQLFluff), deps, seed, compile, snapshot, freshness, docs |
96
+ | **Git** | Branch create/checkout/delete, commit & push, rebase, squash, deploy to environment branches, cherry-pick |
97
+ | **Downloads** | SQLFluff config, CI/CD pipelines (GitHub Actions / Azure DevOps), dbt packages, Cortex Code skills |
98
+
99
+ ## MCP Server
100
+
101
+ The package includes an MCP (Model Context Protocol) server that exposes your framework's governance configuration to AI coding assistants. Instead of static skill files, the MCP server gives AI tools live access to your native app's current rules.
102
+
103
+ ### Available Tools
104
+
105
+ | Category | Tools |
106
+ |----------|-------|
107
+ | **Configuration** | `get_branching_rules`, `get_linting_rules`, `get_dbt_packages`, `get_pipeline_config`, `get_dbt_versions` |
108
+ | **Project** | `get_project_settings`, `get_project_profiles`, `get_deployment_targets`, `get_available_skills` |
109
+ | **Linting** | `lint_sql`, `fix_sql`, `lint_project` |
110
+ | **Source Control** | `validate_branch_name`, `get_deployment_workflow` |
111
+
112
+ ### Setup for AI Tools
113
+
114
+ **Cortex Code:**
115
+
116
+ ```bash
117
+ cortex mcp add datasecops-framework -- datasecops-mcp
118
+ ```
119
+
120
+ **VS Code / Cursor** — add to `.vscode/mcp.json` or `.cursor/mcp.json`:
121
+
122
+ ```json
123
+ {
124
+ "mcpServers": {
125
+ "datasecops-framework": {
126
+ "command": "datasecops-mcp",
127
+ "args": []
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ### Recommended MCP Server Stack
134
+
135
+ For full integration with Snowflake, dbt, and your source control platform, configure these MCP servers alongside the framework server:
136
+
137
+ | Server | Purpose | Install |
138
+ |--------|---------|---------|
139
+ | **datasecops-framework** | Governance rules, linting, branch validation | Included (`datasecops-mcp`) |
140
+ | **dbt** | Lineage, model discovery, codegen, semantic layer | `pip install dbt-mcp` |
141
+ | **GitHub** | PRs, issues, CI checks, releases | `npx -y @modelcontextprotocol/server-github` |
142
+ | **Azure DevOps** | PRs, pipelines, work items, boards | `npx -y @tiberriver256/mcp-server-azure-devops` |
143
+
144
+ See the [Getting Started Guide](docs/getting-started.md) for full configuration instructions for each editor and platform.
145
+
146
+ ## Configuration
147
+
148
+ The CLI reads from a `.datasecops.yml` file in your project root (created by the setup script):
149
+
150
+ ```yaml
151
+ connection_name: "my_connection"
152
+ app_database: "DATA_ENGINEERS_DATASECOPS_FRAMEWORK"
153
+ ```
154
+
155
+ Project profiles, linting rules, pipeline templates, and deployment targets are all managed centrally in the native app and pulled down by the CLI.
156
+
157
+ ## Documentation
158
+
159
+ - [Getting Started Guide](docs/getting-started.md) — install CLI, configure MCP servers for VS Code/Cursor/Cortex Code with Snowflake, dbt, and GitHub/Azure DevOps
160
+ - [MCP Server Reference](docs/mcp-server.md) — full tool documentation, architecture, and usage examples
161
+ - [Development Guide](DEVELOPMENT.md) — project structure, setup scripts, native app API reference, and publishing details
162
+
163
+ ## License
164
+
165
+ MIT
@@ -0,0 +1,145 @@
1
+ # DataSecOps CLI
2
+
3
+ A command-line interface for the [Data Engineers DataSecOps Native App](https://app.snowflake.com/marketplace) on Snowflake. Streamlines dbt development, source control workflows, and framework configuration management for teams using the DataSecOps Framework.
4
+
5
+ ## What is this?
6
+
7
+ The DataSecOps CLI is the local developer companion to the **Data Engineers DataSecOps Native App** — a Snowflake Native App that provides governance, configuration management, and standardised development workflows for data teams.
8
+
9
+ This CLI connects to the native app and gives developers:
10
+
11
+ - **dbt development commands** — run, build, test, lint, and manage dbt projects via dbt Fusion
12
+ - **Source control operations** — branching, committing, rebasing, and deploying via GitPython with naming conventions enforced by the framework
13
+ - **Configuration downloads** — pull SQLFluff rules, CI/CD pipelines, dbt packages, and Cortex Code skills from the native app to your local project
14
+ - **MCP server** — expose framework governance rules to AI coding assistants (VS Code, Cursor, Cortex Code, Claude Code)
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install datasecops-cli
20
+ ```
21
+
22
+ With MCP server support:
23
+
24
+ ```bash
25
+ pip install "datasecops-cli[mcp]"
26
+ ```
27
+
28
+ Requires Python 3.10 or later.
29
+
30
+ ## Prerequisites
31
+
32
+ - A Snowflake connection configured in `~/.snowflake/connections.toml`
33
+ - The **Data Engineers DataSecOps Native App** installed in your Snowflake account
34
+ - A project profile created in the native app
35
+
36
+ Optional:
37
+
38
+ - **dbt Fusion** (or dbt-core with dbt-snowflake) for dbt commands
39
+ - **Cortex Code** for skill downloads
40
+ - **Node.js 18+** for GitHub/Azure DevOps MCP servers
41
+
42
+ ## Quick Start
43
+
44
+ ### 1. Run the setup script
45
+
46
+ The setup script creates a virtual environment, installs the CLI, and writes your local configuration.
47
+
48
+ **Linux / macOS:**
49
+
50
+ ```bash
51
+ chmod +x setup.sh && ./setup.sh
52
+ ```
53
+
54
+ **Windows (PowerShell):**
55
+
56
+ ```powershell
57
+ .\setup.ps1
58
+ ```
59
+
60
+ You'll be prompted for your Snowflake connection name and the native app database name.
61
+
62
+ ### 2. Activate the virtual environment and run
63
+
64
+ ```bash
65
+ source .venv/bin/activate # Linux/macOS
66
+ .\.venv\Scripts\Activate.ps1 # Windows
67
+
68
+ datasecops
69
+ ```
70
+
71
+ ## Features
72
+
73
+ | Menu | Capabilities |
74
+ |------|-------------|
75
+ | **Development** | dbt run, build, test, lint (SQLFluff), deps, seed, compile, snapshot, freshness, docs |
76
+ | **Git** | Branch create/checkout/delete, commit & push, rebase, squash, deploy to environment branches, cherry-pick |
77
+ | **Downloads** | SQLFluff config, CI/CD pipelines (GitHub Actions / Azure DevOps), dbt packages, Cortex Code skills |
78
+
79
+ ## MCP Server
80
+
81
+ The package includes an MCP (Model Context Protocol) server that exposes your framework's governance configuration to AI coding assistants. Instead of static skill files, the MCP server gives AI tools live access to your native app's current rules.
82
+
83
+ ### Available Tools
84
+
85
+ | Category | Tools |
86
+ |----------|-------|
87
+ | **Configuration** | `get_branching_rules`, `get_linting_rules`, `get_dbt_packages`, `get_pipeline_config`, `get_dbt_versions` |
88
+ | **Project** | `get_project_settings`, `get_project_profiles`, `get_deployment_targets`, `get_available_skills` |
89
+ | **Linting** | `lint_sql`, `fix_sql`, `lint_project` |
90
+ | **Source Control** | `validate_branch_name`, `get_deployment_workflow` |
91
+
92
+ ### Setup for AI Tools
93
+
94
+ **Cortex Code:**
95
+
96
+ ```bash
97
+ cortex mcp add datasecops-framework -- datasecops-mcp
98
+ ```
99
+
100
+ **VS Code / Cursor** — add to `.vscode/mcp.json` or `.cursor/mcp.json`:
101
+
102
+ ```json
103
+ {
104
+ "mcpServers": {
105
+ "datasecops-framework": {
106
+ "command": "datasecops-mcp",
107
+ "args": []
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ ### Recommended MCP Server Stack
114
+
115
+ For full integration with Snowflake, dbt, and your source control platform, configure these MCP servers alongside the framework server:
116
+
117
+ | Server | Purpose | Install |
118
+ |--------|---------|---------|
119
+ | **datasecops-framework** | Governance rules, linting, branch validation | Included (`datasecops-mcp`) |
120
+ | **dbt** | Lineage, model discovery, codegen, semantic layer | `pip install dbt-mcp` |
121
+ | **GitHub** | PRs, issues, CI checks, releases | `npx -y @modelcontextprotocol/server-github` |
122
+ | **Azure DevOps** | PRs, pipelines, work items, boards | `npx -y @tiberriver256/mcp-server-azure-devops` |
123
+
124
+ See the [Getting Started Guide](docs/getting-started.md) for full configuration instructions for each editor and platform.
125
+
126
+ ## Configuration
127
+
128
+ The CLI reads from a `.datasecops.yml` file in your project root (created by the setup script):
129
+
130
+ ```yaml
131
+ connection_name: "my_connection"
132
+ app_database: "DATA_ENGINEERS_DATASECOPS_FRAMEWORK"
133
+ ```
134
+
135
+ Project profiles, linting rules, pipeline templates, and deployment targets are all managed centrally in the native app and pulled down by the CLI.
136
+
137
+ ## Documentation
138
+
139
+ - [Getting Started Guide](docs/getting-started.md) — install CLI, configure MCP servers for VS Code/Cursor/Cortex Code with Snowflake, dbt, and GitHub/Azure DevOps
140
+ - [MCP Server Reference](docs/mcp-server.md) — full tool documentation, architecture, and usage examples
141
+ - [Development Guide](DEVELOPMENT.md) — project structure, setup scripts, native app API reference, and publishing details
142
+
143
+ ## License
144
+
145
+ MIT