Skip to main content

Module cli

Module cli 

Source
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 exit 0. Useful for non-interactive callers wanting to generate an --answers payload 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 (A4 of plans/next-gen-deployment.md).
bundle_fetch
Fetch a .gtbundle from a remote bundle_source_uri to a local file, so op env apply can stage a revision from a registry reference without a local bundle_path on the apply host.
bundle_stage
Local .gtbundle staging into an env’s revision directory. Two callers: the deployer’s op 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} (A3 of plans/next-gen-deployment.md).
env_apply
gtc op env apply — declarative, upsert-only environment apply (PR-1 + PR-2 of plans/env-manifest-apply.md).
env_manifest
greentic.env-manifest.v1 — the declarative desired-state document consumed by gtc op env apply (PR-1 of plans/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> (A4b of plans/next-gen-deployment.md).
migrate_state
gtc op env migrate-state <env_id> — archive the legacy <state_dir>/deploy/ artifact tree (A6 of plans/next-gen-deployment.md).
pack_config_stage
Stage-time pack-config-input.v1pack-config.v1 materializer (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 of plans/next-gen-deployment.md).
updates
gtc op updates {enroll,status} — P1b update-channel client-certificate enrollment (Phase 1 of the Greentic updater).

Structs§

OpFlags
Mode flags shared by every op subcommand.
OpOutcome
Standard success envelope.

Enums§

OpError
Top-level error shared across op command 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 pipe gtc … --schema | jq … > answers.txt without re-extensioning.
render_error
Render an OpError into the standard JSON error envelope.