Skip to content

Nexrall CLI

The Nexrall CLI brings the coding agent to your terminal — scriptable, headless, and suited to CI pipelines and automation. It runs the same agent engine as Nexrall Code for VS Code and Nexrall Work.

Install

sh
npm install -g nexrall-code

The binary is called nex. Then run it from any project directory:

sh
nex

Interactive use

Running nex with no arguments starts an interactive session in your current directory — describe what you want, and the agent reads the project, edits files, and runs commands just like in VS Code.

Running nex "some prompt" starts the same interactive session but with your first message already sent, so you can watch it work and keep chatting afterward.

Startup flags

FlagWhat it does
-m, --model <name>Explicit model id — e.g. claude-opus-5, gpt-5.4, deepseek-v4-pro. See Models.
-t, --turboShorthand for claude-sonnet-5 (fast, default).
-p, --proShorthand for claude-opus-5 (most capable Claude).
-u, --ultraShorthand for claude-fable-5 (most powerful Claude).
-d, --dir <path>Working directory (default: current directory).
-r, --resume [id]Resume the last session, or a specific saved session id.
-y, --yoloAuto-approve every tool call — no permission prompts.
--no-bannerSkip the ASCII banner (useful in scripts/pipes; automatic when input is piped).
--output-format <fmt>One-shot machine-readable output: text | json | stream-json — see Headless / CI use.

Piped input

If you pipe data into nex, it's read up front and handed to the agent as part of the turn — useful for feeding it a diff, a log, or any command's output directly:

sh
git diff | nex "review this change for bugs"
cat error.log | nex "what's causing this crash?"

Slash commands

CommandWhat it does
/model [name]Show or switch the model (e.g. claude-opus-5, gpt-5.4).
/mode [ask|edit|plan|auto]Show or switch the agent mode.
/effort [low|medium|high|extra]Show or switch the thinking-effort level.
/resume [id]Resume the last session, or a specific saved session.
/sessionsList saved sessions.
/saveSave the current session immediately.
/clearClear the conversation and start a fresh session.
/rewind [id]List file checkpoints, or roll back to one — reverts both the files and the conversation to that point.
/compactManually summarize the conversation to free up context (this also happens automatically as a session grows).
/initGenerate a nexrall.md (project-specific instructions) by analyzing your project.
/add <filepath>Add a specific file's contents to the conversation context.
/balanceShow your current wallet balance.
/yoloAuto-approve all permissions for the rest of the session.
/commandsList custom slash commands from .nexrall/commands/*.md.
/pluginsList installed plugins.
/updateUpdate nex to the latest version.
/helpShow this list.
/exit, /quitExit (auto-saves the session first).

Project instructions: nexrall.md

Run /init (or ask for it in a session) to generate a nexrall.md file at your project root — a short, project-specific brief (tech stack, conventions, what to avoid) that's automatically included in every session started in that directory, so you don't have to repeat context every time.

Checkpoints & rewind

Every file-modifying turn is checkpointed automatically. /rewind lists them and lets you roll back to any point — both the files on disk and the conversation history revert together, so you can safely try an approach, decide it was wrong, and get back to exactly where you were.

If a rewound turn ran shell commands, those side effects are not automatically undone (the CLI can't know how to reverse an arbitrary command) — /rewind tells you when this applies and, if it touched a git repo, gives you a recovery hash from a snapshot taken right before the command ran.

Headless / CI use

For scripts and CI pipelines, pass a prompt directly and get structured output:

sh
nex --dir ./my-project --model claude-opus-5 --output-format json --no-banner \
  "Fix the failing test in src/utils"

--output-format supports:

  • json — a single JSON object at the end: { result, tool_calls, usage }.
  • stream-json — one JSON object per line as the agent works (tool calls, tool results, text, final result) — useful for piping into another process that wants to react as it happens.

Passing --output-format implies auto-approve, since there's no one to prompt for permission in a non-interactive run.

GitHub Action

See GitHub Action for running the CLI directly inside a GitHub Actions workflow with structured outputs.

Authentication

Interactively, the CLI walks you through login on first run (nex auth). For CI or any non-interactive context, set NEXRALL_TOKEN as an environment variable instead — it always takes precedence over any locally saved interactive session:

sh
export NEXRALL_TOKEN=<token>

Safety in headless mode

Destructive-but-legitimate operations (dropping a database table, force-pushing, terraform destroy, and similar) are blocked by default in headless mode, even with auto-approve on — a script or CI job has no one to confirm with. To allow them explicitly in a trusted CI context, set:

sh
NEXRALL_ALLOW_DESTRUCTIVE=1

Plugins

sh
nex plugin install owner/repo        # from GitHub
nex plugin install owner/repo#branch/subdir
nex plugin install https://github.com/owner/repo
nex plugin install ./local/path
nex plugin search <name>             # search the registry
nex plugin info <name>
nex plugin list                      # what's installed
nex plugin remove <name>
nex plugin update [name]

See Plugins for the full plugin system — commands, agents, and hooks.

Updating

sh
nex update            # update to the latest version
nex update --check    # check without installing

or /update inside a session.

Reference

The CLI is one surface of the developer-tools coding agent — for the full technical surface, see:

Built by Maxrall, Inc.