跳转到内容

CLI Overview

此内容尚不支持你的语言。

MiniGateway provides a command-line interface for server management and administration.

Terminal window
# From npm
npm install -g @minigateway/cli
minigateway [command]
# Or use npx
npx @minigateway/cli [command]
CommandDescription
startStart the unified server
initInitialize configuration file
statusCheck server status
adminEntity management commands
llm-routerLLM-specific commands
OptionDescription
-h, --helpShow help
-V, --versionShow version

Initialize a new configuration file:

Terminal window
minigateway init [path] [options]
ArgumentDefaultDescription
[path]Platform-specific config directoryConfig file path
OptionDescription
-f, --forceOverwrite existing config file
Terminal window
# Create default config
minigateway init
# Create config in current directory
minigateway init ./minigateway.yaml
# Force overwrite
minigateway init --force

Start the MiniGateway server:

Terminal window
minigateway start [options]
OptionDefaultDescription
-p, --port <port>8080Server port
--db <path>Platform-specific (see Configuration)Database path
--ui-dist <path>autoWeb UI dist directory
--log-level <level>infoLog verbosity
--no-uifalseDisable Web UI
Terminal window
# Start with default settings
minigateway start
# Start on custom port
minigateway start --port 3000
# Start without Web UI
minigateway start --no-ui
# Start with custom database
minigateway start --db /data/minigateway.db

Manage entities via CLI:

Terminal window
minigateway admin <entity> <action> [options]
EntityActions
serviceslist, create, update, delete
routeslist, create, update, delete
upstreamslist, create, update, delete
targetslist, create, update, delete
consumerslist, create, update, delete
credentialslist, create, update, delete
pluginslist, create, update, delete
llm-modelslist, create, update, delete
llm-providerslist, create, update, delete
Terminal window
# List services
minigateway admin services list
# Create service
minigateway admin services create --name "my-api"
# Create route
minigateway admin routes create \
--service-id "service_abc" \
--path "/api/v1/*" \
--methods "GET,POST"
VariableDescription
MINIGATEWAY_LOG_LEVELDefault log level
MINIGATEWAY_UI_DISTWeb UI dist path
MINIGATEWAY_DB_PATHDatabase file path