> ## Documentation Index
> Fetch the complete documentation index at: https://xspec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# xspec ids and show: Inspect Requirements

> Reference for xspec ids (list all requirement IDs with optional tree view) and xspec show (print full node detail including hashes, edges, and text).

`ids` and `show` are your primary human-readable inspection commands. Use `ids` to navigate the full set of requirement identifiers in your workspace, and `show` to examine every attribute of a single node in detail.

## xspec ids

`ids` prints every requirement ID in your workspace. Without flags it produces a flat, sorted list; with `--tree` it renders the hierarchy.

```sh theme={null}
xspec ids [--tree] [--file <glob>] [--unreferenced]
```

### Flags

<ParamField path="--tree" type="flag">
  Render IDs as a nested tree that reflects the containment hierarchy of your spec files.
</ParamField>

<ParamField path="--file" type="glob">
  Restrict output to nodes defined in files whose workspace-relative paths match the given glob pattern.
</ParamField>

<ParamField path="--unreferenced" type="flag">
  Show only nodes that have no incoming dependency edges. Containment edges (`contains`) are not counted — a node is considered unreferenced only if nothing declares a `depends`, `embeds`, or `references` edge pointing to it.
</ParamField>

### Tree output example

```sh theme={null}
$ xspec ids --tree
specs/AUTH.mdx
  auth
    auth.login
      auth.login.valid
      auth.login.invalid
    auth.lockout
```

### Flat output example

```sh theme={null}
$ xspec ids
auth
auth.login
auth.login.invalid
auth.login.valid
auth.lockout
```

### JSON output

Pass `--json` to receive a JSON array of identity strings, suitable for piping into other tools.

```sh theme={null}
$ xspec ids --json
["auth","auth.login","auth.login.invalid","auth.login.valid","auth.lockout"]
```

## xspec show

`show` prints the complete record for a single node: its identity, source byte range, tags, coverage attribute, all four content hashes, every incoming and outgoing edge grouped by kind, the node's own text, and its full subtree text.

```sh theme={null}
xspec show <node>
```

`<node>` is either `path#id` for a specific node, or a bare `path` to refer to the file root node.

### Output example

```sh theme={null}
$ xspec show "specs/AUTH.mdx#auth.login.valid"
specs/AUTH.mdx#auth.login.valid
source range: bytes 104-202
tags: happy-path
coverage: required
hashes:
  ownHash: b235263b…
  subtreeHash: bc3ccfe3…
  effectiveHash: 08b71bba…
  metadataHash: d2d935c3…
edges:
  incoming:
    contains from specs/AUTH.mdx#auth.login
    references from src/auth.ts#login
    embeds from test/auth.test.ts#testValidLogin
    references from test/auth.test.ts#testValidLogin
  outgoing:
own text:
  A user submitting valid credentials is signed in.
subtree text:
  A user submitting valid credentials is signed in.
```

### Hash meanings

| Hash            | What it covers                                             |
| --------------- | ---------------------------------------------------------- |
| `ownHash`       | The node's own text and metadata, excluding descendants    |
| `subtreeHash`   | The node and all descendants                               |
| `effectiveHash` | The subtree hash plus all transitively depended-on content |
| `metadataHash`  | Tags, coverage attribute, and structural position          |

## show vs query node

`xspec show` and `xspec query node` return the same information. `show` is formatted for human reading; `query node` always emits JSON. Use `show` when you are working interactively at the terminal and `query node` when you need machine-readable output for scripts or CI tooling.
