Skip to content

Settings Basics

NEX reads configuration from environment variables. You can store settings in either of these files:

  1. Working-directory .env file: NEX reads .env from the current working directory when you launch it. This is useful for project- or service-specific settings.

  2. User configuration file: Individual users can create a personal configuration file located at:

    ~/.nex/config
    
    This file allows users to override or extend the default configuration with their own settings.

Note

When both files set the same value, user configuration takes precedence.

Before running NEX for the first time, you need to create the ~/.nex directory and the config file with:

mkdir -p ~/.nex
touch ~/.nex/config

The configuration files use a standard environment variable format, where each setting is defined as a key-value pair:

VARIABLE=value

First-Run Setup

After creating your configuration file:

  1. Configure your NEX license.
  2. Configure your LLM provider and its credentials.
  3. Launch nex from your project directory.

Common Runtime Settings

These settings can be placed in either configuration file or supplied as environment variables:

Variable Default Purpose
NEX_COLOR_SCHEME auto Terminal color scheme: auto, light, or dark. See Terminal Color Scheme.
AGENTS_DIRECTORIES ["./agents", "~/.nex/agents"] JSON list of folders searched for custom agents. Replaces the default list; earlier folders take precedence.
REQUEST_LIMIT 200 Maximum agent requests before NEX pauses. Increase it for longer workflows; entering continue resumes a paused run.
BACKGROUND_MAX_JOBS 5 Maximum concurrent background shell jobs. Set to 0 to disable background jobs.
SHELL_WATCHDOG_INTERVAL 300 seconds Seconds between status heartbeats for a foreground shell command. Set to 0 to disable heartbeats.
TOOL_OUTPUT_MAX_CHARS 30,000 Maximum shell output characters returned per tool call. Set to 0 to disable truncation.
TOOL_READ_MAX_CHARS 16,000 Maximum read and search output characters returned per tool call. Set to 0 to disable truncation.
PDF_INLINE_CHAR_LIMIT 40,000 Maximum PDF text characters returned inline; larger results are saved under .nex/pdf/. Set to 0 to disable the limit.
LLM_TIMEOUT_SCHEDULE 15, 90, 180 seconds Per-attempt timeouts for LLM request retries. Supply positive values as a comma-separated list.
LLM_STREAM_READ_TIMEOUT 300 seconds Maximum wait for more data in a streamed LLM response.
SKILL_SCRIPT_TIMEOUT 600 seconds Maximum runtime for a custom skill script.

After modifying the configuration, simply restart NEX for the changes to take effect.

Info

Some settings are mutually exclusive (for example, only one LLM_PROVIDER can be active at a time). Keep your config to a single active provider block to avoid ambiguity.