コンテンツにスキップ

GTC CLI 概要

GTC CLI (gtc) は Greentic platform の主要なコマンドラインインターフェースです。次のためのコマンドを提供します:

  • bundles の作成と管理
  • providers のセットアップ
  • runtime server の実行
  • packs/flows のビルドと検証
Terminal window
cargo install greentic-cli

インストールを確認します:

Terminal window
gtc --version

gtc バイナリは複数の repo から subcommands を構成します:

CommandSource Repo用途
gtc wizardgreentic-devBundle 作成ウィザード
gtc setupgreentic-setupProvider のセットアップ/設定
gtc startgreentic-startRuntime server
gtc packgreentic-packPack のビルド
gtc flowgreentic-flowFlow の検証
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
Command説明
wizardウィザードの回答から新しい bundle を作成する
setupbundle 内の providers を設定する
startruntime server を起動する
packPack 管理(build、verify、publish)
flowFlow 管理(validate、doctor)

新しいプロジェクトを作成して実行する

Section titled “新しいプロジェクトを作成して実行する”
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 は設定ファイル(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"
Variable説明Default
GREENTIC_LOG_LEVELログの詳細度info
GREENTIC_CONFIG設定ファイルのパスgreentic.toml
GREENTIC_NATS_URLNATS server URLnats://localhost:4222
GREENTIC_REDIS_URLRedis URLredis://localhost:6379
Code意味
0成功
1一般的なエラー
2設定エラー
3runtime エラー
4検証エラー
Terminal window
# General help
gtc --help
# Command-specific help
gtc wizard --help
gtc setup --help
gtc start --help