DialogueDown.Cli 0.2.0

Prefix Reserved
dotnet tool install --global DialogueDown.Cli --version 0.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local DialogueDown.Cli --version 0.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=DialogueDown.Cli&version=0.2.0
                    
nuke :add-package DialogueDown.Cli --version 0.2.0
                    

<p align="center"> <img src="assets/logo.svg" alt="DialogueDown logo" width="120" height="120" /> </p>

<p align="center"> <a href="https://www.nuget.org/packages/DialogueDown.Cli"><img src="https://img.shields.io/nuget/v/DialogueDown.Cli?logo=nuget&label=DialogueDown.Cli" alt="DialogueDown.Cli on NuGet" /></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/pengzhengyi/dialoguedown" alt="MIT license" /></a> </p>

DialogueDown

Engine-agnostic, C#-first dialogue compiler library. It lowers a Markdown-first dialogue script through distinct compiler stages into a validated semantic model, reporting precise diagnostics as it goes, and keeps the core free of any Godot dependency so it stays reusable and unit-testable. The ddown CLI compiles scripts and renders every stage as an interactive report. The runtime that plays a compiled script — a dialogue runner and thin engine presentation adapters — is planned, not yet built.

DialogueDown is a work-in-progress open-source project. The public API, script language, and runtime model may change while the library is still in early development.

Table of contents

Status

  • Maturity: early development.
  • Target frameworks: the libraries a game references ship for both net8.0 and net10.0, so a Godot project keeps Godot's bundled runtime while the toolchain moves to .NET 10 LTS. The ddown CLI targets net10.0. See the Target Frameworks note.
  • Engine dependency: none in the core library.
  • Primary consumer: Godot/C# game projects through ProjectReference.
  • Built today: the compiler pipeline (Markdown → semantic model), collected diagnostics, the ddown CLI (compile, visualize), and dialogue.toml configuration.
  • Planned: the runtime — a dialogue runner, effects and conditions, and thin engine presentation adapters.

How it works

DialogueDown compiles a Markdown-first dialogue script through a pipeline of small, independently testable stages, behind one IScriptCompiler facade (wire it up with AddDialogueDown() for DI, or ScriptCompilerFactory.CreateDefault()):

flowchart LR
    Src["Markdown<br/>script"] --> MD["Markdown<br/>AST"] --> DA["Dialogue<br/>AST"]
    DA --> DS["Desugared<br/>AST"] --> SM["Semantic<br/>model"]
  • Stages. Parse → transpile → desugar → analyze, each a documented stage. Read them in pipeline order in the design notes.
  • Diagnostics. Every problem is a located diagnostic with a stable DLG#### code and a severity; the compiler collects them and continues where it safely can, rather than stopping at the first. See the error codes.
  • Configuration. A project's dialogue.toml declares its speakers and the compilation mode, and the CLI finds it automatically. See project configuration.
  • Planned runtime. Playing a compiled script — a runner, effects and conditions, and thin engine adapters — is design intent, not yet implemented.

Install the ddown command (setup guide), then compile a script and see its diagnostics:

ddown compile scene.dialogue.md

Contributors can run the same CLI from a source checkout without installing it:

dotnet run --project src/DialogueDown.Cli -- compile scene.dialogue.md

Layout

Path Purpose
src/DialogueDown/ the reusable class library (net8.0 + net10.0, no engine refs)
src/DialogueDown.Visualization/ diagnostics-only visualizer of compiler stages (not shipped in the core package)
src/DialogueDown.Visualization.Live/ loopback server that serves the report shell (with the Explorer), hot-reloads it on edit, and browses the project
src/DialogueDown.Cli/ the ddown command-line interface (compile, visualize)
tests/DialogueDown.Tests/ xUnit tests for the pure logic
tests/DialogueDown.Visualization.Tests/ xUnit tests for the visualizer
tests/DialogueDown.Visualization.Live.Tests/ xUnit tests for the live server
tests/DialogueDown.Cli.Tests/ xUnit tests for the CLI

Build and test

Restore, build, and test the solution:

dotnet restore DialogueDown.sln
dotnet build DialogueDown.sln --configuration Release --no-restore
dotnet test DialogueDown.sln --configuration Release --no-build --minimum-expected-tests 3000

To collect source-focused coverage for the core library:

