Skip to main content
OmniScript 2.0

CLI reference

One binary, osf, for everything. Every command also takes -h/--help and -V/--version; osf <command> --help prints the details shown here.

osf lint report.osf
osf render report.osf --target pdf -o report.pdf
osf query report.osf 'finding[confidence>=0.8]'
osf serve mcp .
CommandDoes
osf parseParse a document and print its JSON.
osf lintCheck documents (files or directories) for errors and warnings. Exit status 1 on errors.
osf fmtFormat documents (files or directories) in place. Lossless: comments and content are kept.
osf formatPrint a formatted document (`osf fmt` edits files in place).
osf diffSemantic diff of two documents: blocks added, removed and moved, properties and content changed. Blocks are matched by id.
osf renderRender a document to html, pdf, docx, pptx, xlsx, md, json or typst. Alias: export.
osf evalEvaluate sheet formulas and show the values.
osf themesList the built-in themes with their colours and fonts.
osf queryFind blocks with a selector, e.g. 'finding[confidence>=0.8]'.
osf graphPrint the reference graph.
osf serve mcpMCP server over stdio, or streamable HTTP with --listen. Serves a directory or .osf files (default: the current directory).
osf serve a2aRun a document as an A2A agent. The document needs an @agent_card.
osf serve httpPreview the documents in a directory in a browser.
osf cardPrint the document's A2A Agent Card. --url replaces the url in @agent_card.
osf skillInstall the osf Agent Skill, or print its SKILL.md.
osf lspRun the language server on stdio (used by the VS Code extension and other editors).
osf checkRun the conformance corpus (default spec/conformance).
osf schemaPrint the JSON Schema of the canonical JSON.
osf completionsPrint shell completions for bash, elvish, fish, powershell or zsh.

Check and format

osf parse

Parse a document and print its JSON.

osf parse [OPTIONS] <FILE>
FlagMeaning
-q, --quietPrint only diagnostics
--spansInclude source spans in the JSON
--no-includesDo not resolve @include directives
--max-depth <N>Maximum include depth (default 10)

osf lint

Check documents (files or directories) for errors and warnings. Exit status 1 on errors.

osf lint [OPTIONS] <FILES>...
FlagMeaning
--jsonPrint diagnostics as JSON
--fixAlso format the files in place
--deny-warningsTreat warnings as errors
--no-includesDo not resolve @include directives
--max-depth <N>Maximum include depth (default 10)
osf lint docs/ --deny-warnings

osf fmt

Format documents (files or directories) in place. Lossless: comments and content are kept.

osf fmt [OPTIONS] <FILES>...
FlagMeaning
--checkReport files that are not formatted; change nothing
--stdoutPrint the result instead of writing it
osf fmt --check .

osf format

Print a formatted document (`osf fmt` edits files in place).

osf format [OPTIONS] <FILE>
FlagMeaning
-o, --output <file>Write to this file instead of stdout
--no-includesDo not resolve @include directives
--max-depth <N>Maximum include depth (default 10)

osf diff

Semantic diff of two documents: blocks added, removed and moved, properties and content changed. Blocks are matched by id.

osf diff [--json] <OLD> <NEW>

Render

osf render

Render a document to html, pdf, docx, pptx, xlsx, md, json or typst. Alias: export.

osf render [OPTIONS] <FILE>
FlagMeaning
-t, --target <target>Output format (default html)
-o, --output <file>Output file. Text formats go to stdout when omitted; binary formats next to the input
--theme <name>default, corporate, academic, modern, dark, minimal
--page-size <size>Page size for PDF and DOCX: a4 (default), letter or legal
--landscapeLandscape pages
--pdf-uaAccessible PDF (PDF/UA-1)
--fragmentHTML fragment instead of a full page
--no-metadataLeave out the @meta title block
--mermaid <cmd>Command that renders Mermaid for print formats, called as `<cmd> -i in.mmd -o out.svg` (e.g. "mmdc")
--allow-net[=<servers>]Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers
--mcp-config <file>MCP server configuration file (mcpServers JSON)
--no-includesDo not resolve @include directives
--max-depth <N>Maximum include depth (default 10)
osf render report.osf --target pdf --theme academic --pdf-ua -o report.pdf

osf eval

Evaluate sheet formulas and show the values.

osf eval [OPTIONS] <FILE>
FlagMeaning
--jsonJSON output
--allow-net[=<servers>]Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers
--mcp-config <file>MCP server configuration file (mcpServers JSON)

osf themes

List the built-in themes with their colours and fonts.

osf themes

Query

osf query

Find blocks with a selector, e.g. 'finding[confidence>=0.8]'.

osf query [--json] <FILE> <SELECTOR>
osf query report.osf '#D-1 -> criteria' --json

osf graph

Print the reference graph.

osf graph [OPTIONS] <FILE>
FlagMeaning
--dotGraphviz DOT output
--jsonJSON output: { nodes, edges }

Serve and agents

osf serve mcp

MCP server over stdio, or streamable HTTP with --listen. Serves a directory or .osf files (default: the current directory).

osf serve mcp [OPTIONS] [PATHS]...
FlagMeaning
--listen <addr>Serve over streamable HTTP on this address, e.g. 127.0.0.1:8091
--writeAllow osf.set to write files
--allow-net[=<servers>]Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers
--mcp-config <file>MCP server configuration file (mcpServers JSON)

osf serve a2a

Run a document as an A2A agent. The document needs an @agent_card.

osf serve a2a [OPTIONS] <FILE>
FlagMeaning
--listen <addr>Address to listen on (default 127.0.0.1:8090)
--url <url>Public URL to advertise in the Agent Card
--token <token>Token for the security scheme declared in @agent_card (env OSF_A2A_TOKEN)
--writeAllow skills that change the document
--allow-net[=<servers>]Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers
--mcp-config <file>MCP server configuration file (mcpServers JSON)

osf serve http

Preview the documents in a directory in a browser.

osf serve http [OPTIONS] [DIR]
FlagMeaning
--listen <addr>Address to listen on (default 127.0.0.1:8080)
--allow-net[=<servers>]Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers
--mcp-config <file>MCP server configuration file (mcpServers JSON)

osf card

Print the document's A2A Agent Card. --url replaces the url in @agent_card.

osf card [--url <url>] <FILE>

osf skill

Install the osf Agent Skill, or print its SKILL.md.

osf skill install [--for <target>] | osf skill show
FlagMeaning
--for <target>claude (~/.claude/skills, default), project (./.claude/skills), agents (~/.agents/skills) or a directory

osf lsp

Run the language server on stdio (used by the VS Code extension and other editors).

osf lsp

Tooling

osf check

Run the conformance corpus (default spec/conformance).

osf check [DIR]

osf schema

Print the JSON Schema of the canonical JSON.

osf schema

osf completions

Print shell completions for bash, elvish, fish, powershell or zsh.

osf completions <SHELL>

Aliases

osf export is the same command as osf render, and --format is accepted for --target. Includes are resolved by default; --no-includes turns them off.