Skip to main content

TGO Commands

tgo.sh is the main management script for TGO, providing all common commands for deployment, operations, and configuration.

Command Overview

./tgo.sh <command> [options]

Basic Commands

help

Display help information:

./tgo.sh help

install

First-time installation and start all services:

./tgo.sh install [--source] [--cn]
OptionDescription
--sourceBuild from source (instead of pre-built images)
--cnUse China mirrors for acceleration

Examples:

# Default install (using pre-built images)
./tgo.sh install

# Source install
./tgo.sh install --source

# Install with China mirrors
./tgo.sh install --cn

# Combined options
./tgo.sh install --source --cn

up

Start all services (without initialization):

./tgo.sh up [--source] [--cn]

Use after down to restart services.

down

Stop and remove all containers:

./tgo.sh down [--volumes]
OptionDescription
--volumesAlso remove data volumes (data will be lost)

upgrade

Upgrade to latest version:

./tgo.sh upgrade [--source] [--cn]

Automatically remembers the mode used during initial installation.

doctor

Check health status of all services:

./tgo.sh doctor

Output includes:

  • Service running status
  • Configuration checks
  • Endpoint response tests

Service Management Commands

service

Manage core services:

./tgo.sh service <start|stop|remove> [--source] [--cn]
SubcommandDescription
startStart services
stopStop services
removeRemove services

tools

Manage debug tools (Kafka UI, Adminer):

./tgo.sh tools <start|stop>
SubcommandDescription
startStart debug tools
stopStop debug tools

build

Build specific service from source:

./tgo.sh build <service>
ServiceDescription
apiBuild tgo-api
aiBuild tgo-ai
ragBuild tgo-rag
platformBuild tgo-platform
webBuild tgo-web
widgetBuild tgo-widget
allBuild all services

Configuration Commands

config

Domain and SSL certificate configuration:

./tgo.sh config <subcommand> [args]

Domain Configuration

./tgo.sh config web_domain <domain>      # Set Web domain
./tgo.sh config widget_domain <domain> # Set Widget domain
./tgo.sh config api_domain <domain> # Set API domain
./tgo.sh config ws_domain <domain> # Set WebSocket domain

SSL Configuration

./tgo.sh config ssl_mode <auto|manual|none>   # Set SSL mode
./tgo.sh config ssl_email <email> # Set Let's Encrypt email
./tgo.sh config ssl_manual <cert> <key> [domain] # Install manual certificate
./tgo.sh config setup_letsencrypt # Request Let's Encrypt certificates

Other Config Commands

./tgo.sh config apply   # Apply config (regenerate Nginx config)
./tgo.sh config show # Show current configuration

Environment Variables

The one-click installation script supports these environment variables:

VariableDescriptionDefault
REFDeploy version (branch/tag/commit)latest
DIRInstallation directory./tgo

Example:

REF=v1.0.0 DIR=/opt/tgo curl -fsSL https://raw.githubusercontent.com/tgoai/tgo/main/bootstrap.sh | bash

Configuration Files

FileDescription
.envGlobal environment variables
envs/*.envService environment variables
data/.tgo-install-modeInstall mode memory
data/.tgo-domain-configDomain and SSL config

Data Directories

DirectoryDescription
data/postgres/PostgreSQL data
data/redis/Redis data
data/wukongim/WuKongIM data
data/nginx/Nginx config and certificates
data/uploads/Uploaded files

Usage Recommendations

  1. Production: Use ./tgo.sh install with default image deployment
  2. Development: Use ./tgo.sh install --source for source deployment
  3. China servers: Add --cn for acceleration
  4. Troubleshooting: Run ./tgo.sh doctor first to check status