GTC CLI Overview
Introduction
Section titled “Introduction”The GTC CLI (gtc) is the primary command-line interface for the Greentic platform. It provides commands for:
- Creating and managing bundles
- Setting up providers
- Running the runtime server
- Building and validating packs/flows
Installation
Section titled “Installation”cargo install greentic-cligit clone https://github.com/greenticai/greentic.gitcd greentic/greenticcargo build --releaseexport PATH="$PATH:$(pwd)/target/release"Verify installation:
gtc --versionCLI Architecture
Section titled “CLI Architecture”The gtc binary composes subcommands from multiple repos:
| Command | Source Repo | Purpose |
|---|---|---|
gtc wizard | greentic-dev | Bundle creation wizard |
gtc setup | greentic-setup | Provider setup/configuration |
gtc start | greentic-start | Runtime server |
gtc pack | greentic-pack | Pack building |
gtc flow | greentic-flow | Flow validation |
Command Reference
Section titled “Command Reference”Global Options
Section titled “Global Options”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 versionCommands
Section titled “Commands”| Command | Description |
|---|---|
wizard | Create a new bundle from wizard answers |
setup | Configure providers in a bundle |
start | Start the runtime server |
pack | Pack management (build, verify, publish) |
flow | Flow management (validate, doctor) |
Common Workflows
Section titled “Common Workflows”Create and Run a New Project
Section titled “Create and Run a New Project”# 1. Create bundle from wizardgtc wizard --answers wizard-answers.yaml
# 2. Setup providers (interactive)gtc setup ./my-bundle
# 3. Start the runtimegtc start ./my-bundleDevelopment Workflow
Section titled “Development 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 onProduction Deployment
Section titled “Production Deployment”# Setup with answers file (non-interactive)gtc setup --answers production-answers.json ./my-bundle
# Start without tunnelsgtc start ./my-bundle --cloudflared off --ngrok offConfiguration File
Section titled “Configuration File”GTC can use a configuration file (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"Environment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
GREENTIC_LOG_LEVEL | Log verbosity | info |
GREENTIC_CONFIG | Config file path | greentic.toml |
GREENTIC_NATS_URL | NATS server URL | nats://localhost:4222 |
GREENTIC_REDIS_URL | Redis URL | redis://localhost:6379 |
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Configuration error |
3 | Runtime error |
4 | Validation error |
Getting Help
Section titled “Getting Help”# General helpgtc --help
# Command-specific helpgtc wizard --helpgtc setup --helpgtc start --helpNext Steps
Section titled “Next Steps”- gtc wizard - Bundle creation
- gtc setup - Provider setup
- gtc start - Runtime server
- Building Packs - Pack management