
# Selectors Overview

Selectors are the composable query grammar for Context Nest. They let you precisely describe which documents you want — by tag, type, status, pack, node id, or any combination.

## Quick reference

```bash
ctx query "#engineering"                        # By tag (tag:#engineering also works)
ctx query "type:document"                       # By type
ctx query "status:published"                    # By status
ctx query "pack:engineering-essentials"         # By pack
ctx query "nodes/api-design"                    # One document, by node id
ctx query "#api +status:published"              # AND (intersection)
ctx query "#api |#v2"                           # OR (union)
ctx query "#engineering -#deprecated"           # NOT (exclude)
ctx query "(#api |#sdk) +status:published"      # Grouped
```

## Grammar

A selector expression is composed of **atoms** combined with **operators**:

- **Atoms** — a tag, a type, a status, a pack, a document title (`[[Title]]`), a scope, or a node id.
- **Operators** — `+` (AND), `|` (OR), `-` (NOT).
- **Grouping** — parentheses `( )`.

The old `&` operator is not valid. `ctx` rejects it with `INVALID_SELECTOR`. There is no `path:` glob atom, and `transport:` and `server:` are not query atoms (they describe how a source node connects, not how you select it).

See [Atoms](https://nest.promptowl.ai/d/promptowl-documents/protocol/selectors/atoms) and [Operators](https://nest.promptowl.ai/d/promptowl-documents/protocol/selectors/operators) for the full reference.
