---
title: "CLI"
---

# CLI

The Neural Inverse CLI is an AI coding agent for the terminal. This overview covers what it does, how to start, and where each topic is documented.

The CLI is the terminal part of Neural Inverse Build. It is an AI coding agent: it reads your code, runs commands and makes changes, with the model provider of your choice, under permission rules that you and your organisation control. The command is `neuralinverse`; `ni` is a short alias.

```text
you  │ the refund endpoint returns 500 when the order has no payment, find and fix it
ni   │ The handler assumes `order.payment` is always set. Let me look at the route first.
  ⬢ search_text refund · 3 files · 41ms
  ⬢ read_file src/routes/refunds.ts · 212 lines · 2ms
┌─ approval needed ─ edit_file
│ Edit src/routes/refunds.ts
│   48 - const captured = order.payment.capturedAmount;
│   48 + if (!order.payment) return res.status(409).json({ error: 'order has no payment' });
└─ [1] allow once  [2] always allow…  [3] deny  [4] deny & explain
```

## What it does

- **Any model provider.** Anthropic, OpenAI (Chat Completions and Responses), Google Gemini, AWS Bedrock, Claude on Vertex AI, Azure OpenAI, and any OpenAI-compatible server such as Ollama, vLLM, LM Studio, OpenRouter, Groq, DeepSeek, Mistral or xAI. Local models need no key.
- **Every action checked first.** Each file change and command passes your organisation's governance, then permission rules and a mode (`ask`, `auto-edit`, `read-only`, `full-auto`). Shell commands can run in an operating-system sandbox.
- **Built for teams.** Layered settings, managed policy files, an append-only audit log, hooks, MCP servers, skills, sub-agents and slash commands kept in the repository.
- **Scriptable.** A non-interactive mode with `text`, `json` or `stream-json` output for scripts and CI, a GitHub Action, an SDK and a local HTTP API.
- **Recoverable.** Sessions are saved and can be resumed; every prompt is a checkpoint you can return to with `/undo`.

## Quick start

