@wienerberliner/pi-markdown-reader

Pi extension tools for deterministic, structure-aware Markdown outline and section reading.

Packages

Package details

extension

Install @wienerberliner/pi-markdown-reader from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@wienerberliner/pi-markdown-reader
Package
@wienerberliner/pi-markdown-reader
Version
0.1.0
Published
Jul 8, 2026
Downloads
not available
Author
wienerberliner
License
MIT
Types
extension
Size
23.4 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-markdown-reader

Pi extension tools for deterministic, structure-aware Markdown reading.

Instead of sampling long Markdown files with brittle line ranges, agents can inspect a compact outline first, then read complete sections by exact pathSlug.

Install

pi install npm:@wienerberliner/pi-markdown-reader

Then restart Pi or run /reload.

Tools

markdown_outline

Returns a flat, source-ordered table of contents for a Markdown file:

  • heading level and title
  • hierarchical pathSlug
  • startLine, endLine, and lineCount
  • optional frontmatter metadata (pathSlug, keys, line span)

Example:

{
  "path": "report.md",
  "includeFrontmatter": true
}

markdown_read

Reads one or more complete Markdown sections by exact pathSlug.

The LLM-facing result is plain Markdown text. Metadata stays in tool details.

Example:

{
  "path": "report.md",
  "sections": [
    { "pathSlug": "abstract" },
    { "pathSlug": "results/evidence" }
  ]
}

If a document has YAML frontmatter, it can be read with:

{ "pathSlug": "frontmatter" }

markdown_index

Indexes a directory of Markdown files without reading full bodies. Useful for folders of reports, notes, and generated artifacts.

Development

npm install
npm test
npm run typecheck

For local Pi development in this repository, trust the project and reload Pi. The project .pi/settings.json shadows the published npm package and loads the local checkout.

License

MIT