GTC CLI Überblick
Einführung
Abschnitt betitelt „Einführung“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
Installation
Abschnitt betitelt „Installation“cargo install greentic-cligit clone https://github.com/greenticai/greentic.gitcd greentic/greenticcargo build --releaseexport PATH="$PATH:$(pwd)/target/release"Installation überprüfen:
gtc --versionCLI-Architektur
Abschnitt betitelt „CLI-Architektur“Die gtc-Binärdatei setzt Unterbefehle aus mehreren Repositories zusammen:
| Befehl | Source Repo | Zweck |
|---|---|---|
gtc wizard | greentic-dev | Assistent zur Bundle-Erstellung |
gtc setup | greentic-setup | Provider-Einrichtung/-Konfiguration |
gtc start | greentic-start | Runtime-Server |
gtc pack | greentic-pack | Pack-Build |
gtc flow | greentic-flow | Flow-Validierung |
Befehlsreferenz
Abschnitt betitelt „Befehlsreferenz“Globale Optionen
Abschnitt betitelt „Globale Optionen“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 versionBefehle
Abschnitt betitelt „Befehle“| Befehl | Beschreibung |
|---|---|
wizard | Ein neues Bundle aus Assistentenantworten erstellen |
setup | Provider in einem Bundle konfigurieren |
start | Den Runtime-Server starten |
pack | Pack-Verwaltung (build, verify, publish) |
flow | Flow-Verwaltung (validate, doctor) |
Häufige Workflows
Abschnitt betitelt „Häufige Workflows“Ein neues Projekt erstellen und ausführen
Abschnitt betitelt „Ein neues Projekt erstellen und ausführen“# 1. Create bundle from wizardgtc wizard --answers wizard-answers.yaml
# 2. Setup providers (interactive)gtc setup ./my-bundle
# 3. Start the runtimegtc start ./my-bundleEntwicklungs-Workflow
Abschnitt betitelt „Entwicklungs-Workflow“# Validate flowsgtc flow doctor ./my-bundle/apps/my-app/flows/
# Build a packgtc pack build ./my-pack/
# Start with verbose logginggtc start ./my-bundle --verbose
# Start with ngrok tunnelgtc start ./my-bundle --ngrok onProduktions-Deployment
Abschnitt betitelt „Produktions-Deployment“# Setup with answers file (non-interactive)gtc setup --answers production-answers.json ./my-bundle
# Start without tunnelsgtc start ./my-bundle --cloudflared off --ngrok offKonfigurationsdatei
Abschnitt betitelt „Konfigurationsdatei“GTC kann eine Konfigurationsdatei (greentic.toml) verwenden:
[runtime]host = "0.0.0.0"port = 8080
[nats]enabled = trueurl = "nats://localhost:4222"
[logging]level = "info"format = "json"
[telemetry]enabled = trueotlp_endpoint = "http://localhost:4317"Umgebungsvariablen
Abschnitt betitelt „Umgebungsvariablen“| Variable | Beschreibung | Standard |
|---|---|---|
GREENTIC_LOG_LEVEL | Log-Ausführlichkeit | info |
GREENTIC_CONFIG | Pfad zur Konfigurationsdatei | greentic.toml |
GREENTIC_NATS_URL | NATS-Server-URL | nats://localhost:4222 |
GREENTIC_REDIS_URL | Redis-URL | redis://localhost:6379 |
Exit-Codes
Abschnitt betitelt „Exit-Codes“| Code | Bedeutung |
|---|---|
0 | Erfolg |
1 | Allgemeiner Fehler |
2 | Konfigurationsfehler |
3 | Runtime-Fehler |
4 | Validierungsfehler |
Hilfe erhalten
Abschnitt betitelt „Hilfe erhalten“# General helpgtc --help
# Command-specific helpgtc wizard --helpgtc setup --helpgtc start --helpNächste Schritte
Abschnitt betitelt „Nächste Schritte“- gtc wizard - Bundle-Erstellung
- gtc setup - Provider-Einrichtung
- gtc start - Runtime-Server
- Packs erstellen - Pack-Verwaltung