vcf-super-cli 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.
- vcf_super_cli-0.2.0/.github/workflows/docs.yml +46 -0
- vcf_super_cli-0.2.0/.github/workflows/e2e.yml +31 -0
- vcf_super_cli-0.2.0/.github/workflows/lint.yml +28 -0
- vcf_super_cli-0.2.0/.github/workflows/release.yml +120 -0
- vcf_super_cli-0.2.0/.github/workflows/test.yml +30 -0
- vcf_super_cli-0.2.0/.gitignore +34 -0
- vcf_super_cli-0.2.0/AGENTS.md +37 -0
- vcf_super_cli-0.2.0/CHANGELOG.md +60 -0
- vcf_super_cli-0.2.0/LICENSE +202 -0
- vcf_super_cli-0.2.0/PKG-INFO +101 -0
- vcf_super_cli-0.2.0/README.md +69 -0
- vcf_super_cli-0.2.0/docs/commands.md +64 -0
- vcf_super_cli-0.2.0/docs/design.md +31 -0
- vcf_super_cli-0.2.0/docs/index.md +38 -0
- vcf_super_cli-0.2.0/docs/install.md +42 -0
- vcf_super_cli-0.2.0/docs/profiles.md +62 -0
- vcf_super_cli-0.2.0/docs/superpowers/specs/2026-06-05-vcf-super-cli-design.md +139 -0
- vcf_super_cli-0.2.0/docs/superpowers/specs/2026-06-05-vcf-super-cli-v0.2-writes-design.md +174 -0
- vcf_super_cli-0.2.0/docs/usage.md +55 -0
- vcf_super_cli-0.2.0/docs/writes.md +101 -0
- vcf_super_cli-0.2.0/mkdocs.yml +44 -0
- vcf_super_cli-0.2.0/pyproject.toml +117 -0
- vcf_super_cli-0.2.0/tests/__init__.py +0 -0
- vcf_super_cli-0.2.0/tests/e2e/README.md +26 -0
- vcf_super_cli-0.2.0/tests/e2e/__init__.py +0 -0
- vcf_super_cli-0.2.0/tests/e2e/conftest.py +48 -0
- vcf_super_cli-0.2.0/tests/e2e/test_read_smoke.py +42 -0
- vcf_super_cli-0.2.0/tests/test_builder.py +289 -0
- vcf_super_cli-0.2.0/tests/test_cli.py +59 -0
- vcf_super_cli-0.2.0/tests/test_config.py +271 -0
- vcf_super_cli-0.2.0/tests/test_discover.py +168 -0
- vcf_super_cli-0.2.0/tests/test_errors.py +58 -0
- vcf_super_cli-0.2.0/tests/test_params.py +167 -0
- vcf_super_cli-0.2.0/tests/test_preview.py +84 -0
- vcf_super_cli-0.2.0/tests/test_render.py +81 -0
- vcf_super_cli-0.2.0/tests/test_session.py +11 -0
- vcf_super_cli-0.2.0/tests/test_skill.py +37 -0
- vcf_super_cli-0.2.0/tests/test_version.py +25 -0
- vcf_super_cli-0.2.0/tests/test_write_errors.py +98 -0
- vcf_super_cli-0.2.0/uv.lock +1462 -0
- vcf_super_cli-0.2.0/vsc/__init__.py +11 -0
- vcf_super_cli-0.2.0/vsc/_version.py +7 -0
- vcf_super_cli-0.2.0/vsc/cli/__init__.py +0 -0
- vcf_super_cli-0.2.0/vsc/cli/app.py +98 -0
- vcf_super_cli-0.2.0/vsc/cli/profiles.py +208 -0
- vcf_super_cli-0.2.0/vsc/cli/skill.py +28 -0
- vcf_super_cli-0.2.0/vsc/config/__init__.py +7 -0
- vcf_super_cli-0.2.0/vsc/config/schema.py +39 -0
- vcf_super_cli-0.2.0/vsc/config/store.py +105 -0
- vcf_super_cli-0.2.0/vsc/connect/__init__.py +6 -0
- vcf_super_cli-0.2.0/vsc/connect/session.py +73 -0
- vcf_super_cli-0.2.0/vsc/connect/targets.py +121 -0
- vcf_super_cli-0.2.0/vsc/gen/__init__.py +7 -0
- vcf_super_cli-0.2.0/vsc/gen/builder.py +243 -0
- vcf_super_cli-0.2.0/vsc/gen/discover.py +221 -0
- vcf_super_cli-0.2.0/vsc/gen/model.py +104 -0
- vcf_super_cli-0.2.0/vsc/gen/params.py +232 -0
- vcf_super_cli-0.2.0/vsc/gen/preview.py +82 -0
- vcf_super_cli-0.2.0/vsc/logging_config.py +30 -0
- vcf_super_cli-0.2.0/vsc/output/__init__.py +0 -0
- vcf_super_cli-0.2.0/vsc/output/errors.py +106 -0
- vcf_super_cli-0.2.0/vsc/output/exit_codes.py +40 -0
- vcf_super_cli-0.2.0/vsc/output/render.py +134 -0
- vcf_super_cli-0.2.0/vsc/skill/__init__.py +1 -0
- vcf_super_cli-0.2.0/vsc/skill/assets/SKILL.md +96 -0
- vcf_super_cli-0.2.0/vsc/skill/export.py +26 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: docs-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
- name: Sync (docs)
|
|
27
|
+
run: uv sync --group docs
|
|
28
|
+
- name: Build site
|
|
29
|
+
run: uv run mkdocs build --strict
|
|
30
|
+
- name: Upload pages artifact
|
|
31
|
+
if: github.ref == 'refs/heads/main'
|
|
32
|
+
uses: actions/upload-pages-artifact@v3
|
|
33
|
+
with:
|
|
34
|
+
path: site
|
|
35
|
+
|
|
36
|
+
deploy:
|
|
37
|
+
if: github.ref == 'refs/heads/main'
|
|
38
|
+
needs: build
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
environment:
|
|
41
|
+
name: github-pages
|
|
42
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
43
|
+
steps:
|
|
44
|
+
- name: Deploy to GitHub Pages
|
|
45
|
+
id: deployment
|
|
46
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: e2e
|
|
2
|
+
|
|
3
|
+
# Live tests against a real vCenter/NSX. Manual only; reads connection details
|
|
4
|
+
# from repository secrets. Individual tests self-skip when their backend's
|
|
5
|
+
# secrets are not configured.
|
|
6
|
+
on:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
e2e:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- name: Install uv
|
|
15
|
+
uses: astral-sh/setup-uv@v5
|
|
16
|
+
with:
|
|
17
|
+
enable-cache: true
|
|
18
|
+
- name: Sync (dev)
|
|
19
|
+
run: uv sync --group dev
|
|
20
|
+
- name: Run e2e
|
|
21
|
+
env:
|
|
22
|
+
VSC_E2E: "1"
|
|
23
|
+
VSC_VSPHERE_SERVER: ${{ secrets.VSC_VSPHERE_SERVER }}
|
|
24
|
+
VSC_VSPHERE_USERNAME: ${{ secrets.VSC_VSPHERE_USERNAME }}
|
|
25
|
+
VSC_VSPHERE_PASSWORD: ${{ secrets.VSC_VSPHERE_PASSWORD }}
|
|
26
|
+
VSC_VSPHERE_INSECURE: ${{ secrets.VSC_VSPHERE_INSECURE }}
|
|
27
|
+
VSC_NSX_SERVER: ${{ secrets.VSC_NSX_SERVER }}
|
|
28
|
+
VSC_NSX_USERNAME: ${{ secrets.VSC_NSX_USERNAME }}
|
|
29
|
+
VSC_NSX_PASSWORD: ${{ secrets.VSC_NSX_PASSWORD }}
|
|
30
|
+
VSC_NSX_INSECURE: ${{ secrets.VSC_NSX_INSECURE }}
|
|
31
|
+
run: uv run pytest tests/e2e -v
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: lint-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v5
|
|
19
|
+
with:
|
|
20
|
+
enable-cache: true
|
|
21
|
+
- name: Sync (dev)
|
|
22
|
+
run: uv sync --group dev
|
|
23
|
+
- name: Ruff (lint)
|
|
24
|
+
run: uv run ruff check .
|
|
25
|
+
- name: Ruff (format check)
|
|
26
|
+
run: uv run ruff format --check .
|
|
27
|
+
- name: mypy
|
|
28
|
+
run: uv run mypy vsc
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# Tag-only trigger. NEVER on pull_request or branch push — the trusted
|
|
4
|
+
# publisher is bound to this workflow filename + the v* tag pattern.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v[0-9]*.[0-9]*.[0-9]*"
|
|
9
|
+
|
|
10
|
+
# Trusted publishing requires id-token: write so the OIDC token issued to
|
|
11
|
+
# pypa/gh-action-pypi-publish is signed.
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write # gh release create
|
|
14
|
+
id-token: write # PyPI trusted publishing OIDC
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: release
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
release:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
# No `environment:` block — the PyPI trusted publisher for this project is
|
|
24
|
+
# registered with a blank Environment, so the OIDC subject must NOT carry one.
|
|
25
|
+
# Adding an `environment:` here changes the subject claim and breaks the match.
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout (full history for changelog notes)
|
|
28
|
+
uses: actions/checkout@v6
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Verify tag is on main
|
|
33
|
+
run: |
|
|
34
|
+
set -euo pipefail
|
|
35
|
+
git fetch origin main
|
|
36
|
+
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
|
|
37
|
+
echo "Tag $GITHUB_REF_NAME points at $GITHUB_SHA which is not reachable from main." >&2
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
echo "Tag $GITHUB_REF_NAME ($GITHUB_SHA) is on main."
|
|
41
|
+
|
|
42
|
+
- name: Install uv
|
|
43
|
+
uses: astral-sh/setup-uv@v7
|
|
44
|
+
with:
|
|
45
|
+
enable-cache: true
|
|
46
|
+
|
|
47
|
+
- name: Install Python
|
|
48
|
+
run: uv python install 3.12
|
|
49
|
+
|
|
50
|
+
- name: Sync runtime deps (so the next step can import vsc._version)
|
|
51
|
+
run: uv sync --frozen
|
|
52
|
+
|
|
53
|
+
- name: Verify tag matches package version
|
|
54
|
+
run: |
|
|
55
|
+
set -euo pipefail
|
|
56
|
+
tag_version="${GITHUB_REF_NAME#v}"
|
|
57
|
+
pkg_version="$(uv run python -c 'from vsc._version import __version__; print(__version__)')"
|
|
58
|
+
if [ "$tag_version" != "$pkg_version" ]; then
|
|
59
|
+
echo "Tag $GITHUB_REF_NAME -> $tag_version does not match vsc/_version.py $pkg_version" >&2
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
echo "Tag $GITHUB_REF_NAME matches package version $pkg_version"
|
|
63
|
+
|
|
64
|
+
- name: Build sdist + wheel
|
|
65
|
+
run: |
|
|
66
|
+
rm -rf dist
|
|
67
|
+
uv build --out-dir dist
|
|
68
|
+
ls -la dist/
|
|
69
|
+
|
|
70
|
+
- name: Verify wheel + sdist filenames match tag
|
|
71
|
+
run: |
|
|
72
|
+
set -euo pipefail
|
|
73
|
+
tag_version="${GITHUB_REF_NAME#v}"
|
|
74
|
+
if ! ls "dist/vcf_super_cli-${tag_version}-py3-none-any.whl" >/dev/null 2>&1; then
|
|
75
|
+
echo "Wheel for ${tag_version} not found in dist/" >&2; ls dist/ >&2; exit 1
|
|
76
|
+
fi
|
|
77
|
+
if ! ls "dist/vcf_super_cli-${tag_version}.tar.gz" >/dev/null 2>&1; then
|
|
78
|
+
echo "Sdist for ${tag_version} not found in dist/" >&2; ls dist/ >&2; exit 1
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
- name: Publish to PyPI (trusted publishing)
|
|
82
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
83
|
+
with:
|
|
84
|
+
packages-dir: dist
|
|
85
|
+
verbose: true
|
|
86
|
+
skip-existing: true
|
|
87
|
+
|
|
88
|
+
- name: Extract changelog section for release notes
|
|
89
|
+
run: |
|
|
90
|
+
set -euo pipefail
|
|
91
|
+
tag_version="${GITHUB_REF_NAME#v}"
|
|
92
|
+
awk -v ver="$tag_version" '
|
|
93
|
+
$0 ~ "^## v" ver " " { capture=1; print; next }
|
|
94
|
+
capture && /^## / { exit }
|
|
95
|
+
capture { print }
|
|
96
|
+
' CHANGELOG.md > /tmp/release-notes.md
|
|
97
|
+
if [ ! -s /tmp/release-notes.md ]; then
|
|
98
|
+
echo "Release notes for v${tag_version} not found in CHANGELOG.md" >&2
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
- name: Create GitHub Release
|
|
103
|
+
env:
|
|
104
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
105
|
+
run: |
|
|
106
|
+
set -euo pipefail
|
|
107
|
+
tag_version="${GITHUB_REF_NAME#v}"
|
|
108
|
+
whl="dist/vcf_super_cli-${tag_version}-py3-none-any.whl"
|
|
109
|
+
sdist="dist/vcf_super_cli-${tag_version}.tar.gz"
|
|
110
|
+
# Idempotent: PyPI publish above is skip-existing, so a re-run must not
|
|
111
|
+
# hard-fail here just because the GitHub Release already exists.
|
|
112
|
+
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
|
|
113
|
+
gh release edit "$GITHUB_REF_NAME" \
|
|
114
|
+
--title "$GITHUB_REF_NAME" --notes-file /tmp/release-notes.md
|
|
115
|
+
gh release upload "$GITHUB_REF_NAME" "$whl" "$sdist" --clobber
|
|
116
|
+
else
|
|
117
|
+
gh release create "$GITHUB_REF_NAME" \
|
|
118
|
+
--title "$GITHUB_REF_NAME" --notes-file /tmp/release-notes.md \
|
|
119
|
+
"$whl" "$sdist"
|
|
120
|
+
fi
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: test-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.12", "3.13"]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v5
|
|
23
|
+
with:
|
|
24
|
+
enable-cache: true
|
|
25
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
26
|
+
run: uv python install ${{ matrix.python-version }}
|
|
27
|
+
- name: Sync (dev)
|
|
28
|
+
run: uv sync --group dev
|
|
29
|
+
- name: Run tests
|
|
30
|
+
run: uv run --python ${{ matrix.python-version }} pytest --cov=vsc --cov-report=term-missing
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
.installed.cfg
|
|
9
|
+
|
|
10
|
+
# Virtualenv / uv
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
.python-version
|
|
14
|
+
|
|
15
|
+
# Tooling caches
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.coverage
|
|
20
|
+
coverage.xml
|
|
21
|
+
htmlcov/
|
|
22
|
+
|
|
23
|
+
# Docs build
|
|
24
|
+
site/
|
|
25
|
+
|
|
26
|
+
# Local config / secrets
|
|
27
|
+
*.local
|
|
28
|
+
.env
|
|
29
|
+
profiles.local.*
|
|
30
|
+
|
|
31
|
+
# Editors / OS
|
|
32
|
+
.idea/
|
|
33
|
+
.vscode/
|
|
34
|
+
.DS_Store
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Guidance for AI agents and contributors working in this repo.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
`vcf-super-cli` (`vsc`) — a CLI for VMware Cloud Foundation 9. The command tree is
|
|
8
|
+
**generated** by introspecting the `vcf-sdk` vAPI bindings (`vsc.gen`), not hand
|
|
9
|
+
written. Two product groups: `vsc vsphere …` (vCenter) and `vsc nsx …` (NSX Policy).
|
|
10
|
+
|
|
11
|
+
## Project conventions
|
|
12
|
+
|
|
13
|
+
- Python ≥3.12. Managed with **uv**. Build backend: hatchling.
|
|
14
|
+
- Lint/format: **ruff** (`uv run ruff check .`, `uv run ruff format .`).
|
|
15
|
+
- Types: **mypy --strict** (`uv run mypy vsc`).
|
|
16
|
+
- Tests: **pytest** (`uv run pytest`). Live-server tests live in `tests/e2e/`
|
|
17
|
+
and are ignored by default.
|
|
18
|
+
- Output is JSON by default; errors use a stable envelope; exit codes are a frozen
|
|
19
|
+
`IntEnum` in `vsc/output/exit_codes.py` — extend, never renumber.
|
|
20
|
+
- v0.1 is **read-only**. Writes (v0.2) must be dry-run by default, gated on `--apply`.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
Work is **issue-driven**. One issue → one branch → PR → review → fix → merge.
|
|
25
|
+
Do not push directly to `main`. See open issues for the roadmap.
|
|
26
|
+
|
|
27
|
+
## Where things go
|
|
28
|
+
|
|
29
|
+
| Concern | Location |
|
|
30
|
+
|---------|----------|
|
|
31
|
+
| Entry point / Typer app | `vsc/cli/` |
|
|
32
|
+
| SDK introspection + command generation | `vsc/gen/` |
|
|
33
|
+
| Connections / auth | `vsc/connect/` |
|
|
34
|
+
| Profiles / config | `vsc/config/` |
|
|
35
|
+
| Output, errors, exit codes | `vsc/output/` |
|
|
36
|
+
| Bundled agent Skill | `vsc/skill/assets/SKILL.md` (export via `vsc skill export`) |
|
|
37
|
+
| Design spec | `docs/superpowers/specs/` |
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `vcf-super-cli` are documented here. The format is based
|
|
4
|
+
on [Keep a Changelog](https://keepachangelog.com/), and from v1.0.0 the project
|
|
5
|
+
will follow [Semantic Versioning](https://semver.org/). While on `0.x`, minor
|
|
6
|
+
versions may include breaking changes.
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## v0.2.0 — 2026-06-05
|
|
11
|
+
|
|
12
|
+
First PyPI release. Adds the **write** surface on top of the v0.1 read-only
|
|
13
|
+
foundation, with a dry-run-by-default safety model.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Write operations** (`POST`/`PUT`/`PATCH`/`DELETE`) are generated from the
|
|
18
|
+
`vcf-sdk` vAPI metadata alongside reads (#20). Clean, collision-free verbs:
|
|
19
|
+
`POST ?action=X` → `X`; otherwise `PUT` → `set`, `PATCH` → `patch`,
|
|
20
|
+
`DELETE` → `delete` (force variants prefixed `force-`); `POST` without an
|
|
21
|
+
action keeps its operation id.
|
|
22
|
+
- **Dry-run by default + `--apply`** (#21). Every write previews the resolved
|
|
23
|
+
request and changes nothing — and opens **no connection** — unless `--apply`
|
|
24
|
+
is passed. `--apply` is the only gate (no interactive prompt), so the CLI
|
|
25
|
+
stays fully scriptable. New `vsc/gen/preview.py` builds the request plan.
|
|
26
|
+
- **Stable write envelope**, identical across modes — branch on `applied`:
|
|
27
|
+
- dry-run: `{ "applied": false, "request": { method, url, path_params, query, body, … }, "apply_hint": … }`
|
|
28
|
+
- applied: `{ "applied": true, "request": { … }, "result": <sdk response> }`
|
|
29
|
+
- **Body/spec construction from JSON** for both conventions: NSX's named request
|
|
30
|
+
body and vCenter's spec parameters, built into the SDK binding structs.
|
|
31
|
+
- **Catalog expansion**: vSphere `resource-pool` and the VM power/hardware leaves
|
|
32
|
+
(`power`, `cpu`, `memory`, `disk`, `ethernet`); NSX `ip-pools`,
|
|
33
|
+
`dhcp-server-configs`, `dhcp-relay-configs`, and Tier-1 `locale-services`.
|
|
34
|
+
- **`CONFLICT` (7) / `UNAVAILABLE` (8)** exit-code coverage for write errors
|
|
35
|
+
(#22), derived from the error-type map so it can't drift.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- A malformed or incomplete write body is reported during the dry-run as the
|
|
40
|
+
structured usage envelope (exit `2`) — before any connection — not as a
|
|
41
|
+
traceback.
|
|
42
|
+
- Documentation and the bundled agent `SKILL.md` describe the write surface and
|
|
43
|
+
the `--apply` safety model (#23).
|
|
44
|
+
|
|
45
|
+
## v0.1.0 — 2026-06-05
|
|
46
|
+
|
|
47
|
+
Initial read-only foundation (not published to PyPI).
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- Command tree **generated dynamically** by introspecting the installed `vcf-sdk`
|
|
52
|
+
vAPI bindings (`VapiInterface` services + `OperationRestMetadata`), fully
|
|
53
|
+
offline — `--help` works without a server or credentials.
|
|
54
|
+
- Read (`GET`) commands for vSphere/vCenter (`vsc vsphere …`) and NSX Policy
|
|
55
|
+
(`vsc nsx …`), split into two product groups.
|
|
56
|
+
- Named **profiles** with env-var overrides and optional OS-keyring secret
|
|
57
|
+
storage; `--profile/-p` selection.
|
|
58
|
+
- **Output contract**: JSON by default, `--output table` for humans; a stable
|
|
59
|
+
error envelope on stderr and documented, frozen **exit codes**.
|
|
60
|
+
- Bundled agent **Skill** shipped in the wheel, exportable via `vsc skill export`.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|