PHPackages                             neos/contentrepository-debug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. neos/contentrepository-debug

ActiveNeos-package[Debugging &amp; Profiling](/categories/debugging)

neos/contentrepository-debug
============================

Debugger for Neos CR

1395↓48.9%PHP

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/neos/contentrepository-debug)[ Packagist](https://packagist.org/packages/neos/contentrepository-debug)[ RSS](/packages/neos-contentrepository-debug/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Content Repository Debugger (Neos.ContentRepository.Debug)
==========================================================

[](#content-repository-debugger-neoscontentrepositorydebug)

- [Content Repository Debugger (Neos.ContentRepository.Debug)](#content-repository-debugger-neoscontentrepositorydebug)
- [Interactive explorer (`cr:debug`)](#interactive-explorer-crdebug)
    - [Quick start](#quick-start)
    - [Resuming a session](#resuming-a-session)
    - [Built-in tools](#built-in-tools)
        - [Content Repository](#content-repository)
        - [Workspace &amp; Dimensions](#workspace--dimensions)
        - [Nodes](#nodes)
        - [Events](#events)
        - [Other](#other)
        - [Session](#session)
- [Debug scripts (`cr:debugScript`)](#debug-scripts-crdebugscript)
    - [`$dbg` API quick reference](#dbg-api-quick-reference)
    - [`$tools` API — calling explore tools from a script](#tools-api--calling-explore-tools-from-a-script)
    - [Event copying examples](#event-copying-examples)
    - [Querying the event log](#querying-the-event-log)
    - [Arbitrary queries via `$dbg->db`](#arbitrary-queries-via-dbg-db)
- [Debug Views in the database](#debug-views-in-the-database)
- [Virtual indices for JetBrains Database Tools](#virtual-indices-for-jetbrains-database-tools)
- [Configuration](#configuration)
- [Creating custom explore tools](#creating-custom-explore-tools)
    - [Minimal example](#minimal-example)
    - [Parameter injection in `execute()`](#parameter-injection-in-execute)
    - [Writing output — `ToolIOInterface`](#writing-output--tooliointerface)
    - [Return values and context manipulation](#return-values-and-context-manipulation)
    - [`WithContextChangeInterface` — lifecycle hooks](#withcontextchangeinterface--lifecycle-hooks)
    - [`AutoRunToolInterface` — auto-execute on availability](#autoruntoolinterface--auto-execute-on-availability)

Tools to explore and debug the Neos Content Repository. Two complementary interfaces:

- **`cr:debug`** — interactive CLI explorer: navigate nodes, inspect events, manage shadow CRs, check subscription health.
- **`cr:debugScript`** — run PHP scripts with a pre-wired `ContentRepositoryDebugger` and `ScriptToolRunner` for batch analysis and tool automation.

> **WARNING: Development only.**Never run against a production database. Always work with a local copy.

---

Interactive explorer (`cr:debug`)
=================================

[](#interactive-explorer-crdebug)

Quick start
-----------

[](#quick-start)

```
./flow cr:debug
```

Opens an interactive session against the `default` Content Repository. A numbered menu lists all available tools. **Availability is context-driven**: tools that require a workspace become available once one is set; tools that require a node become available once you select one.

On startup the session automatically checks subscription health and shows a warning if any projection is in an ERROR or non-ACTIVE state — run the `status` tool for the full stack trace.

Resuming a session
------------------

[](#resuming-a-session)

Pass context flags to jump straight into a specific state:

```
./flow cr:debug --node=
./flow cr:debug --node= --workspace=live
./flow cr:debug --node= --workspace=live --dsp='{"language":"en"}'
./flow cr:debug --cr=myCrId --node=
```

At the bottom of the tool chooser, the exact command to restore the current session is shown. Copy it to share with a colleague or bookmark a specific node.

Built-in tools
--------------

[](#built-in-tools)

Tools are grouped into four columns in the menu. Each tool is invoked by its short name.

### Content Repository

[](#content-repository)

Short nameToolWhat it does`crId`ChooseContentRepositorySwitch to a different (or dynamic/copy) CR; registers unknown CRs automatically`status`StatusSubscription health table, error details, and DB table sizes for the current CR`catchUp`CatchUpBoot → catchUp → reactivate all subscriptions`resetProjections`ResetTruncate all projection tables and reset subscription positions (⚠ DEV only)`crCopy`CrCopyCreate an exact DB-level clone of the current CR (useful for safe experimentation)### Workspace &amp; Dimensions

[](#workspace--dimensions)

Short nameToolWhat it does`wsId`ChooseWorkspaceList all workspaces in the current CR and pick one`dsp`ChooseDimensionSet the active dimension space point; shows covered DSPs for the current node if one is selected### Nodes

[](#nodes)

Short nameToolWhat it does`nId`SetNodeByUuidEnter a node UUID directly`n`NodeInfoNode identity, coverage, workspace presence, and URI path — **auto-runs** when a node is selected`nProps`NodePropertiesAll serialized properties as JSON (requires DSP)`nRefs`NodeReferencesOutgoing and incoming references with navigation into referenced nodes`cn`ChildNodesDirect children in the current subgraph; select one to navigate into it`pn`GoToParentNodeShows the full ancestor breadcrumb; navigate to any ancestor`nContentTree`ContentTreeFull content subtree under the current node`nDocTree`DocumentTreeDocument subtree with URI paths; auto-detects site root if no node is selected### Events

[](#events)

Short nameToolWhat it does`nHist`NodeHistoryAll events for the current node aggregate`docHist`PageHistoryCombined events for the current document and all its content children`seq`EventContextBrowse raw events around a given sequence number`graveyardCatchUp`EventGraveyardFault-tolerant catch-up: move failing events to a graveyard table (⚠ DEV only)`compactEvents`CompactEventsMerge consecutive `NodePropertiesWereSet` duplicates within live streams (⚠ modifies event store)`pruneRemovedContentStreams`PruneRemovedContentStreamsDelete event history for content streams no longer referenced by any workspace (⚠ irreversible)### Other

[](#other)

Short nameToolWhat it does`path`FindNodeByPathResolve a URL path to a node via the Neos routing projection (requires DSP)`types`NodeTypeExplorerBrowse node types in use, list aggregates of a chosen type, navigate to one`uriPath`NodeRoutingShow the URI path for the current node---

Debug scripts (`cr:debugScript`)
================================

[](#debug-scripts-crdebugscript)

For batch analysis and automation, write a PHP script and run it with:

```
./flow cr:debugScript MyScript.php
./flow cr:debugScript MyScript.php --contentRepository=myCrId
```

Inside the script three variables are pre-wired for you:

- `$dbg` — `Neos\ContentRepository\Debug\ContentRepositoryDebugger` — SQL-level event analysis and CR management
- `$cr` — `Neos\ContentRepository\Core\ContentRepository` — the CR passed via `--contentRepository`, or `default`
- `$tools` — `Neos\ContentRepository\Debug\Explore\Script\ScriptToolRunner` — call any interactive tool programmatically

Example script:

```
