Expand description
gtc op command surface (A3 of plans/next-gen-deployment.md).
Library-level command implementations for the operator wizard. Each submodule exposes one noun:
env— Environment CRUD (create,update,list,show,doctor,destroy)env_packs— Env-pack bindings (add,update,remove,rollback,list)bundles— Application bundle deployments (add,update,remove,list)revisions— Revision lifecycle (stage,warm,drain,archive,list)traffic— Traffic-split management (set,show,rollback)config— Host/setup/runtime config inspection (show,set)credentials— Credential modes (requirements,bootstrap,rotate)secrets— Secrets management (list,put,get,rotate)
Every command pair honors:
--schema— dump the JSON schema of the input payload it would accept, then exit0. Useful for non-interactive callers wanting to generate an--answerspayload programmatically.--answers <path>— read a JSON/YAML payload from disk for a non-interactive replay. Interactive prompting is out of scope for A3; wizard rendering lands in A10.
Heavy logic that depends on env-pack handlers (deployer dispatch, secrets
backend, telemetry exporter, etc.) is deferred to later Phase A gates (A5,
A7, A9) and Phase C. A3 wires the command surface against the
EnvironmentStore from A2 and intentionally stubs paths that would
require those gates with a clear not-yet-implemented error.
§Output
Every command writes structured JSON to a Write sink chosen by the
caller. Stable schema: { "op": "<verb>", "noun": "<noun>", "result": ... }
for success; { "op": "<verb>", "noun": "<noun>", "error": { ... } } for
failure. Human-readable rendering is layered on by the caller (operator
binary or gtc op passthrough); the library stays output-format-neutral.
Modules§
- bootstrap
ensure_local_environment(A4ofplans/next-gen-deployment.md).- bundle_
fetch - Fetch a
.gtbundlefrom a remotebundle_source_urito a local file, soop env applycan stage a revision from a registry reference without a localbundle_pathon the apply host. - bundle_
stage - Local
.gtbundlestaging into an env’s revision directory. Two callers: the deployer’sop revisions stage --bundle(stage_local_bundle), and a remote worker re-materializing an already-staged revision at boot (materialize_revision_from_bundle). - bundles
gtc op bundles {add,update,remove,list}(A3).- config
gtc op config {show,set}(A3).- credentials
gtc op credentials {requirements,bootstrap,rotate}(C1).- deploy
gtc op deploy— the one-shot bundle deployment orchestrator.- dispatch
- Clap-derive dispatcher for
greentic-deployer op …(A3). - env
gtc op env {create,update,list,show,doctor,destroy}(A3ofplans/next-gen-deployment.md).- env_
apply gtc op env apply— declarative, upsert-only environment apply (PR-1 + PR-2 ofplans/env-manifest-apply.md).- env_
manifest greentic.env-manifest.v1— the declarative desired-state document consumed bygtc op env apply(PR-1 ofplans/env-manifest-apply.md).- env_
packs gtc op env-packs {add,update,remove,rollback,list}(A3).- extensions
gtc op extensions {add,update,remove,rollback,list}(Path 3).- messaging
gtc op messaging endpoint {add,list,show,link-bundle,unlink-bundle,set-welcome-flow,remove}(Phase M1.2).- migrate
gtc op env migrate-dev <target>(A4bofplans/next-gen-deployment.md).- migrate_
state gtc op env migrate-state <env_id>— archive the legacy<state_dir>/deploy/artifact tree (A6 ofplans/next-gen-deployment.md).- pack_
config_ stage - Stage-time
pack-config-input.v1→pack-config.v1materializer (C7 PR4). - revisions
gtc op revisions {stage,warm,drain,archive,list}(A3).- secrets
gtc op secrets {list,put,get,rotate}(A3).- traffic
gtc op traffic {set,show,rollback}(A3).- trust_
root gtc op env trust-root {list,add,remove}(C2 ofplans/next-gen-deployment.md).- updates
gtc op updates {enroll,status}— P1b update-channel client-certificate enrollment (Phase 1 of the Greentic updater).
Structs§
Enums§
- OpError
- Top-level error shared across
opcommand implementations.
Functions§
- load_
answers - Read an answers payload from disk as JSON or YAML. The path extension
disambiguates:
.json→ JSON,.yaml/.yml→ YAML. Other extensions fall back to JSON (with a YAML retry on parse failure) so callers can pipegtc … --schema | jq … > answers.txtwithout re-extensioning. - render_
error - Render an
OpErrorinto the standard JSON error envelope.