GTC CLI 概要
GTC CLI (gtc) は Greentic platform の主要なコマンドラインインターフェースです。次のためのコマンドを提供します:
- bundles の作成と管理
- providers のセットアップ
- runtime server の実行
- packs/flows のビルドと検証
インストール
Section titled “インストール”cargo install greentic-cligit clone https://github.com/greenticai/greentic.gitcd greentic/greenticcargo build --releaseexport PATH="$PATH:$(pwd)/target/release"インストールを確認します:
gtc --versionCLI アーキテクチャ
Section titled “CLI アーキテクチャ”gtc バイナリは複数の repo から subcommands を構成します:
| Command | Source Repo | 用途 |
|---|---|---|
gtc wizard | greentic-dev | Bundle 作成ウィザード |
gtc setup | greentic-setup | Provider のセットアップ/設定 |
gtc start | greentic-start | Runtime server |
gtc pack | greentic-pack | Pack のビルド |
gtc flow | greentic-flow | Flow の検証 |
コマンドリファレンス
Section titled “コマンドリファレンス”グローバルオプション
Section titled “グローバルオプション”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 を作成する |
setup | bundle 内の providers を設定する |
start | runtime server を起動する |
pack | Pack 管理(build、verify、publish) |
flow | Flow 管理(validate、doctor) |
よくあるワークフロー
Section titled “よくあるワークフロー”新しいプロジェクトを作成して実行する
Section titled “新しいプロジェクトを作成して実行する”# 1. Create bundle from wizardgtc wizard --answers wizard-answers.yaml
# 2. Setup providers (interactive)gtc setup ./my-bundle
# 3. Start the runtimegtc start ./my-bundle開発ワークフロー
Section titled “開発ワークフロー”# Validate flowsgtc flow doctor ./my-bundle/apps/my-app/flows/
# Build a packgtc pack build ./my-pack/
# Start with verbose logginggtc start ./my-bundle --verbose
# Start with ngrok tunnelgtc start ./my-bundle --ngrok on本番デプロイ
Section titled “本番デプロイ”# Setup with answers file (non-interactive)gtc setup --answers production-answers.json ./my-bundle
# Start without tunnelsgtc start ./my-bundle --cloudflared off --ngrok off設定ファイル
Section titled “設定ファイル”GTC は設定ファイル(greentic.toml)を使用できます:
[runtime]host = "0.0.0.0"port = 8080
[nats]enabled = trueurl = "nats://localhost:4222"
[logging]level = "info"format = "json"
[telemetry]enabled = trueotlp_endpoint = "http://localhost:4317"| Variable | 説明 | Default |
|---|---|---|
GREENTIC_LOG_LEVEL | ログの詳細度 | info |
GREENTIC_CONFIG | 設定ファイルのパス | greentic.toml |
GREENTIC_NATS_URL | NATS server URL | nats://localhost:4222 |
GREENTIC_REDIS_URL | Redis URL | redis://localhost:6379 |
| Code | 意味 |
|---|---|
0 | 成功 |
1 | 一般的なエラー |
2 | 設定エラー |
3 | runtime エラー |
4 | 検証エラー |
ヘルプの取得
Section titled “ヘルプの取得”# General helpgtc --help
# Command-specific helpgtc wizard --helpgtc setup --helpgtc start --help次のステップ
Section titled “次のステップ”- gtc wizard - Bundle 作成
- gtc setup - Provider のセットアップ
- gtc start - Runtime server
- Building Packs - Pack 管理