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. With --redline, a word-level redline instead.
osf spellCheck the spelling of prose with an installed Hunspell dictionary. Dictionaries are found in OSF_DICT_PATH, ~/.config/osf/dictionaries, ~/.local/share/hunspell and /usr/share/hunspell. Words in @meta spell_ignore are accepted.
osf renderRender a document to html, pdf, docx, pptx, xlsx, md, json, typst, epub, odt or ods. Alias: export.
osf importConvert Markdown, DOCX, XLSX, ODS or CSV into an OSF document. Markdown footnotes, math and Mermaid or DOT fences are kept; DOCX tracked insertions are kept and deletions dropped.
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 searchFull-text search (BM25) across documents in files or directories, with snippets. Also the MCP tool osf.search.
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 serve collabEdit one document together in the browser: live, conflict-free (Yjs CRDT), with a preview, diagnostics and autosave.
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. With --redline, a word-level redline instead.

osf diff [OPTIONS] <OLD> <NEW>
FlagMeaning
--jsonPrint the diff as JSON
--redline <format>Write a redline: html, md, pdf or docx (Word tracked changes you can accept or reject)
-o, --output <file>Redline output file (stdout for html and md when omitted)
--allInclude unchanged blocks in the redline
osf diff v1.osf v2.osf --redline docx -o changes.docx

osf spell

Check the spelling of prose with an installed Hunspell dictionary. Dictionaries are found in OSF_DICT_PATH, ~/.config/osf/dictionaries, ~/.local/share/hunspell and /usr/share/hunspell. Words in @meta spell_ignore are accepted.

osf spell [OPTIONS] <FILE>
FlagMeaning
--lang <lang>Language (default: @meta language, else en-US)
--dict <file.dic>Dictionary to use (its .aff next to it)

Render

osf render

Render a document to html, pdf, docx, pptx, xlsx, md, json, typst, epub, odt or ods. 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)
--pdf-standard <list>PDF standards, comma-separated: a-1b … a-4e (PDF/A), ua-1, 1.7, 2.0. Also @meta pdf_standard
--fragmentHTML fragment instead of a full page
--no-metadataLeave out the @meta title block
--mermaid <cmd>Command that renders Mermaid instead of the built-in renderer (flowchart, sequence, state, class, pie), 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 import

Convert Markdown, DOCX, XLSX, ODS or CSV into an OSF document. Markdown footnotes, math and Mermaid or DOT fences are kept; DOCX tracked insertions are kept and deletions dropped.

osf import [OPTIONS] <FILE>
FlagMeaning
-o, --output <file>Output file (stdout when omitted)
--from <format>md, docx, xlsx, ods or csv, when the extension does not tell
osf import notes.md -o notes.osf

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 serve collab

Edit one document together in the browser: live, conflict-free (Yjs CRDT), with a preview, diagnostics and autosave.

osf serve collab [OPTIONS] <FILE>
FlagMeaning
--listen <addr>Address to listen on (default 127.0.0.1:8095)
--token <token>Token collaborators pass as ?token=; required when not listening on localhost, otherwise a random one is made and printed in the link. Also OSF_COLLAB_TOKEN
--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 collab paper.osf

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.