Reference

Configuration

Effective values follow a three-layer order: environment variables override ~/.ima2/config.json, which overrides built-in defaults.

Environment variables

VariableDefaultDescription
IMA2_PORT / PORT3333Web server port.
IMA2_HOST127.0.0.1Web server bind host.
IMA2_OAUTH_PROXY_PORT / OAUTH_PORT10531OAuth proxy port.
IMA2_SERVERCLI target override.
IMA2_CONFIG_DIR~/.ima2Config and SQLite location.
IMA2_ADVERTISE_FILE~/.ima2/server.jsonRuntime discovery file.
IMA2_GENERATED_DIR~/.ima2/generatedGenerated image directory.
IMA2_IMAGE_MODEL_DEFAULTgpt-5.4-miniServer fallback image model.
IMA2_REASONING_EFFORTmediumDefault reasoning effort for the default (OAuth) path; one of none, low, medium, high, xhigh.
IMA2_NO_OAUTH_PROXYSet 1 to disable the auto-started OAuth proxy.
IMA2_LOG_LEVELinfoserve defaults to info, dev to debug; accepts debug, info, warn, error, silent.
IMA2_INFLIGHT_TERMINAL_TTL_MS300000Recent terminal job retention for debug views.
OPENAI_API_KEYAPI key for the API-provider Responses path and auxiliary features.
IMA2_API_IMAGE_MODEL_DEFAULTgpt-5.4-miniDefault image model for the API path.
IMA2_API_REASONING_EFFORTlowDefault reasoning effort for the API path.
IMA2_API_IMAGE_SIZE1024x1024Default size for the API path.
IMA2_API_ALLOW_WEB_SEARCHtrueToggle web search for the API path.
IMA2_GROK_PROXY_HOST127.0.0.1Bundled progrok bind host.
IMA2_GROK_PROXY_PORT18645Bundled progrok port.
IMA2_NO_GROK_PROXYSet 1 to disable auto-starting bundled progrok.
IMA2_GROK_PLANNER_MODELgrok-4.3xAI search/planner model for provider: "grok".
IMA2_GROK_PLANNER_TIMEOUT_MS60000Timeout for each Grok search/planner step.
IMA2_GROK_IMAGE_MODEL_DEFAULTgrok-imagine-imageDefault xAI image model for Grok image calls.
IMA2_GROK_GENERATION_TIMEOUT_MS120000Timeout for final Grok image generation/edit calls.
IMA2_GROK_STATUS_TIMEOUT_MS3000Timeout for /api/grok/status model probes.
IMA2_OAUTH_MASKED_EDIT_ENABLEDfalseOpt-in masked-edit flag on the OAuth path (#31, groundwork only).

The config file

ima2 config reads and writes ~/.ima2/config.json (the file layer). It rejects unknown keys, refuses auth keys (provider, apiKey), and warns when an env var is overriding the same key. Change auth with ima2 setup or ima2 login instead.

Common writable keys

imageModels.default              imageModels.reasoningEffort
apiProvider.defaultImageModel    apiProvider.defaultReasoningEffort
grokProvider.plannerModel        grokProvider.plannerTimeoutMs
grokProvider.defaultImageModel
log.level                        features.cardNews
server.port  server.host  server.bodyLimit
oauth.proxyPort  limits.maxRefCount  limits.maxParallel
history.defaultPageSize  history.maxPageCap  storage.generatedDir

Run ima2 config keys for the authoritative list, or ima2 config ls --effective to see merged values.

Logging modes

ima2 serve stays intentionally quiet: startup URLs, warnings, and errors are visible, while request/node/OAuth structured logs are hidden by default. Use ima2 serve --dev, npm run dev, or IMA2_LOG_LEVEL=debug ima2 serve when you need request IDs, node phases, OAuth stream diagnostics, or inflight transitions.

Full config and defaults command tables live in CLI.md.