Five minutes from zero
Install the CLI, initialise the project, index, and query. By the end of this page you have an indexed nci.sqlite your agent can read through MCP — whether you run the commands or hand the flow to an agent.
For your agent
If you work through Cursor, Claude Code, Codex, or another skills-aware client, you can skip typing the steps below and ask the agent to set NCI up end to end. Install the bundled nci and nci-answer-quality skills first — they teach the primer workflow, when to call nci_query vs nci_sql, and how to answer type questions from signatures instead of memory.
Then point the agent at this repo (or your consumer project) and ask it to install the CLI globally, run nci init -y, nci index, and wire MCP. Host paths and skill behaviour are documented in NCI skills.
Run it yourself
The numbered steps below are the same path, for when you want to run commands locally or verify what the agent did.
1. Install the CLI
The CLI is published as @nativecontextindex/cli. Pick your package manager — the page remembers your choice next time.
2. Initialise the project
nci init writes nci.config.json next to your package.json and opens the database (running pending migrations). The interactive form drops the -y and prompts you for each field. Everything is overridable from the CLI later — see Configuration for the full schema.
3. Index your dependencies
The progress display can be controlled with NCI_PROGRESS=auto|on|off. Subsequent runs only re-process changed packages — the first index is the slow one.
4. Query the index
query find is FTS over the symbol graph. For a known name, query symbol useState is the exact-match path. For listings, query symbols <name> <version> paginates with --offset/--limit. Add --format json whenever you need the structured envelope:
evidence is the bundled call: exact-name + FTS hits + batched signature snippets in one round-trip. It is what an agent should reach for first.
5. What now?
- Wire NCI into your agent — see MCP Protocol.
- Tune for monorepos — see Monorepo indexing.
- Browse every flag — see CLI API.
- Read the same primer your agent reads — Agent primer.