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
| Option | Type | Default | Description |
|---|---|---|---|
--projectKey | string | (empty) | JWT from Portal for cloud auth and project binding. Overridden by GC_PROJECT_KEY. |
--modules | list | (empty) | Comma-separated modules (DLLs, JARs, paths). If empty, GG scans current directory. |
--runtime | enum | auto | auto, clr, netcore, java, jvm, python, python27, ruby, nodejs, php, perl |
--endpoint | URL | https://grft.dev | Cloud endpoint. Overridden by GSMU_ENDPOINT. |
--port | number | 80 | WebSocket server port (Graft remote calls, MCP) |
--httpPort | number | 81 | HTTP server (Vision, REST-style MCP routes) |
--tcpPort | number | 82 | TCP server port when --tcpServer is enabled |
--http2Port | number | 83 | HTTP/2 server port when --http2Server is enabled |
--GV | flag | on | Host Graftcode Vision |
--GMA | flag | off | Enable Graftcode Module Analyzer |
--GSMU | flag | off | Upload Unified Graft Model to GSMU |
--tcpServer | flag | off | Enable TCP server for Hypertube |
--http2Server | flag | off | Enable HTTP/2 server |
--types | list | (empty) | Comma-separated fully qualified type names to expose |
--runApp | flag | off | Run the application entry point |
--mcpBaseClass | string | (empty) | FQN of MCP base class for bare tools/call resolution |
--corsAllowedOrigins | list | (empty) | CORS allowlist (e.g. http://localhost:3000 or *) |
--corsConfig | path | (empty) | Path to CORS config file |
--useContext | flag | off | Enable Graftcode Context (headers → hosted code) |
--noVersioning | flag | off | Use hash-based identity instead of module version |
--doNotExtractBinaries | flag | off | Skip extracting bundled binaries |
--config | path | (empty) | Hypertube configuration file path |
Environment variables: Environment variables.
Runtime notes
| Runtime | Requirement |
|---|---|
netcore | .NET Core 3.1+ / .NET 5+ |
clr | .NET Framework 4.7.2+ |
java / jvm | Java 8+; JAVA_HOME set |
python | Python 3.6+ |
nodejs | Node.js 22+ |
ruby | Ruby 3+ |
php | PHP 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