cli

package
v0.1.0 Latest Latest
Warning

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

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

README


title: '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 [flags]

Flags:

  • --raw - Enable raw protocol mode for direct SQL query access (default: false)
  • --servers - Comma-separated list of server addresses

This mode is particularly useful for:

  • Testing and debugging MCP communication
  • Integration with systems that have well known queries to execute
  • Script-based automation and pipeline processing
  • When using --raw flag: direct database access and advanced data querying

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")
  • --raw - Enable raw protocol mode for direct SQL query access (default: false)

This mode is particularly useful for:

  • Testing and debugging MCP communication
  • Integration with systems that require direct stdin/stdout communication and local launching applications
  • Script-based automation and pipeline processing
  • When using --raw flag: direct database access and advanced data querying

discover

Discovers and generates a gateway configuration based on database schema.

Usage:

gateway discover [flags]

Flags:

  • --config - Path to connection yaml file. Default is "connection.yaml".
  • --tables - Comma-separated list of tables to include (e.g. 'table1,table2,table3')
  • --ai-provider - AI provider to use. Default is "openai".
  • --ai-endpoint - Custom OpenAI-compatible API endpoint URL
  • --ai-api-key - AI API token
  • --bedrock-region - Bedrock region
  • --vertexai-region - Vertex AI region
  • --vertexai-project - Vertex AI project
  • --ai-model - AI model to use
  • --ai-max-tokens - Maximum tokens to use. Default is 0.
  • --ai-temperature - AI temperature. Default is -1.0.
  • --ai-reasoning - Enable reasoning. Default is true.
  • --output - Resulted YAML path. Default is "gateway.yaml".
  • --prompt - Custom input to generate APIs. Default is "generate reasonable set of APIs for this data".
  • --prompt-file - Path to save the generated prompt.
  • --llm-log - Path to save the raw LLM response.

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 Plugins

func Plugins() *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

func Stdio added in v0.1.0

func Stdio(configPath *string) *cobra.Command

func TablesData added in v0.0.9

func TablesData(tablesList []string, configRaw any) ([]prompter.TableData, connectors.Connector, error)

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
}

Jump to

Keyboard shortcuts

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