CLI reference

When to use this

You need the authoritative list of Gateway CLI options. This page is the single source of truth; the graftcode-gateway README in the repository links here.

Run gg --help for the version installed on your machine.

Prerequisites


Positional argument

You may pass the main module path as the first argument instead of --modules:

./gg ./MyApp.dll --port 8888

Options

OptionTypeDefaultDescription
--projectKeystring(empty)JWT from Portal for cloud auth and project binding. Overridden by GC_PROJECT_KEY.
--moduleslist(empty)Comma-separated modules (DLLs, JARs, paths). If empty, GG scans current directory.
--runtimeenumautoauto, clr, netcore, java, jvm, python, python27, ruby, nodejs, php, perl
--endpointURLhttps://grft.devCloud endpoint. Overridden by GSMU_ENDPOINT.
--portnumber80WebSocket server port (Graft remote calls, MCP)
--httpPortnumber81HTTP server (Vision, REST-style MCP routes)
--tcpPortnumber82TCP server port when --tcpServer is enabled
--http2Portnumber83HTTP/2 server port when --http2Server is enabled
--GVflagonHost Graftcode Vision
--GMAflagoffEnable Graftcode Module Analyzer
--GSMUflagoffUpload Unified Graft Model to GSMU
--tcpServerflagoffEnable TCP server for Hypertube
--http2ServerflagoffEnable HTTP/2 server
--typeslist(empty)Comma-separated fully qualified type names to expose
--runAppflagoffRun the application entry point
--mcpBaseClassstring(empty)FQN of MCP base class for bare tools/call resolution
--corsAllowedOriginslist(empty)CORS allowlist (e.g. http://localhost:3000 or *)
--corsConfigpath(empty)Path to CORS config file
--useContextflagoffEnable Graftcode Context (headers → hosted code)
--noVersioningflagoffUse hash-based identity instead of module version
--doNotExtractBinariesflagoffSkip extracting bundled binaries
--configpath(empty)Hypertube configuration file path

Environment variables: Environment variables.


Runtime notes

RuntimeRequirement
netcore.NET Core 3.1+ / .NET 5+
clr.NET Framework 4.7.2+
java / jvmJava 8+; JAVA_HOME set
pythonPython 3.6+
nodejsNode.js 22+
rubyRuby 3+
phpPHP 7.4+

Examples

# Custom ports (avoid privileged port 80)
./gg ./MyLib.dll --port 8888 --httpPort 8889

# TCP + HTTP/2 for backend integrations
./gg ./MyLib.dll --tcpServer --tcpPort 8990 --http2Server --http2Port 8989

# Project-bound cloud upload
./gg ./MyLib.dll --projectKey "$GC_PROJECT_KEY" --port 8888

# Expose only selected types
./gg ./MyLib.dll --types MyCompany.Api.Facade,MyCompany.Api.AdminFacade

# MCP with base class
./gg ./MyLib.dll --mcpBaseClass MyCompany.Tools.AiFacade --port 8888 --httpPort 8889

# Development without semver bumps
./gg ./MyLib.dll --noVersioning --port 8888

See also