Index commands
Index commands
Reference for indexed index *. For global options (before COMMAND) and for init, docs, and license at the top level, see Other commands (and the sections below that). For walkthroughs, see Create, inspect, update & remove.
Subcommands such as indexed index create files and indexed index create jira also expose Logging and Storage option groups (after the subcommand) — in addition to any global options you pass between indexed and index. Run indexed index create files --help to see the exact groups.
indexed index create
Create a new collection from a connector. Available connectors: files, jira, confluence, outline, and github (indexed index create --help).
indexed index create files
indexed index create files [OPTIONS]| Option | Default | Description |
|---|---|---|
--collection / -c | files | Collection name |
--path / -p | — | Root path or file(s); from config or prompt if omitted |
--include | — | Regex patterns to include (repeatable) |
--exclude | — | Regex patterns to exclude (repeatable) |
--fail-fast / --no-fail-fast | no-fail-fast | Stop on the first file read error |
--use-cache / --no-cache | use-cache | On-disk parse cache for faster reindexing |
--force | off | Remove an existing collection with the same name first |
--gitignore / --no-gitignore | gitignore | Honor .gitignore and skip common noise directories |
--local (Storage) | off | Store the collection under ./.indexed/ instead of ~/.indexed/ |
| Logging | --verbose / -v, --log-level, --json-logs (see indexed index create files --help) |
Example:
indexed index create files -c my-docs -p ./docs --include ".*\.md$" --forceindexed index create jira
indexed index create jira [OPTIONS]| Option | Default | Description |
|---|---|---|
--collection / -c | jira | Collection name |
--url / -u | — | Jira base URL; from config or prompt if omitted |
--jql / --query / -q | — | JQL filter; from config or prompt if omitted |
--email | — | Atlassian account email (overrides config / env) |
--token | — | API token (overrides env, e.g. ATLASSIAN_TOKEN) |
--use-cache / --no-cache | use-cache | On-disk cache for unchanged issues |
--force | off | Remove an existing collection with the same name first |
| Logging / Storage | As on create files (--local, --verbose, etc.) |
Long-running credentials and env vars are covered in Config commands and the Jira guide.
Example:
indexed index create jira -c eng-tickets \
-u https://company.atlassian.net \
-q "project = ENG AND created >= -90d"indexed index create confluence
indexed index create confluence [OPTIONS]| Option | Default | Description |
|---|---|---|
--collection / -c | confluence | Collection name |
--url / -u | — | Confluence base URL; from config or prompt if omitted |
--cql / --query / -q | — | CQL filter; from config or prompt if omitted |
--email | — | Atlassian account email (overrides config / env) |
--token | — | API token (overrides env, e.g. ATLASSIAN_TOKEN) |
--read-all-comments / --first-level-comments | read-all-comments | All nested comments vs top level only |
--use-cache / --no-cache | use-cache | On-disk cache for unchanged pages |
--force | off | Remove an existing collection with the same name first |
| Logging / Storage | As on create files (--local, --verbose, etc.) |
Example:
indexed index create confluence -c team-wiki \
-u https://company.atlassian.net/wiki \
-q "space = ENG AND type = page"indexed index search
indexed index search [OPTIONS] QUERYQUERY is a required argument (natural language). For the machine payload add --json to the command. The older global --simple-output (placed before index) still works on search as an alias for it; prefer --json.
| Option | Default | Description |
|---|---|---|
--collection / -c | all collections | Limit to one collection by name |
--limit / -l | 10 (from core.v1.search.max_docs, which is validated to 1–100) | Max results per collection. The flag itself is not clamped — raise it as far as you need. |
--rerank / --no-rerank | core.v2.rerank.enabled (off unless enabled) | Rerank results with a cross-encoder. v2 collections only — if no searched collection uses the v2 engine, indexed prints a notice and the flag has no effect. |
| --json | off | Print the documented machine payload (schema: "indexed.search/1") instead of the human view. Same shape as the MCP tools; ignores --compact / --no-content || --compact | off | Compact list instead of cards |
| --no-content | off | Hide content previews |
| Logging | | --verbose / -v, --log-level, --json-logs |
Examples:
indexed index search "authentication methods"
indexed index search "rate limiting" -c eng-tickets -l 10
indexed index search "deploy" -l 3 --jsonSearch output
--json prints one documented object instead of cards, and the MCP tools search and search_collection return that same object from the same builder (MCP commands) — one shape for a script and an agent.
Read schema first: "indexed.search/1" is the success payload below. A payload carrying an error string and no schema is a failed request, and a failure never reads as "nothing matched".
Document-level facts (collection, source_type, id, path, url, score_kind) are stated once per document; each hit carries only relevance, score, locator and text.
Captured from a real run, not authored by hand: three files (deploy.md, runbook.md, cache.py) indexed into a local docs-demo collection (.indexed/), then
indexed --local index search "how is the cache keyed and invalidated" -l 2 --json{
"schema": "indexed.search/1",
"query": "how is the cache keyed and invalidated",
"counts": {
"documents": 2,
"hits": 6
},
"collections": [
"docs-demo"
],
"collection_errors": [],
"documents": [
{
"collection": "docs-demo",
"source_type": "localFiles",
"id": "cache.py",
"path": "/home/agent/demo-corpus/demo/cache.py",
"score_kind": "l2_squared",
"hits": [
{
"relevance": 0.4783,
"score": 1.0434,
"locator": {
"kind": "line_span",
"start_line": 9,
"end_line": 11
},
"text": "def cache_get(store, collection, doc_id):\n key = cache_key(collection, doc_id)\n return store.get(key)"
},
{
"relevance": 0.4714,
"score": 1.0571,
"locator": {
"kind": "line_span",
"start_line": 4,
"end_line": 6
},
"text": "def cache_key(collection, doc_id):\n \"\"\"Stable cache key for one document of a collection.\"\"\"\n return f\"{collection}:{doc_id}\""
},
{
"relevance": 0.462,
"score": 1.0761,
"locator": {
"kind": "document"
},
"text": "cache.py"
},
{
"relevance": 0.4588,
"score": 1.0825,
"locator": {
"kind": "line_span",
"start_line": 14,
"end_line": 16
},
"text": "def cache_put(store, collection, doc_id, value):\n store[cache_key(collection, doc_id)] = value\n return value"
},
{
"relevance": 0.3361,
"score": 1.3277,
"locator": {
"kind": "line_span",
"start_line": 1,
"end_line": 3
},
"text": "\"\"\"Cache helpers for the demo collection.\"\"\""
}
]
},
{
"collection": "docs-demo",
"source_type": "localFiles",
"id": "deploy.md",
"url": "file:///home/agent/demo-corpus/demo/deploy.md",
"score_kind": "l2_squared",
"hits": [
{
"relevance": 0.2353,
"score": 1.5294,
"locator": {
"kind": "headings",
"headings": [
"Deployment guide",
"Release pipeline"
]
},
"text": "Deployment guide > Release pipeline\nProduction deploys run from the release branch only. Every commit that reaches production has passed the full CI suite: lint, the unit suite, and the end to end smoke tests.\nThe pipeline builds the artifact once, tags it with the commit SHA, and promotes that same artifact through staging to production. Nothing is rebuilt between environments."
}
]
}
]
}Top level
| Key | Type | Meaning |
|---|---|---|
schema | string | Always "indexed.search/1" today. Branch on it; an incompatible change bumps it. |
query | string | The query as submitted. |
counts.documents | int | Number of entries in documents. |
counts.hits | int | Total hits across all documents. |
collections | string[] | Collections that answered, in search order. [] means every collection the search reached failed — each one then appears in collection_errors. Not the same as "searched and nothing matched", which keeps the name and returns documents: []. A store with nothing to search never produces this payload: the CLI prints an error envelope instead ({"error": "No collections found"}, or {"error": "No searchable collections available"} when the named collection has no indexers). |
collection_errors | object[] | Always present, [] when nothing failed. Each entry is {"collection": "<name>", "error": "<message>"}; a collection that reached the engine and failed appears here and is absent from collections, never a silent zero. A collection whose manifest cannot be read is left out of both arrays by the CLI. |
documents | object[] | Matched documents, best first. A document's position reflects its best hit; full-precision ties keep discovery order, because ranking happens before the emitted scores are rounded. |
Document object
| Key | Type | Meaning |
|---|---|---|
collection | string | Which collection the document came from. |
source_type | string, optional | The collection's reader type: localFiles, jira/jiraCloud, confluence/confluenceCloud, outline or github. Omitted when the collection's manifest does not record it. |
id | string | The document's identity inside its collection (a file name, a page id). |
path | string, optional | Absolute source path. Hoisted here only when the document's hit locators resolve to exactly one distinct path — code line_span hits, and page hits whose source path is known. headings and document hits carry no path, so a Markdown/Jira/Confluence document usually has url and no path. When the hits resolve to different files, no document-level path is set and each hit keeps its own locator.path. |
url | string, optional | Where a human or agent opens the whole document. Omitted when unknown, and dropped only when it equals file:// + the document's hoisted path (it then adds nothing) — a file:// url for a document with no hoisted path is kept. |
score_kind | string | What score means for this document: l2_squared (v1 collections), cosine or rerank (v2 collections). |
hits | object[] | The matched chunks of this document, best relevance first. |
Hit object
| Key | Type | Meaning |
|---|---|---|
relevance | float | Higher is better and comparable across collections and engines; 0–1 in normal use, not clamped. Use this to rank hits from different collections against each other. See Search Index. |
score | float | The raw engine score, rounded to 4 decimals. Only comparable within one score_kind — never between a v1 and a v2 collection. |
locator | object | Where the hit sits — see below. |
text | string | The matched chunk's text as indexed. kind: "document" means the position is unknown, so the text may still be a body fragment — not necessarily a title or the whole document. |
Locators
locator.kind is load-bearing: read only the keys that kind declares. Precision order is line_span > page > headings > document, and a position is never invented to fill the field. A chunk with line data and headings gets line_span only when a path resolves too; otherwise it falls through to page, headings or document.
kind | Keys | What it means |
|---|---|---|
line_span | start_line, end_line, optional path | Code. Lines are 1-based and inclusive — what grep -n prints. path appears only when it differs from the document's path. |
page | page, optional path | Paginated documents (PDF, DOCX). page is 1-based. |
headings | headings | Prose: Markdown, Jira, Confluence, Outline — the heading path down to the chunk. Never empty; a chunk with no real headings degrades to document. |
document | (none) | The chunk carries no usable position. Open the source for context — the chunk can be any body fragment, including one of many chunks. |
Failures
A failed request returns an error envelope with no schema key, and the CLI exits non-zero:
$ indexed index search "cache" -c nope --json
{
"error": "Collection 'nope' not found"
}
$ echo $?
1Check the exit status before parsing. On an ordinary return --json writes the payload to stdout and puts log lines and notices (a skipped unsearchable collection, a no-op --rerank) on stderr. An IndexedError that escapes the command handler is different: it is printed as a Rich error panel on stdout, exiting 1 (2 for configuration errors, 3 for storage errors), so stdout is not always JSON. Exit 0 is not proof of success either — with no collections at all the CLI prints {"error": "No collections found"} and exits 0. Branch on schema, never on the exit code alone.
indexed index inspect
indexed index inspect [OPTIONS] [NAME]| Argument / option | Description |
|---|---|
NAME | Optional. Omit to list all collections; set to inspect one in detail. |
--verbose / -v | When listing all collections, show more detail. |
Examples:
indexed index inspect
indexed index inspect my-docs
indexed --simple-output index inspectindexed index update
indexed index update [OPTIONS] [COLLECTION]| Argument / option | Description |
|---|---|
COLLECTION | Optional. Omit to update every collection. |
| Logging | --verbose / -v, --log-level, --json-logs |
Examples:
indexed index update eng-tickets
indexed index updateindexed index remove
indexed index remove [OPTIONS] COLLECTION| Option | Default | Description |
|---|---|---|
COLLECTION | — | Required: collection to remove. |
--force / -f | off | Skip confirmation. |
| Logging | --verbose / -v, --log-level, --json-logs |
Examples:
indexed index remove my-docs
indexed index remove my-docs --force