cli

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

README

Gateway CLI

This document provides information about the available CLI commands and their parameters for the Gateway application.

Available Commands

start

Starts the Gateway with the specified configuration.

Usage:

gateway start [flags]

Flags:

  • --config - Path to YAML file with gateway configuration (default: "./gateway.yaml")
  • --addr - Address for gateway server (default: ":9090")
  • --servers - Comma-separated list of additional server URLs for Swagger UI (e.g., "https://dev1.example.com,https://dev2.example.com")
start rest

Starts the REST Gateway service.

Usage:

gateway start rest [flags]

Flags:

  • --disable-swagger - Disable Swagger UI (default: false)
start mcp

Starts the MCP (Message-Coupling Protocol) Gateway service.

Usage:

gateway start mcp
start mcp-stdio

Starts the MCP Gateway service using stdin/stdout for communication.

Usage:

gateway start mcp-stdio [flags]

Flags:

  • --log-file - Path to log file (default: "mcp.log")
discover

Discovers and generates a gateway configuration based on database schema.

Usage:

gateway discover [flags]

Flags:

  • --database-type - Type of database to connect to
  • --tables - Specific tables to include in the discovery, you can specify comma-separated list eg "sales,orders,customers"
  • --ai-api-key - API key for AI service, for instance OpenAI key
  • --ai-endpoint - Endpoint for AI service, compatible with OpenAI api schema
  • --ai-model - Model name for AI service, eg o3-mini
  • --output - Output file path for generated configuration
  • --extra-prompt - Additional instructions for the AI model
connectors

Lists all available database connectors.

Usage:

gateway connectors [connector_name]

If a connector name is provided, displays detailed documentation for that connector.

plugins

Lists all available plugins.

Usage:

gateway plugins [plugin_name]

If a plugin name is provided, displays detailed documentation for that plugin.

verify

Verifies database connection configuration and displays table schemas and sample data.

Usage:

gateway verify [flags]

Flags:

  • --config - Path to connection YAML file (default: "connection.yaml")
  • --tables - Comma-separated list of tables to include (e.g. 'table1,table2,table3')
  • --llm-log - Path to save the raw LLM response (default: logs directory)

Configuration File

The gateway.yaml configuration file defines:

  • API endpoints
  • Database connections
  • Security settings
  • Plugin configurations

Example configuration:

# Example gateway.yaml
api:
  # API configuration
database:
  # Database connection settings
plugins:
  # Plugin configurations

For detailed configuration options, please refer to the main documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connection added in v0.0.5

func Connection() *cobra.Command

func Connectors

func Connectors() *cobra.Command

func Discover

func Discover() *cobra.Command

func MCP

func MCP(configPath *string, addr *string) *cobra.Command

func MCPStdio

func MCPStdio(configPath *string) *cobra.Command

func Plugins

func Plugins() *cobra.Command

func REST

func REST(configPath *string, addr *string, servers *string) *cobra.Command

func RegisterCommand

func RegisterCommand(parent, child *cobra.Command)

RegisterCommand is like parent.AddCommand(child), but also makes chaining of PersistentPreRunE and PersistentPreRun

func StartCommand

func StartCommand() *cobra.Command

Types

type DiscoverQueryParams added in v0.0.5

type DiscoverQueryParams struct {
	LLMLogFile    string
	Provider      string
	Endpoint      string
	APIKey        string
	Model         string
	MaxTokens     int
	Temperature   float32
	Reasoning     bool
	BedrockRegion string
	VertexRegion  string
	VertexProject string
}

type DiscoverQueryResponse added in v0.0.5

type DiscoverQueryResponse struct {
	Config       *gw_model.Config
	Conversation *providers.ConversationResponse
	RawContent   string
	CostEstimate float64
}

type PromptColumnSchema

type PromptColumnSchema struct {
	Name       string `yaml:"name"`
	Type       string `yaml:"type"`
	PrimaryKey bool   `yaml:"primary_key,omitempty"`
}

PromptColumnSchema is used specifically for generating prompts, omitting sensitive fields like PII flag

type TableData

type TableData struct {
	Columns  []gw_model.ColumnSchema
	Name     string
	Sample   []map[string]any
	RowCount int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL