gtc start
Overview
Sección titulada «Overview»The gtc start command launches the Greentic runtime server. It starts all necessary services including the HTTP server and flow executor.
gtc start [OPTIONS] <BUNDLE_PATH>Options
Sección titulada «Options»| Option | Description | Default |
|---|---|---|
--bundle <BUNDLE> | Bundle path passed to the runtime | |
--tenant <TENANT> | Tenant identifier | |
--team <TEAM> | Team identifier | |
--locale <LOCALE> | UI locale as a BCP-47 tag | |
--config <CONFIG> | Runtime configuration file | |
--cloudflared <on/off> | Enable Cloudflare tunnel | off |
--ngrok <on/off> | Enable ngrok tunnel | off |
--restart <PART> | Restart part of a running stack (all, cloudflared, ngrok, gateway, egress, subscriptions) | |
--log-dir <DIR> | Log directory | |
--verbose | Enable verbose logging | false |
--quiet | Minimal output | false |
--admin | Enable the mTLS admin API endpoint | false |
--admin-port <PORT> | Admin API port | 8443 |
--admin-certs-dir <DIR> | Directory containing admin TLS certs | |
--admin-allowed-clients <CNS> | Comma-separated allowed admin client CNs |
Basic Usage
Sección titulada «Basic Usage»Demo Flows
Sección titulada «Demo Flows»Extensible demo after wizard and setup:
gtc start ./crates/cloud-deploy-demo/bundleEnd-to-end demo after setup from a published bundle:
gtc start ./cloud-deploy-demo.gtbundleStart with Defaults
Sección titulada «Start with Defaults»gtc start ./my-bundleThis starts:
- The runtime services for the bundle
- Any enabled tunnel you select with flags
- Gateway, egress, and subscription processes as required by the bundle
Start for Development
Sección titulada «Start for Development»# Use ngrok instead of cloudflaredgtc start ./my-bundle --cloudflared off --ngrok on
# With verbose logginggtc start ./my-bundle --verboseStart for Production
Sección titulada «Start for Production»# No tunnelsgtc start ./my-bundle --cloudflared off --ngrok off
# External runtime configuration filegtc start ./my-bundle --config ./runtime.toml --cloudflared offTunnel Configuration
Sección titulada «Tunnel Configuration»Cloudflared (Default)
Sección titulada «Cloudflared (Default)»Cloudflared creates a secure tunnel to Cloudflare’s network:
gtc start ./my-bundle --cloudflared on
# Output:# Cloudflare tunnel started: https://random-words.trycloudflare.com# Webhook URLs will use: https://random-words.trycloudflare.comUse ngrok for a stable URL during development:
gtc start ./my-bundle --ngrok on
# Output:# ngrok tunnel started: https://abc123.ngrok-free.app# Webhook URLs will use: https://abc123.ngrok-free.appNo Tunnel
Sección titulada «No Tunnel»For production with a public domain:
gtc start ./my-bundle --cloudflared off --ngrok off
# Make sure your server is publicly accessible# and update provider webhooks with your domainSetup Flow Behavior
Sección titulada «Setup Flow Behavior»Run gtc setup before gtc start when credentials, webhook URLs, or bundle assets need to be configured. Re-run gtc setup after credential or public URL changes, then restart the runtime:
gtc setup ./my-bundle --answers answers.jsongtc start ./my-bundleRuntime Endpoints
Sección titulada «Runtime Endpoints»When running, the server exposes:
| Endpoint | Purpose |
|---|---|
GET /health | Health check |
GET /ready | Readiness probe |
POST /webhook/{provider}/{tenant}/{team} | Provider webhooks |
GET /api/v1/sessions | Session management |
POST /api/v1/messages | Send messages |
GET /auth/config | OAuth configuration endpoint |
POST /oauth/token-exchange | Server-side OIDC token exchange proxy |
Example Health Check
Sección titulada «Example Health Check»curl http://localhost:8080/health# {"status": "healthy"}OAuth Support
Sección titulada «OAuth Support»The runtime exposes two endpoints for OAuth/OIDC integration with messaging providers that require user authentication (such as WebChat or Teams).
GET /auth/config
Sección titulada «GET /auth/config»Reads the OAuth configuration from the secrets store and returns it to the client. Clients use this endpoint to discover the identity provider settings needed to initiate an authorization flow.
curl http://localhost:8080/auth/config# {# "authority": "https://login.microsoftonline.com/{tenant-id}/v2.0",# "client_id": "your-client-id",# "redirect_uri": "https://your-public-url/auth/callback",# "scope": "openid profile"# }POST /oauth/token-exchange
Sección titulada «POST /oauth/token-exchange»A server-side token exchange proxy for OIDC authorization code exchange. This endpoint allows clients to exchange an authorization code for tokens without running into browser CORS restrictions that occur when calling identity provider token endpoints directly from the frontend.
curl -X POST http://localhost:8080/oauth/token-exchange \ -H "Content-Type: application/json" \ -d '{"code": "authorization_code_here", "redirect_uri": "https://your-public-url/auth/callback"}'Static Routes
Sección titulada «Static Routes»Static routes (such as health checks and OAuth endpoints) can be configured without requiring an explicit public base URL. This means these endpoints are available immediately when the server starts, even before a tunnel or public URL is established.
Logging
Sección titulada «Logging»Log Levels
Sección titulada «Log Levels»# Debug (most verbose)GREENTIC_LOG_LEVEL=debug gtc start ./my-bundle
# Info (default)GREENTIC_LOG_LEVEL=info gtc start ./my-bundle
# WarningGREENTIC_LOG_LEVEL=warn gtc start ./my-bundleVerbose Mode
Sección titulada «Verbose Mode»gtc start ./my-bundle --verbose
# Equivalent to GREENTIC_LOG_LEVEL=debugLog Format
Sección titulada «Log Format»# JSON format (for production)GREENTIC_LOG_FORMAT=json gtc start ./my-bundle
# Pretty format (for development, default)GREENTIC_LOG_FORMAT=pretty gtc start ./my-bundleSignals
Sección titulada «Signals»| Signal | Behavior |
|---|---|
SIGTERM | Graceful shutdown |
SIGINT (Ctrl+C) | Graceful shutdown |
SIGHUP | Reload configuration |
Environment Variables
Sección titulada «Environment Variables»| Variable | Description |
|---|---|
GREENTIC_HOST | Bind address |
GREENTIC_PORT | HTTP port |
GREENTIC_LOG_LEVEL | Log verbosity |
GREENTIC_LOG_FORMAT | Log format (json/pretty) |
GREENTIC_REDIS_URL | Redis URL for sessions |
Troubleshooting
Sección titulada «Troubleshooting»Port Already in Use
Sección titulada «Port Already in Use»Error: Address already in use (os error 48)Another process is using the configured runtime port. Stop the process or point gtc start at a different runtime configuration:
gtc start ./my-bundle --config ./runtime.tomlTunnel Failed to Start
Sección titulada «Tunnel Failed to Start»Error: Failed to start cloudflared tunnelInstall cloudflared or use ngrok instead:
# Install cloudflaredbrew install cloudflared
# Or use ngrokgtc start ./my-bundle --cloudflared off --ngrok onProvider Setup Failed
Sección titulada «Provider Setup Failed»Error: Setup flow failed for messaging-telegramCheck your credentials in the answers file and ensure the public URL is accessible:
gtc setup ./my-bundle --answers answers.json --non-interactive --no-uigtc start ./my-bundle --verboseDocker Deployment
Sección titulada «Docker Deployment»FROM rust:1.95 as builderWORKDIR /appCOPY . .RUN cargo build --release
FROM debian:bookworm-slimCOPY --from=builder /app/target/release/gtc /usr/local/bin/COPY my-bundle /app/bundleWORKDIR /appEXPOSE 8080CMD ["gtc", "start", "/app/bundle", "--cloudflared", "off"]docker build -t my-worker .docker run -p 8080:8080 my-workerNext Steps
Sección titulada «Next Steps»- Building Packs - Create and manage packs
- Configuration Reference - Full config options
- gtc setup - Configure extensions and credentials