---
title: "Pseudo-state Selectors"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/selectors/pseudo-states"
image: "https://docs.vlt.io/og/client/selectors/pseudo-states"
lang: "en"
---

# Pseudo-state Selectors

Pseudo-state selectors match packages based on their relationship to the project or their dependency type. Unlike [pseudo-classes](https://docs.vlt.io/client/selectors/pseudo-classes.md), they don't take arguments.

## Graph structure states

| Selector     | Description                                 |
| ------------ | ------------------------------------------- |
| `:root`      | The root package (top-level `package.json`) |
| `:scope`     | The current scope of the selector           |
| `:project`   | Root node plus all workspaces               |
| `:workspace` | Workspace packages (listed in `vlt.json`)   |

### `:root`

Returns the root node — the package defined at the top-level `package.json` of your project.

```bash title="Terminal"
$ vlt query ':root'
```

Commonly used with [combinators](https://docs.vlt.io/client/selectors/combinators.md) to select direct dependencies:

```bash title="Terminal"
$ vlt query ':root > *'
```

### `:scope`

Returns the current scope of the selector. Useful when using the `--scope` CLI flag to limit the query context.

### `:project`

Returns the root node along with any workspaces declared in your project. Useful for selecting "your code" vs. third-party dependencies.

```bash title="Terminal"
$ vlt query ':project > *'
```

### `:workspace`

Matches workspace packages defined in your `vlt.json`.

```bash title="Terminal"
$ vlt query ':workspace'
```

Find workspaces that have changed since main:

```bash title="Terminal"
$ vlt query ':workspace:diff(main)'
```

## Type definition associations

| Selector | Matches                                     |
| -------- | ------------------------------------------- |
| `:types` | Packages with a types package in the graph  |
| `:type`  | Types packages, including explicit installs |

`@types/react` is associated with `react`; `@types/scope__name` is associated with `@scope/name`. Both lockfiles store the target name, including when the target is missing. Older lockfiles infer it on load.

```bash title="Terminal"
$ vlt query '#react:types'
```

```bash title="Terminal"
$ vlt query ':type'
```

Use `:type(orphan)` to find types packages whose target is missing:

```bash title="Terminal"
$ vlt query ':type(orphan)'
```

A missing target does not mean the types package is unused. For example, `@types/node` can be needed even though the Node.js runtime is not a package in the graph.

Use `:not(:type)` to exclude types packages from a query:

```bash title="Terminal"
$ vlt query ':not(:type)'
```

Associations match names across the graph, including workspaces, without checking version compatibility. Bundled definitions alone do not make a package match `:types`. These selectors do not change install, uninstall, script execution, or bin linking behavior.

## Dependency type states

| Selector      | Description                             |
| ------------- | --------------------------------------- |
| `:prod`       | Production dependencies                 |
| `:dev`        | Development-only dependencies           |
| `:optional`   | Optional dependencies                   |
| `:peer`       | Peer dependencies                       |
| `:missing`    | Dependencies declared but not installed |
| `:overridden` | Dependencies with an override applied   |

### `:prod`

Matches production dependencies:

```bash title="Terminal"
$ vlt query ':prod'
```

### `:dev`

Matches packages that are only used as dev dependencies:

```bash title="Terminal"
$ vlt query ':dev'
```

Find all dev dependencies that are outdated:

```bash title="Terminal"
$ vlt query ':dev:outdated'
```

### `:optional`

Matches optional dependencies:

```bash title="Terminal"
$ vlt query ':optional'
```

### `:peer`

Matches peer dependencies:

```bash title="Terminal"
$ vlt query ':peer'
```

### `:missing`

Matches edges (dependency declarations) that are not resolved to any installed package. This selector returns edges only — no nodes.

```bash title="Terminal"
$ vlt query ':missing'
```

### `:overridden`

Matches dependencies that have an override applied (via the `overrides` field in `package.json`):

```bash title="Terminal"
$ vlt query ':overridden'
```

## Package property states

| Selector      | Description                              |
| ------------- | ---------------------------------------- |
| `:private`    | Packages with `"private": true`          |
| `:empty`      | Packages with no dependencies            |
| `:link`       | Linked packages                          |
| `:prerelease` | Packages with prerelease versions        |
| `:built`      | Packages successfully built during reify |
| `:scanned`    | Packages with security metadata          |
| `:skills`     | Packages that ship agent skills          |

### `:private`

Matches packages with `"private": true` in their `package.json`:

```bash title="Terminal"
$ vlt query ':private'
```

### `:empty`

Matches packages that have no dependencies installed:

```bash title="Terminal"
$ vlt query ':empty'
```

### `:link`

Matches linked packages only:

```bash title="Terminal"
$ vlt query ':link'
```

### `:prerelease`

Matches packages whose version contains prerelease identifiers (e.g., `1.0.0-beta.1`, `2.0.0-rc.1+rev.2`, `0.0.0-canary`):

```bash title="Terminal"
$ vlt query ':prerelease'
```

Find direct prerelease dependencies:

```bash title="Terminal"
$ vlt query ':root > :prerelease'
```

### `:built`

Matches packages that have been successfully built during the reify process (have `buildState` set to `'built'`):

```bash title="Terminal"
$ vlt query ':built'
```

### `:scanned`

Matches packages that have [Socket](https://socket.dev/) security metadata. See [Security Insights](https://docs.vlt.io/client/selectors/security-insights.md) for security-specific selectors.

```bash title="Terminal"
$ vlt query ':scanned'
```

### `:skills`

Matches installed packages that ship [agent skills](https://docs.vlt.io/client/commands/skills.md): a root `SKILL.md`, or a `<dir>/SKILL.md` in `skills/`, `dist/skills/` or `.agents/skills/`, found as [`vlt skills` finds them](https://docs.vlt.io/client/commands/skills.md#how-vlt-finds-skills). Workspaces match too; the project root and `file:` packages never do.

```bash title="Terminal"
$ vlt query ':skills'
```

Direct dependencies that ship skills:

```bash title="Terminal"
$ vlt ls --target=':root > :skills'
```

Works in `vlt query`, `vlt ls`, `vlt build`, `--allow-skills`, `--allow-scripts` and `vlt skills`. Elsewhere (other commands' `--target`/`--scope`) it is an error.

## What gets selected

Given a monorepo:

```
my-monorepo (root)
├── packages/core (workspace, private)
│   ├── react@18.2.0 (prod)
│   └── vitest@1.0.0 (dev)
├── packages/utils (workspace)
│   └── lodash@4.17.21 (prod)
└── typescript@5.3.0 (dev)
```

| Query                | Selected                     |
| -------------------- | ---------------------------- |
| `:root`              | my-monorepo                  |
| `:workspace`         | core, utils                  |
| `:project`           | my-monorepo, core, utils     |
| `:private`           | core                         |
| `:dev`               | vitest, typescript           |
| `:prod`              | react, lodash                |
| `:root > :dev`       | typescript                   |
| `:workspace:private` | core                         |
| `:prerelease`        | (packages with pre-versions) |
| `:missing`           | (edges with no resolved pkg) |

## See also

- [Pseudo-class Selectors](https://docs.vlt.io/client/selectors/pseudo-classes.md) — functional selectors with arguments
- [Combinators](https://docs.vlt.io/client/selectors/combinators.md) — traverse the graph
- [Security Insights](https://docs.vlt.io/client/selectors/security-insights.md) — security pseudo-selectors
