Zum Inhalt springen

GTC CLI Überblick

Die GTC CLI (gtc) ist die primäre Kommandozeilenschnittstelle für die Greentic-Plattform. Sie stellt Befehle bereit für:

  • Das Erstellen und Verwalten von Bundles
  • Das Einrichten von Providern
  • Das Ausführen des Runtime-Servers
  • Das Bauen und Validieren von Packs/Flows
Terminal-Fenster
cargo install greentic-cli

Installation überprüfen:

Terminal-Fenster
gtc --version

Die gtc-Binärdatei setzt Unterbefehle aus mehreren Repositories zusammen:

BefehlSource RepoZweck
gtc wizardgreentic-devAssistent zur Bundle-Erstellung
gtc setupgreentic-setupProvider-Einrichtung/-Konfiguration
gtc startgreentic-startRuntime-Server
gtc packgreentic-packPack-Build
gtc flowgreentic-flowFlow-Validierung
Terminal-Fenster
gtc [OPTIONS] <COMMAND>
Options:
-v, --verbose Enable verbose output
-q, --quiet Suppress non-essential output
--config <PATH> Path to config file
-h, --help Print help
-V, --version Print version
BefehlBeschreibung
wizardEin neues Bundle aus Assistentenantworten erstellen
setupProvider in einem Bundle konfigurieren
startDen Runtime-Server starten
packPack-Verwaltung (build, verify, publish)
flowFlow-Verwaltung (validate, doctor)
Terminal-Fenster
# 1. Create bundle from wizard
gtc wizard --answers wizard-answers.yaml
# 2. Setup providers (interactive)
gtc setup ./my-bundle
# 3. Start the runtime
gtc start ./my-bundle
Terminal-Fenster
# Validate flows
gtc flow doctor ./my-bundle/apps/my-app/flows/
# Build a pack
gtc pack build ./my-pack/
# Start with verbose logging
gtc start ./my-bundle --verbose
# Start with ngrok tunnel
gtc start ./my-bundle --ngrok on
Terminal-Fenster
# Setup with answers file (non-interactive)
gtc setup --answers production-answers.json ./my-bundle
# Start without tunnels
gtc start ./my-bundle --cloudflared off --ngrok off

GTC kann eine Konfigurationsdatei (greentic.toml) verwenden:

greentic.toml
[runtime]
host = "0.0.0.0"
port = 8080
[nats]
enabled = true
url = "nats://localhost:4222"
[logging]
level = "info"
format = "json"
[telemetry]
enabled = true
otlp_endpoint = "http://localhost:4317"
VariableBeschreibungStandard
GREENTIC_LOG_LEVELLog-Ausführlichkeitinfo
GREENTIC_CONFIGPfad zur Konfigurationsdateigreentic.toml
GREENTIC_NATS_URLNATS-Server-URLnats://localhost:4222
GREENTIC_REDIS_URLRedis-URLredis://localhost:6379
CodeBedeutung
0Erfolg
1Allgemeiner Fehler
2Konfigurationsfehler
3Runtime-Fehler
4Validierungsfehler
Terminal-Fenster
# General help
gtc --help
# Command-specific help
gtc wizard --help
gtc setup --help
gtc start --help