Skip to content

CLI REPL And Documentation

Chris Michael edited this page Sep 2, 2026 · 2 revisions

Pudu

CLI, REPL, And Documentation

pudu <command>

Status: commands listed below are implemented by the pudu executable.

Command Contract
pudu Start puduci.
pudu repl [file] Start the REPL, optionally loading a program.
pudu check <file>... Compile roots and report diagnostics.
pudu run <file> Compile, link imports, and interpret main.
pudu explain <file> Run and report evaluator costs.
pudu lsp Speak LSP over stdio.
pudu fmt <file>... Rewrite into canonical formatting.
pudu fmt --check <file>... Report non-canonical files without changing them.
pudu fmt --stdout <file> Write formatted text to stdout.
pudu doc <file>... Render the program documentation index.
pudu doc --json <file>... Emit the same index as JSON.
pudu doc --html <file>... Emit a self-contained searchable HTML page.
pudu search <query> <file>... Search by name or type shape.
pudu version Print the package version.
pudu help Print usage.

Commands that compile sources use the same program graph and diagnostic model. A missing or unreadable root is a structured compiler diagnostic, not an unrelated preflight error.

REPL

Bindings and declarations persist across accepted entries. A rejected entry leaves the session unchanged. Loaded modules retain their type and implementation context.

Useful commands include:

Command Purpose
:t / :type Report the inferred type.
:load Load a source file.
:browse List declarations.
:info Show declaration information.
:instances Show implementations.
:doc Show documentation.
:search Search names or type shapes.
:set +t Show types after results.
:set +s Show evaluation timing/cost information.

:? prints the complete command list. Completion includes REPL commands, session names, paths, and methods available after a dot.

Documentation model

The compiler owns one DocIndex. Terminal output, JSON, HTML, LSP hover, definitions, symbols, and search project that same checked index instead of re-parsing declarations separately.

Related

Clone this wiki locally