Skip to content

CLI reference ​

Commands ​

bash
llmock start                        # uses defaultModel from .llmockrc.json (chatgpt if none), port 8001
llmock start --model=gemini
llmock start --model=claude         # Anthropic Messages API
llmock start --port=3000 --stream=true
llmock start --port=0               # any free port; the port is printed
llmock stop                         # add --port=3000 if not on 8001
llmock config                       # show current settings (accepts --model)
llmock help

All CLI flags support both --key=value and --key value formats and override .llmockrc.json at runtime. start is the default command, so llmock --model=claude works too.

llmock start returns once the server is answering. If the server cannot start (for example a config error), or one is already running on that port, it exits with an error instead; run with --foreground to see the server's own output.

--port=0 lets the system pick a free port. llmock start then prints the port it got (Server is running at: http://0.0.0.0:54321) and the llmock stop --port=54321 that stops it; with --foreground the server prints it in its SERVER UP AND RUNNING line. The dashboard and GET /ui-meta show the real port.

CLI options ​

Each option overrides the matching setting of the selected preset for that run:

OptionOverridesValue
--modeldefaultModelName of a preset in .llmockrc.json
--port / --hostserver.port / server.hostPort number (0: any free port) / address
--adminserver.admintrue or false
--uiThemeserver.uiThemedark or light
--llmspyserver.llmspyNo value (on), true/false, or LLMSpy's address. Prints how to use the server through LLMSpy
--endpointendpointPath without a leading slash
--responseTyperesponseTypelorem or stored
--maxLoremParasmaxLoremParasNumber
--validateRequestsvalidateRequeststrue or false
--logRequestslogRequeststrue or false
--maxLoggedRequestsmaxLoggedRequests1 to 100
--debugdebugtrue or false
--streamstreamtrue or false
--delayMin / --delayMaxresponseDelay.min / .maxMilliseconds
--chaoschaos.enabledtrue or false
--chaosFrequencychaos.frequencyWhole number, 1 or more
--chaosModechaos.modeevery or random
--chaosStatuschaos.status400 to 599
--chaosKindchaos.kindhttp, stream-error, stream-drop or stream-stall
--chaosAfterChunkschaos.afterChunksWhole number, 0 or more
--embeddingsembeddings.enabledtrue or false
--embeddingDimensionsembeddings.dimensionsNumber
--recordrecordings.upstreamThe provider's URL, e.g. https://api.anthropic.com (empty: replay only). See Recording real replies
--recordingsrecordings.dirFolder, relative to the config file (default recordings)
--foregroundNo value; keeps the server attached (see Foreground mode)

An on/off option is on for true, 1, on or yes (in any case) and off for anything else.

llmock help prints the same list. responseRules and storedResponsesFile can only be set in the config file; to add a rule to a running server, use the admin API.

Released under the MIT License.