MAR 13, 2026  / 5 MIN READ

# Introducing the Nia CLI

On this page

The most capable AI agents today live in the terminal. Claude Code, Cursor, custom pipelines built on tool-use frameworks — they reason, write code, execute commands, and iterate. When these agents need external knowledge, they shouldn’t have to drop into an SDK or construct HTTP requests. They should run a command.

Today we’re releasing the **Nia CLI**: a standalone command-line tool that gives any terminal-based agent direct access to Nia’s full intelligence stack — indexing, search, research, and context sharing — all from the command line.

## Why a CLI?

We built Nia as an MCP server and API. Both work well when your agent supports MCP natively or when you’re building custom integrations. But a growing number of agents operate purely through shell commands. For those agents, a CLI is the most natural interface.

Every command accepts structured output that agents can parse directly. Every long-running operation supports async execution with separate status polling. And every command works non-interactively, so agents can compose Nia’s tools into multi-step pipelines without human intervention.

## Install in one line

```bash
bunx nia-wizard@latest
```

The wizard handles authentication, configuration, and sets up the CLI in your terminal. Once installed, you have access to the full Nia platform from the command line.

## What your agent can do

### Index anything

Nia indexes repositories, documentation sites, research papers, HuggingFace datasets, local folders, and more. The CLI makes this a single command.

```bash
# Index a GitHub repository
nia repos index vercel/ai

# Index documentation
nia sources index https://docs.anthropic.com

# Index a research paper from arXiv
nia papers index 2312.00752

# Index a HuggingFace dataset
nia datasets index dair-ai/emotion

# Sync a local folder
nia local add ~/dev/my-project
nia local watch
```

Indexing runs asynchronously. Check status with `nia repos status <id>` or `nia sources list` and move on while it completes.

### Search across everything

Once indexed, all sources are searchable through a unified interface. Nia combines semantic embeddings with BM25 for hybrid retrieval that handles both natural language queries and exact pattern matching.

```bash
# Semantic search across all indexed sources
nia search query "How does auth middleware work?" --repos vercel/ai --docs anthropic

# Search the public web
nia search web "latest OpenTelemetry collector changes" --category github

# Deep multi-step research
nia search deep "Compare RAG evaluation frameworks"
```

For code-level precision, `grep` and `read` work the way you’d expect:

```bash
# Regex search in a repository
nia repos grep vercel-ai "generateText.*stream" --lines-after 5

# Read a specific file
nia repos read vercel-ai packages/ai/core/generate-text/index.ts
```

### Run deep research

For questions that require synthesizing multiple sources, the Oracle research agent handles the full workflow: searching, reading, cross-referencing, and producing cited reports.

```bash
# Start an async research job
nia oracle job "How does TurboPuffer handle vector quantization internally?" \
  --repos turbopuffer/turbopuffer

# Stream real-time progress
nia oracle stream <job-id>
```

Oracle is powered by Claude Opus 4.6 with 1M context. It runs autonomously — searching code, reading files, exploring repository structure — until it has enough information to produce a comprehensive answer with citations.

For GitHub-specific exploration without indexing, Tracer searches live:

```bash
# Search GitHub code without pre-indexing
nia tracer run "How does Hono handle error middleware?" --repos honojs/hono

# Stream the agent's progress
nia tracer stream <job-id>
```

### Save and resume context

This is the one that changes workflows. Agents lose everything between sessions. The CLI’s context commands let agents save conversation histories, plans, and decisions — then resume them in another agent without losing the thread.

```bash
# Save context from the current session
nia contexts save "Auth refactor plan" \
  --summary "Migrating from JWT to session tokens" \
  --content "$(cat plan.md)" \
  --memory-type procedural

# Search saved contexts later
nia contexts semantic "auth migration approach"

# Retrieve a specific context
nia contexts get <id>
```

Four memory types keep things organized: `scratchpad` for temporary notes, `episodic` for session records, `fact` for permanent knowledge, and `procedural` for workflows and processes.

## Search without indexing

Not everything needs to be indexed first. The CLI includes tools that work immediately:

| Tool                   | What it does                                                        |
|------------------------|---------------------------------------------------------------------|
| `nia tracer`           | Autonomous GitHub code search across any public repo                |
| `nia packages grep`    | Regex search in npm, PyPI, Crates.io, Go, and Ruby Gems packages    |
| `nia packages hybrid`  | Semantic + keyword search in package source code                    |
| `nia search web`       | Public web search for code, docs, and research                      |
| `nia github read`      | Read any file from any public GitHub repo                          |

No setup. No indexing delay. Just answers.

## Built for agents

The CLI is designed to be used by agents, not just humans. A few things that make this work:

- **Structured output**: Every command supports JSON output for machine parsing
- **Async-first**: Long-running operations return job IDs immediately, with separate status and streaming commands
- **Non-interactive**: No prompts, no confirmations — agents can script multi-step workflows end to end
- **Composable**: Pipe search results into read commands, feed research outputs into context saves

An agent can search for relevant code, read the implementation, run a research job to understand the broader pattern, and save its findings — all through sequential CLI commands.

## Local folder sync

The CLI includes a daemon for keeping local folders continuously synced with Nia’s index:

```bash
# Register a folder
nia local add ~/dev/my-project

# One-time sync
nia local sync

# Continuous watch (file watcher with debouncing)
nia local watch --debounce-ms 500
```

Changes are detected and synced incrementally. Your agent always searches over the latest version of your local files.

## Get started

Install the CLI, authenticate, and run your first search:

```bash
bunx nia-wizard@latest
nia search query "your first query"
```

Full documentation is at [docs.trynia.ai](https://docs.trynia.ai/). The CLI source is open on [GitHub](https://github.com/nozomio/nia-cli).
