Resumen de GTC CLI
Introducción
Sección titulada «Introducción»La GTC CLI (gtc) es la interfaz principal de línea de comandos para la plataforma Greentic. Proporciona comandos para:
- Crear y gestionar bundles
- Configurar providers
- Ejecutar el servidor runtime
- Construir y validar packs/flows
Instalación
Sección titulada «Instalación»cargo install greentic-cligit clone https://github.com/greenticai/greentic.gitcd greentic/greenticcargo build --releaseexport PATH="$PATH:$(pwd)/target/release"Verifica la instalación:
gtc --versionArquitectura de la CLI
Sección titulada «Arquitectura de la CLI»El binario gtc compone subcomandos de múltiples repos:
| Comando | Repositorio fuente | Propósito |
|---|---|---|
gtc wizard | greentic-dev | Asistente de creación de bundles |
gtc setup | greentic-setup | Configuración de providers |
gtc start | greentic-start | Servidor runtime |
gtc pack | greentic-pack | Construcción de packs |
gtc flow | greentic-flow | Validación de flows |
Referencia de comandos
Sección titulada «Referencia de comandos»Opciones globales
Sección titulada «Opciones globales»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 versionComandos
Sección titulada «Comandos»| Comando | Descripción |
|---|---|
wizard | Crear un nuevo bundle a partir de las respuestas del asistente |
setup | Configurar providers en un bundle |
start | Iniciar el servidor runtime |
pack | Gestión de packs (build, verify, publish) |
flow | Gestión de flows (validate, doctor) |
Flujos de trabajo comunes
Sección titulada «Flujos de trabajo comunes»Crear y ejecutar un proyecto nuevo
Sección titulada «Crear y ejecutar un proyecto nuevo»# 1. Create bundle from wizardgtc wizard --answers wizard-answers.yaml
# 2. Setup providers (interactive)gtc setup ./my-bundle
# 3. Start the runtimegtc start ./my-bundleFlujo de trabajo de desarrollo
Sección titulada «Flujo de trabajo de desarrollo»# 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 onDespliegue en producción
Sección titulada «Despliegue en producción»# Setup with answers file (non-interactive)gtc setup --answers production-answers.json ./my-bundle
# Start without tunnelsgtc start ./my-bundle --cloudflared off --ngrok offArchivo de configuración
Sección titulada «Archivo de configuración»GTC puede usar un archivo de configuración (greentic.toml):
[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"Variables de entorno
Sección titulada «Variables de entorno»| Variable | Descripción | Valor por defecto |
|---|---|---|
GREENTIC_LOG_LEVEL | Verbosidad de logs | info |
GREENTIC_CONFIG | Ruta del archivo de configuración | greentic.toml |
GREENTIC_NATS_URL | URL del servidor NATS | nats://localhost:4222 |
GREENTIC_REDIS_URL | URL de Redis | redis://localhost:6379 |
Códigos de salida
Sección titulada «Códigos de salida»| Código | Significado |
|---|---|
0 | Éxito |
1 | Error general |
2 | Error de configuración |
3 | Error de runtime |
4 | Error de validación |
Obtener ayuda
Sección titulada «Obtener ayuda»# General helpgtc --help
# Command-specific helpgtc wizard --helpgtc setup --helpgtc start --helpSiguientes pasos
Sección titulada «Siguientes pasos»- gtc wizard - Creación de bundles
- gtc setup - Configuración de providers
- gtc start - Servidor runtime
- Construcción de Packs - Gestión de packs