gtc setup
Overview
Section titled “Overview”The gtc setup command configures providers in your Greentic bundle. It runs setup flows for each enabled provider, collecting credentials and configuring webhooks.
gtc setup [OPTIONS] <BUNDLE_PATH>Options
Section titled “Options”| Option | Description |
|---|---|
--answers <FILE> | Path to answers file (non-interactive) |
--dry-run | Preview setup without making changes |
--emit-answers <FILE> | Generate answers template |
--advanced | Include optional fields in answers template |
--provider <NAME> | Setup only specific provider |
--skip <NAME> | Skip specific provider |
-v, --verbose | Enable verbose output |
Interactive Setup
Section titled “Interactive Setup”Run setup interactively to be prompted for each provider:
gtc setup ./my-bundleThe CLI will prompt for:
- Provider credentials (API keys, tokens)
- Public URL for webhooks
- Optional configuration options
Non-Interactive Setup
Section titled “Non-Interactive Setup”Generate Answers Template
Section titled “Generate Answers Template”First, generate a template with all required fields:
# Basic template (required fields only)gtc setup --dry-run --emit-answers answers.json ./my-bundle
# Full template (including optional fields)gtc setup --dry-run --emit-answers answers.json --advanced ./my-bundleAnswers File Format
Section titled “Answers File Format”{ "messaging-telegram": { "enabled": true, "public_base_url": "https://xxx.ngrok-free.app", "bot_token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz" }, "messaging-slack": { "enabled": true, "public_base_url": "https://xxx.ngrok-free.app", "api_base_url": "https://slack.com/api", "bot_token": "xoxb-xxx-xxx-xxx", "slack_app_id": "A07XXXXXX", "slack_configuration_token": "xoxe.xoxp-xxx" }, "messaging-teams": { "enabled": false }}messaging-telegram: enabled: true public_base_url: https://xxx.ngrok-free.app bot_token: "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
messaging-slack: enabled: true public_base_url: https://xxx.ngrok-free.app api_base_url: https://slack.com/api bot_token: xoxb-xxx-xxx-xxx slack_app_id: A07XXXXXX slack_configuration_token: xoxe.xoxp-xxx
messaging-teams: enabled: falseApply Answers
Section titled “Apply Answers”gtc setup --answers answers.json ./my-bundleProvider-Specific Configuration
Section titled “Provider-Specific Configuration”Telegram
Section titled “Telegram”{ "messaging-telegram": { "enabled": true, "public_base_url": "https://your-domain.com", "bot_token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz" }}How to get credentials:
- Message @BotFather on Telegram
- Send
/newbotand follow prompts - Copy the bot token
{ "messaging-slack": { "enabled": true, "public_base_url": "https://your-domain.com", "bot_token": "xoxb-xxx-xxx-xxx", "slack_app_id": "A07XXXXXX", "slack_configuration_token": "xoxe.xoxp-xxx" }}How to get credentials:
- Go to api.slack.com/apps
- Create a new app or select existing
- Get Bot Token from OAuth & Permissions
- Get App ID from Basic Information
- Get Configuration Token from App Manifest
Microsoft Teams
Section titled “Microsoft Teams”{ "messaging-teams": { "enabled": true, "public_base_url": "https://your-domain.com", "app_id": "your-app-id", "app_password": "your-app-password", "tenant_id": "your-tenant-id" }}WhatsApp (via Meta)
Section titled “WhatsApp (via Meta)”{ "messaging-whatsapp": { "enabled": true, "public_base_url": "https://your-domain.com", "phone_number_id": "123456789", "access_token": "EAAxxxxx", "verify_token": "your-verify-token" }}Public URL Configuration
Section titled “Public URL Configuration”Using ngrok
Section titled “Using ngrok”# Start ngrok in separate terminalngrok http 8080
# Copy the HTTPS URL (e.g., https://abc123.ngrok-free.app)# Use this as public_base_url in answersUsing Cloudflared
Section titled “Using Cloudflared”# Cloudflared generates URL automatically with gtc startgtc start ./my-bundle --cloudflared onSetup Flow Execution
Section titled “Setup Flow Execution”When you run gtc setup, it:
-
Loads bundle configuration
Reads
greentic.demo.yamlto find providers. -
Validates answers
Checks all required fields are present.
-
Runs setup flows
Executes each provider’s
setup_flow(e.g., webhook registration). -
Stores credentials
Saves credentials to the configured secrets store.
-
Runs verification
Executes
verify_flowto confirm setup worked.
Selective Setup
Section titled “Selective Setup”Setup Single Provider
Section titled “Setup Single Provider”gtc setup --provider messaging-telegram ./my-bundleSkip Specific Provider
Section titled “Skip Specific Provider”gtc setup --skip messaging-teams ./my-bundleRe-run Setup
Section titled “Re-run Setup”# Force re-setup (useful after URL changes)gtc start ./my-bundle --force-setupTroubleshooting
Section titled “Troubleshooting”Webhook Registration Failed
Section titled “Webhook Registration Failed”Error: Failed to register webhook: 401 UnauthorizedCheck that your bot token is correct and not expired.
Missing Required Field
Section titled “Missing Required Field”Error: Missing required field 'bot_token' for messaging-telegramEnsure all required fields are in your answers file.
Public URL Not Accessible
Section titled “Public URL Not Accessible”Error: Webhook verification failed: Connection refusedEnsure your public URL is accessible from the internet. Check ngrok/cloudflared is running.
Credential Not Found
Section titled “Credential Not Found”Error: Secret 'slack_bot_token' not foundRun gtc setup to configure the provider, or check your answers file.
Best Practices
Section titled “Best Practices”- Use answers files in CI/CD - Avoid interactive prompts in automated pipelines
- Keep credentials secure - Don’t commit answers files with real tokens to git
- Use environment variables - Reference secrets via
$ENV_VARin answers - Test with dry-run - Preview setup before making changes
- Regenerate on URL change - Re-run setup when your public URL changes
Next Steps
Section titled “Next Steps”- gtc start - Run the runtime server
- Telegram Setup - Detailed Telegram guide
- Slack Setup - Detailed Slack guide