[Install the CLI](https://neuralinverse.com/docs/cli/install/), set a key for a model provider (or run a local model), and start it in your project folder:

```bash
export ANTHROPIC_API_KEY=...        # or OPENAI_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY, ...
cd your-project
neuralinverse
```

Started with no usable provider, the CLI walks you through setup. A local model works without a key:

```bash
ollama pull qwen3-coder
neuralinverse --model ollama/qwen3-coder
```

Run once without the interactive interface:

```bash
neuralinverse -p "summarize what changed in the last 5 commits"
git diff | neuralinverse -p "review this diff for bugs" --output-format json
```

To use your organisation's account and policy, [sign in to Govern](https://neuralinverse.com/docs/cli/sign-in/) with `neuralinverse login`. Signing in is optional unless your organisation requires it.

## Developer environments

The CLI has the same two optional developer environments as the Editor: `embedded` for Cortex-M firmware and `hdl` for FPGA and ASIC designs. An environment is a project setting you choose by hand; it is never switched on automatically. See [Firmware and hardware environments](https://neuralinverse.com/docs/cli/environments/).

## Find your way

| Task | Page |
|---|---|
| Install, update and check the installation | [Install and update](https://neuralinverse.com/docs/cli/install/) |
| Sign in with your organisation's account | [Sign in to Govern](https://neuralinverse.com/docs/cli/sign-in/) |
| Learn the screen, keys and approval cards | [Your first session](https://neuralinverse.com/docs/cli/interface/) |
| Look up a slash command | [Slash commands](https://neuralinverse.com/docs/cli/slash-commands/) |
| Resume, undo, export; keep long sessions small | [Sessions and context](https://neuralinverse.com/docs/cli/sessions/) |
| Choose providers and models, set budgets and fallbacks | [Providers and models](https://neuralinverse.com/docs/cli/models/) |
| See what the agent can do | [Tools](https://neuralinverse.com/docs/cli/tools/) |
| Control what runs without asking | [Permissions and modes](https://neuralinverse.com/docs/cli/permissions/) |
| Write settings files | [Settings reference](https://neuralinverse.com/docs/cli/configuration/) |
| Run scripts at lifecycle points | [Hooks](https://neuralinverse.com/docs/cli/hooks/) |
| Connect MCP servers | [MCP servers](https://neuralinverse.com/docs/cli/mcp/) |
| Add project instructions, commands, agents and skills | [Instructions, commands and skills](https://neuralinverse.com/docs/cli/extending/) |
| Share a packaged workflow | [Plugins](https://neuralinverse.com/docs/cli/plugins/) |
| Use organisation context from Govern | [Organisation context](https://neuralinverse.com/docs/cli/organisation-context/) |
| Gate agent edits and commits on your rules | [Checks](https://neuralinverse.com/docs/cli/checks/) |
| See what is reported to your organisation | [Activity record](https://neuralinverse.com/docs/cli/activity/) |
| Run in scripts and CI | [Non-interactive use and CI](https://neuralinverse.com/docs/cli/automation/) |
| Run unattended goals, team runs and schedules | [Goals, team runs and schedules](https://neuralinverse.com/docs/cli/autonomy/) |
| Work with GitHub pull requests, issues and Actions | [GitHub](https://neuralinverse.com/docs/cli/github/) |
| Use the agent from Zed or VS Code | [Editors](https://neuralinverse.com/docs/cli/editors/) |
| Firmware and HDL work | [Firmware and hardware environments](https://neuralinverse.com/docs/cli/environments/) |
| Drive the agent from code | [SDK, server and embedding](https://neuralinverse.com/docs/cli/sdk/) |
| Use a browser instead of the terminal | [Web interface](https://neuralinverse.com/docs/cli/web/) |
| Roll out to an organisation | [Enterprise deployment](https://neuralinverse.com/docs/cli/enterprise/) |
| Measure the agent | [Evals](https://neuralinverse.com/docs/cli/evals/) |
| Look up a command, flag or exit code | [Command reference](https://neuralinverse.com/docs/cli/reference/) |
| Fix a problem | [Troubleshooting](https://neuralinverse.com/docs/cli/troubleshooting/) |

## Maturity

The CLI is at version 0.1.0, with further features listed as unreleased in its changelog. Some parts are not complete:

- **Organisation policy from Govern.** After sign-in the CLI asks Govern for a signed policy at `GET /api/v1/policy/bundle`. The current Govern server does not serve that route, and the CLI treats a missing policy as "no organisation policy". Until it does, organisation settings, allowed models, the organisation model gateway and organisation skills do not reach the CLI through sign-in. Managed settings files and the remote policy work today. See [Sign in to Govern](https://neuralinverse.com/docs/cli/sign-in/#known-gaps).
- **Activity record to Govern.** Govern's current ingest route expects a service credential and a different request body from the one the CLI sends, so delivery of the CLI's activity events to Govern is not confirmed end to end. A self-hosted receiver works as documented. See [Activity record](https://neuralinverse.com/docs/cli/activity/#known-gaps).
- **Firmware and HDL tools.** They reuse the Editor's modules, whose own records say nothing has been run on a board yet. See [Firmware and hardware environments](https://neuralinverse.com/docs/cli/environments/#maturity).
- **Evals.** No real-model results have been recorded yet. See [Evals](https://neuralinverse.com/docs/cli/evals/).
- **Running inside the Editor.** The adapter that registers the CLI as an agent in the Editor's shared agent host is drafted but not yet part of the Editor. See [SDK, server and embedding](https://neuralinverse.com/docs/cli/sdk/#embedding-in-a-governing-host).

## Licence

The CLI is proprietary and licensed under your organisation's agreement with Neural Inverse. Its package includes a `NOTICE` file listing the open-source libraries it uses and their licences. See [licence](https://neuralinverse.com/licence/).

For the other Build apps and for Govern, see [Neural Inverse Build](https://neuralinverse.com/docs/build/) and [Neural Inverse Govern](https://neuralinverse.com/docs/govern/).
