CLI Reference

Overview

GQLForge provides four primary commands for working with GraphQL configurations.

gqlforge <command> [options]

Commands

start

Starts the GraphQL server using the provided configuration files.

gqlforge start <file_paths...> [options]

Arguments:

ArgumentRequiredDescription
file_pathsYesOne or more paths to GraphQL configuration files

Options:

FlagDescription
--verify-sslEnable strict SSL certificate verification for upstream connections

Examples:

# Start with a single config file
gqlforge start ./app.graphql

# Start with multiple config files
gqlforge start ./schema.graphql ./extensions.graphql

# Start with SSL verification enabled
gqlforge start ./app.graphql --verify-ssl

check

Validates the configuration without starting the server. Reports schema errors, type mismatches, and optionally detects N+1 query patterns.

gqlforge check <file_paths...> [options]

Arguments:

ArgumentRequiredDescription
file_pathsYesOne or more paths to GraphQL configuration files

Options:

FlagDescription
--n-plus-one-queriesDetect and report potential N+1 query patterns
--schemaOutput the composed schema to stdout
--verify-sslEnable strict SSL certificate verification

Examples:

# Basic validation
gqlforge check ./app.graphql

# Check for N+1 issues
gqlforge check ./app.graphql --n-plus-one-queries

# Output the composed schema
gqlforge check ./app.graphql --schema

init

Creates a new GQLForge project with a starter configuration file.

gqlforge init [folder_path]

Arguments:

ArgumentRequiredDefaultDescription
folder_pathNo.Directory where the project will be created

Examples:

# Initialize in the current directory
gqlforge init

# Initialize in a new directory
gqlforge init ./my-api

gen

Generates GQLForge configuration from existing API definitions such as REST API specs, Protocol Buffer files, GraphQL schemas, or PostgreSQL databases.

gqlforge gen <file_path>

Arguments:

ArgumentRequiredDescription
file_pathYesPath to a source definition file or a PostgreSQL connection URL

Examples:

# Generate from a protobuf file
gqlforge gen ./service.proto

# Generate from an OpenAPI spec
gqlforge gen ./openapi.json

# Generate from a PostgreSQL database
gqlforge gen postgres://user:password@localhost:5432/mydb

See Config Generation for more details on supported source formats.