Lewati ke konten

Ikhtisar GTC CLI

GTC CLI (gtc) adalah antarmuka baris perintah utama untuk platform Greentic. CLI ini menyediakan perintah untuk:

  • Membuat dan mengelola bundle
  • Menyiapkan provider
  • Menjalankan server runtime
  • Membangun dan memvalidasi pack/flow
Terminal window
cargo install greentic-cli

Verifikasi instalasi:

Terminal window
gtc --version

Binary gtc menyusun subcommand dari beberapa repo:

PerintahRepo SumberTujuan
gtc wizardgreentic-devWizard pembuatan bundle
gtc setupgreentic-setupSetup/konfigurasi provider
gtc startgreentic-startServer runtime
gtc packgreentic-packPembangunan pack
gtc flowgreentic-flowValidasi flow
Terminal window
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 version
PerintahDeskripsi
wizardMembuat bundle baru dari jawaban wizard
setupMengonfigurasi provider di dalam bundle
startMenjalankan server runtime
packManajemen pack (build, verify, publish)
flowManajemen flow (validate, doctor)
Terminal window
# 1. Create bundle from wizard
gtc wizard --answers wizard-answers.yaml
# 2. Setup providers (interactive)
gtc setup ./my-bundle
# 3. Start the runtime
gtc start ./my-bundle
Terminal window
# Validate flows
gtc flow doctor ./my-bundle/apps/my-app/flows/
# Build a pack
gtc pack build ./my-pack/
# Start with verbose logging
gtc start ./my-bundle --verbose
# Start with ngrok tunnel
gtc start ./my-bundle --ngrok on
Terminal window
# Setup with answers file (non-interactive)
gtc setup --answers production-answers.json ./my-bundle
# Start without tunnels
gtc start ./my-bundle --cloudflared off --ngrok off

GTC dapat menggunakan file konfigurasi (greentic.toml):

greentic.toml
[runtime]
host = "0.0.0.0"
port = 8080
[nats]
enabled = true
url = "nats://localhost:4222"
[logging]
level = "info"
format = "json"
[telemetry]
enabled = true
otlp_endpoint = "http://localhost:4317"
VariabelDeskripsiDefault
GREENTIC_LOG_LEVELVerbositas loginfo
GREENTIC_CONFIGPath file konfigurasigreentic.toml
GREENTIC_NATS_URLURL server NATSnats://localhost:4222
GREENTIC_REDIS_URLURL Redisredis://localhost:6379
KodeArti
0Berhasil
1Kesalahan umum
2Kesalahan konfigurasi
3Kesalahan runtime
4Kesalahan validasi
Terminal window
# General help
gtc --help
# Command-specific help
gtc wizard --help
gtc setup --help
gtc start --help