dotnet tool restore
dotnet test DialogueDown.sln \
  --coverlet \
  --coverlet-output-format cobertura \
  --coverlet-include "[DialogueDown*]*" \
  --minimum-expected-tests 3000
dotnet reportgenerator \
  "-reports:TestResults/coverage.cobertura.*.xml" \
  "-targetdir:coverage-report" \
  "-reporttypes:Html;MarkdownSummary;Cobertura"

Coverage is verified against the DialogueDown and DialogueDown.Visualization source assemblies and excludes test files. The collector writes Cobertura XML under TestResults/, and ReportGenerator writes an interactive HTML report to coverage-report/index.html. Both output folders are ignored by Git.

CI fails if line coverage drops below 90% or branch coverage below 85%, and emits a warning when line coverage is below 100%.

Documentation

📖 Documentation site — the writer guide, the contributing docs and per-stage design notes, and the generated C# API reference, published from docs/ on every merge to main.

In the repository:

Compilation visualization

<p align="center"> <img src="assets/logo-pipeline.svg" alt="A choice node branching to two options that each lead to a scene" width="132" height="132" /> </p>

▶ Try the live demo — an interactive, read-only report for a sample script, served from GitHub Pages and rebuilt on every merge to main.

DialogueDown is transparent end to end: you can see what the compiler produced at each stage. The optional DialogueDown.Visualization project renders the compiler's stages as a single, self-contained HTML report — a Source tab with a live preview, working anchor links, and rendered fenced Mermaid diagrams; graph tabs for the Markdown AST, Dialogue AST, Desugared AST, and Dialogue Graph; and a Semantic Model tab that pairs the resolved scene tree with cross-linked speaker, anchor, and jump-resolution tables. A served report toggles between read-only View and an in-browser Edit mode — with document-aware autocomplete for jump targets, speakers, @ids, and #tags — that saves back to the file. It bundles all its assets (D3, Mermaid, DOMPurify, CodeMirror, Pico.css, marked, and Tippy.js) so it works fully offline, and reads the compiler through the same seams the tests use, never touching the shipped core package.

Render a script from the command line with the ddown visualize command (setup guide):

# Open the report shell on your project — browse or create a script in the Explorer
ddown visualize

# Serve a script's report and toggle View ⇄ Edit in the browser (auto-updates on save)
ddown visualize scene.dialogue.md --root .

# Start directly in Edit (editable, saves back to the file)
ddown visualize scene.dialogue.md --edit --root .

# Export a self-contained report to a file (no server, no browser)
ddown visualize scene.dialogue.md -o report.html

# Emit each stage's graph as Graphviz DOT text (to stdout or -o)
ddown compile scene.dialogue.md --emit dot -o scene.dot

The visualizer is a diagnostics helper, built quickly with lighter review than the core library; its API and abstractions may still change.

See the Compilation Visualization note.

Similar projects

DialogueDown is intentionally small, engine-agnostic, and C#-first. These projects are useful references if you need a different tradeoff:

Project What it does How DialogueDown differs
Ink Mature interactive-fiction scripting language and runtime with strong authoring tools. DialogueDown keeps Markdown-like source close to game writing notes and focuses on a lightweight C# library that Godot projects can reference directly.
Yarn Spinner Full-featured Yarn dialogue compiler/runtime with a writer-friendly scripting language and broad engine integrations. DialogueDown is narrower and dependency-light: it prioritizes a Markdown-first C# compiler with explicit stage visualization over a larger cross-engine toolchain.
Dialogic Feature-rich Godot dialogue plugin with visual editing, portraits, timelines, variables, and localization. DialogueDown deliberately avoids Godot dependencies in the core so dialogue logic stays reusable, unit-testable, and portable across consuming games.
Godot Dialogue Manager Godot-native dialogue manager and scripting workflow for branching conversations. DialogueDown targets engine-agnostic C# packages first, leaving Godot presentation and input as thin adapters in each game.
Godot Ink Godot integration for Ink stories. DialogueDown is not an Ink bridge; it explores a smaller Markdown-to-dialogue pipeline with compiler-stage visualization for debugging and teaching.

Contributing

Contributions are welcome while the project is still taking shape. Start with CONTRIBUTING.md for local setup, commit style, tests, and pull request expectations.

Please follow the Code of Conduct in all project spaces.

Security

Please don't report vulnerabilities in public issues. See SECURITY.md for the current reporting process.

License

DialogueDown is released under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.0 123 8/25/2026
0.1.0 132 7/28/2026