Run artifact

workspace/targets/commonmark/blueprint/FEATURE-CLI-ENTRYPOINT.md

FEATURE: CLI Entry Point

FieldValue
Version20260812 V1
DescriptionProvides the executable standard-input and standard-output CommonMark interface.
Depends OnARCHITECTURE.md
Providesparser executable
Consumesparser core, HTML renderer

Workflow

The executable reads UTF-8 Markdown from standard input. It parses block structure before inline structure, renders the resulting document as HTML, and writes only rendered HTML to standard output. A successful invocation exits with status 0.

The executable is named cmark and is invokable from the build directory as ./cmark. It supports the supplied harness's program invocation contract.

Programmatic Acceptance

Requires: executable=cmark; scope=test

=== AC cli-stdin-stdout ===
Intent: The executable renders Markdown supplied through standard input and exits successfully.

import subprocess

result = subprocess.run( ["./cmark"], input="# Hello\n\nworld\n", capture_output=True, text=True, encoding="utf-8", ) print(result.stdout) print(result.stderr, file=import("sys").stderr) assert result.returncode == 0 assert result.stdout == "<h1>Hello</h1>\n<p>world</p>\n" === END AC cli-stdin-stdout ===

=== AC cli-utf8 ===
Intent: The executable accepts UTF-8 Markdown and emits UTF-8 HTML.

import subprocess

result = subprocess.run( ["./cmark"], input="cafe\n", capture_output=True, text=True, encoding="utf-8", ) assert result.returncode == 0 assert result.stdout == "<p>cafe</p>\n" === END AC cli-utf8 ===

User Acceptance

Guardrails